Reseller API: Manage customers

Order a new customer account

To create a new customer account, use the following POST request and include the authorization token described in Authorizing requests. For the request and response properties, see the reference documentation. Country code restrictions apply. Confirm that the customer's country is approved for resale.

POST https://www.googleapis.com/apps/reseller/v1/customers

The JSON request body has:

{
  "kind": "reseller#customer",
  "customerDomain": "example.com",
  "postalAddress": {
    "kind": "customers#address",
    "contactName": "John Doe",
    "organizationName": "Example Inc",
    "postalCode": "94043",
    "countryCode": "US",
  },
  "alternateEmail": "alternateEmail@google.com"
}

A successful response returns an HTTP 200 status code and the new customer's information:

{
  "kind": "reseller#customer",
  "customerId": "C0123456",
  "customerDomain": "example.com",
  "postalAddress": {
    "kind": "customers#address",
    "contactName": "John Doe",
    "organizationName": "Example Inc",
    "postalCode": "94043",
    "countryCode": "US",
  },
  "alternateEmail": "alternateEmail@google.com"
}

Once the customer is created, create a user within the new customer's account. You should immediately promote the first user to the super administrator role. When creating the administrator account, you can either generate a temporary random password or prompt the customer to provide a password. After creating the account, notify the customer that they must sign-in to the Admin console and sign the G Suite via Reseller agreement in order to activate their account.

Retrieve customer account information

To retrieve a customer's account information, use the following GET request including the authorization token described in Authorizing requests. The customerId property is either the customer's primary domain name or the customer's unique identifier returned when retrieving a user's settings:

GET https://www.googleapis.com/apps/reseller/v1/customers/customerId

This example retrieves the customer whose customerId is C0123456:

GET https://www.googleapis.com/apps/reseller/v1/customers/C0123456

You can also use the customer's primary domain name as the customerId:

GET https://www.googleapis.com/apps/reseller/v1/customers/example.com

The following sections describe possible responses to a customer account information GET request:

Response returns the full customer settings

The customer is one of your existing customers. Using the API, you can manage this customer's account and subscription settings.

Response returns the minimal customer account information

If the response only returns the customerId and customerDomain, either Google or another reseller manages the customer. To manage this customer, follow these steps:

  1. Retrieve all transferable subscriptions for the customer to understand whether the subscription can be transferred and the minimum number of user seats for the transfer.
  2. Transfer the subscription.

Response returns an HTTP 404 error

The customer is new to Google and does not have an account. To manage this customer, follow these steps:

  1. Confirm that your customer records do not hold old customer data with a potential mismatch of a customer's primary domain name and the unique Google customer identifier. When a previously deleted Google account is reinstated, it is treated as a new account and has a new customerId value even though the account may retain the same customerDomain value.
  2. Order a new customer account.
  3. Create a subscription for this new customer account.

Update a customer's settings

To update a customer's settings, use the following PUT request:

PUT https://www.googleapis.com/apps/reseller/v1/customers/customerId

This example updates the organizationName value for the customerId C0123456.

PUT https://www.googleapis.com/apps/reseller/v1/customers/C0123456

The JSON request body has:

{
  "kind": "reseller#customer",
  "customerId": "C0123456",
  "customerDomain": "example.com",
  "postalAddress": {
    "kind": "customers#address",
    "contactName": "John Doe",
    "organizationName": "Example Inc Sales Group",
    "postalCode": "94043",
    "countryCode": "US",
  },
  "alternateEmail": "alternateEmail@google.com"
}

A successful JSON response returns an HTTP 200 status code and the updated customer settings:

{
  "kind": "reseller#customer",
  "customerId": "C0123456",
  "customerDomain": "example.com",
  "postalAddress": {
    "kind": "customers#address",
    "contactName": "John Doe",
    "organizationName": "Example Inc Sales Group",
    "postalCode": "94043",
    "countryCode": "US",
  },
  "alternateEmail": "alternateEmail@google.com"
}

Change a customer's default language

A newly created customer has a default language of English. To change the default language, use the PATCH or UPDATE calls from the Directory API Customers endpoint.

This example updates the default language value for the customerId C0123456:

PATCH https://www.googleapis.com/admin/directory/v1/customers/C0123456

The JSON request body has:

{
  "language":"es"
}

A successful JSON response returns an HTTP 200 status code and the updated customer resource:

{
  "alternateEmail": "alternateEmail@google.com",
  "customerCreationTime": "2016-12-12T23:04:10.620Z",
  "customerDomain": "example.com",
  "id": "C0123456",
  "kind": "admin#directory#customer",
  "language": "es",
  "postalAddress": {
    "contactName": "John Doe",
    "countryCode": "US",
    "organizationName": "Example Inc Sales Group",
    "postalCode": "94043"
  }
}

Error syntax

If a request is unsuccessful, the API service's response includes an error. For a JSON response, the error syntax is:

{
  error: {
    errors: [
      {
        "domain": string,
        "reason": string,
        "message": string
      }
     ],
    "code": string,
    "message": string
 }
}

See also:

Invia feedback per...

G Suite Reseller API
G Suite Reseller API
Hai bisogno di assistenza? Visita la nostra pagina di assistenza.