Create a customer for an indirect reseller

Applies To

  • Partner Center

How an indirect provider can create a customer for an indirect reseller.


  • Credentials as described in Partner Center authentication. This scenario supports authentication with App+User credentials only.
  • The tenant identifier of the indirect reseller.
  • The indirect reseller must have a partnership with the indirect provider.


To add a new customer for an indirect reseller, start by instantiating a new Customer object and then instantiate and populate the BillingProfile and CompanyProfile. Be sure to assign the indirect reseller ID to the AssociatedPartnerID property.

Then, use the IAggregatePartners.Customers property to get an interface to customer collection operations. Finally, call the Create or CreateAsync method to create the customer.

// IAggregatePartner partnerOperations;
// var indirectResellerId;
var customerToCreate = new Customer()
    CompanyProfile = new CustomerCompanyProfile()
        Domain = string.Format(CultureInfo.InvariantCulture, 
            new Random().Next(), 
    BillingProfile = new CustomerBillingProfile()
        Culture = "EN-US",
        Email = "",
        Language = "En",
        CompanyName = "Wingtip Toys" + new Random().Next(),
        DefaultAddress = new Address()
            FirstName = "Gena",
            LastName = "Soto",
            AddressLine1 = "One Microsoft Way",
            City = "Redmond",
            State = "WA",
            Country = "US",
            PostalCode = "98052",
            PhoneNumber = "4255550101"
    AssociatedPartnerId = indirectResellerId

var newCustomer = partnerOperations.Customers.Create(customerToCreate);

Sample: Console test app. Project: Partner Center SDK Samples Class: CreateCustomerforIndirectReseller.cs


Request syntax

Method Request URI
POST {baseURL}/v1/customers HTTP/1.1

Request headers

Request body

This table describes the required properties in the request body.

Name Type Required Description
BillingProfile object Yes The customer's billing profile information.
CompanyProfile object Yes The customer's company profile information.
AssociatedPartnerId string Yes The indirect reseller ID. Note that the indirect reseller as indicated by the ID supplied here must have a partnership with the indirect provider or the request will fail. Also note that if the AssociatedPartnerId value is not supplied, the customer is created as a direct customer of the indirect provider rather than the indirect reseller.

Billing Profile

This table describes the minimum required fields from the CustomerBillingProfile resource needed to create a new customer.

Name Type Required Description
email string Yes The customer's email address.
culture string Yes Their preferred culture for communication and currency, such as "en-US". See Table of Language Culture Names for the supported cultures.
language string Yes The default language. Two character language codes (e.g., en, fr) are supported.
company_name string Yes The registered company/organization name.
default_address Address Yes The registered address of the customer's company/organization. See the Address resource for information on any length limitations.

Company Profile

This table describes the minimum required fields from the CustomerCompanyProfile resource needed to create a new customer.

Name Type Required Description
domain string .Yes The customer's domain name, such as

Request example

Authorization: Bearer <token>
MS-RequestId: d628adbe-b7ee-412e-ac55-58f22b4ba2f4
MS-CorrelationId: 0dd197a8-992c-44ca-aeae-21cd83494dce
X-Locale: en-US
MS-PartnerCenter-Client: Partner Center .NET SDK
Content-Type: application/json
Content-Length: 823
Expect: 100-continue
Connection: Keep-Alive

    "Id": null,
    "CommerceId": null,
    "CompanyProfile": {
        "TenantId": null,
        "Domain": "",
        "CompanyName": null,
        "Attributes": {
            "ObjectType": "CustomerCompanyProfile"
    "BillingProfile": {
        "Id": null,
        "FirstName": null,
        "LastName": null,
        "Email": "",
        "Culture": "EN-US",
        "Language": "En",
        "CompanyName": "Wingtip Toys678152504",
        "DefaultAddress": {
            "Country": "US",
            "Region": null,
            "City": "Redmond",
            "State": "WA",
            "AddressLine1": "One Microsoft Way",
            "AddressLine2": null,
            "PostalCode": "98052",
            "FirstName": "Gena",
            "LastName": "Soto",
            "PhoneNumber": "4255550101"
        "Attributes": {
            "ObjectType": "CustomerBillingProfile"
    "RelationshipToPartner": "none",
    "AllowDelegatedAccess": null,
    "UserCredentials": null,
    "CustomDomains": null,
    "AssociatedPartnerId": "484e548c-f5f3-4528-93a9-c16c6373cb59",
    "Attributes": {
        "ObjectType": "Customer"


If successful, the response contains a Customer resource for the new customer.

Response success and error codes

Each response comes with an HTTP status code that indicates success or failure and additional debugging information. Use a network trace tool to read this code, error type, and additional parameters. For the full list, see Partner Center REST error codes.

Response example

HTTP/1.1 201 Created
Content-Length: 1085
Content-Type: application/json; charset=utf-8
MS-CorrelationId: 0dd197a8-992c-44ca-aeae-21cd83494dce
MS-RequestId: d628adbe-b7ee-412e-ac55-58f22b4ba2f4
MS-CV: Yy/YaA0gYEmfQyR/.0
MS-ServerId: 030020525
Date: Tue, 06 Jun 2017 23:11:40 GMT

    "id": "626099fe-17af-4756-9fd0-6a73b7127859",
    "commerceId": "626099fe-17af-4756-9fd0-6a73b7127859",
    "companyProfile": {
        "tenantId": "626099fe-17af-4756-9fd0-6a73b7127859",
        "domain": "",
        "companyName": "Wingtip Toys678152504",
        "links": {
            "self": {
                "uri": "/customers/626099fe-17af-4756-9fd0-6a73b7127859/profiles/company",
                "method": "GET",
                "headers": []
        "attributes": {
            "objectType": "CustomerCompanyProfile"
    "billingProfile": {
        "id": "7079246e-7b62-56ef-7cbd-a819514b54b5",
        "email": "",
        "culture": "en-US",
        "language": "En",
        "companyName": "Wingtip Toys678152504",
        "defaultAddress": {
            "country": "US",
            "city": "Redmond",
            "state": "WA",
            "addressLine1": "One Microsoft Way",
            "postalCode": "98052",
            "firstName": "Gena",
            "lastName": "Soto",
            "phoneNumber": "4255550101"
        "attributes": {
            "etag": "-8799889149591823008",
            "objectType": "CustomerBillingProfile"
    "relationshipToPartner": "reseller",
    "allowDelegatedAccess": true,
    "userCredentials": {
        "userName": "admin",
        "password": "0Krha*Io"
    "associatedPartnerId": "484e548c-f5f3-4528-93a9-c16c6373cb59",
    "attributes": {
        "objectType": "Customer"