# Method: accounts.customers.import

- [HTTP request](https://docs.cloud.google.com/channel/docs/reference/rest/v1alpha1/accounts.customers/import#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/channel/docs/reference/rest/v1alpha1/accounts.customers/import#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/channel/docs/reference/rest/v1alpha1/accounts.customers/import#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/channel/docs/reference/rest/v1alpha1/accounts.customers/import#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/channel/docs/reference/rest/v1alpha1/accounts.customers/import#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/channel/docs/reference/rest/v1alpha1/accounts.customers/import#body.aspect)
- [Try it!](https://docs.cloud.google.com/channel/docs/reference/rest/v1alpha1/accounts.customers/import#try-it)

Imports a `https://docs.cloud.google.com/channel/docs/reference/rest/v1alpha1/accounts.customers#Customer` from the Cloud Identity associated with the provided Cloud Identity ID or domain before a customers.transferEntitlements call. If a linked Customer already exists and overwriteIfExists is true, it will update that Customer's data.

Possible error codes:

- PERMISSION_DENIED:
  - The reseller account making the request is different from the reseller account in the API request.
  - You are not authorized to import the customer. See <https://support.google.com/channelservices/answer/9759265>
- NOT_FOUND: Cloud Identity doesn't exist or was deleted.
- INVALID_ARGUMENT: Required parameters are missing, or the authToken is expired or invalid.
- ALREADY_EXISTS: A customer already exists and has conflicting critical fields. Requires an overwrite.

Return value: The `https://docs.cloud.google.com/channel/docs/reference/rest/v1alpha1/accounts.customers#Customer`.

### HTTP request

`POST https://cloudchannel.googleapis.com/v1alpha1/{parent=accounts/*}/customers:import`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` Required. The resource name of the reseller's account. Parent takes the format: accounts/{account_id} or accounts/{account_id}/channelPartnerLinks/{channelPartnerId} |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "authToken": string, "overwriteIfExists": boolean, "channelPartnerId": string, "customer": string, // Union field `customer_identity` can be only one of the following: "domain": string, "cloudIdentityId": string, "primaryAdminEmail": string // End of list of possible types for union field `customer_identity`. } ``` |

| Fields ||
|---|---|
| `authToken` | `string` Optional. The super admin of the resold customer generates this token to authorize a reseller to access their Cloud Identity and purchase entitlements on their behalf. You can omit this token after authorization. See <https://support.google.com/a/answer/7643790> for more details. |
| `overwriteIfExists` | `boolean` Required. Choose to overwrite an existing customer if found. This must be set to true if there is an existing customer with a conflicting region code or domain. |
| `channelPartnerId` | `string` Optional. Cloud Identity ID of a channel partner who will be the direct reseller for the customer's order. This field is required for 2-tier transfer scenarios and can be provided via the request Parent binding as well. |
| `customer` | `string` Optional. Specifies the customer that will receive imported Cloud Identity information. Format: accounts/{account_id}/customers/{customer_id} |
| Union field `customer_identity`. Specifies the identity of the transfer customer. A customer's cloud_identity_id or domain is required to look up the customer's Cloud Identity. For Team customers, only the cloud_identity_id option is valid. `customer_identity` can be only one of the following: ||
| `domain` | `string` Required. Customer domain. |
| `cloudIdentityId` | `string` Required. Customer's Cloud Identity ID |
| `primaryAdminEmail` | `string` Required. Customer's primary admin email. |

### Response body

If successful, the response body contains an instance of `https://docs.cloud.google.com/channel/docs/reference/rest/v1alpha1/accounts.customers#Customer`.

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/apps.order`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).