Skip to main content

createCustomer

Requires permission customers:customer:create.

Creates a customer in your organization, with its account, addresses and contacts. Needs the customers create permission.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

mutation CreateCustomer($createCustomerInput: CreateCustomerInput!) {
createCustomer(createCustomerInput: $createCustomerInput) {
id
code
registrationNumber
name
customerTierName
displayName
addresses {
id
postalCode
contactName
type
createdAt
addressLine1
}
}
}

Variables:

{
"createCustomerInput": {
"alsoCreateAsVendor": true,
"communicationPreference": "string",
"creditLimit": 0,
"loyaltyPoints": 0,
"marketingOptIn": true,
"name": "string",
"tags": [
"string"
]
}
}

Response:

{
"data": {
"createCustomer": {
"id": "id",
"code": "string",
"registrationNumber": "string",
"name": "string",
"customerTierName": "string",
"displayName": "string",
"addresses": [
{
"id": "id",
"postalCode": "string",
"contactName": "string",
"type": "string",
"createdAt": "2025-01-15T00:00:00Z",
"addressLine1": "string"
}
]
}
}
}
createCustomer(
createCustomerInput: CreateCustomerInput!
): Customer!

Arguments​

createCustomer.createCustomerInput ● CreateCustomerInput! non-null input​

The customer to create: its name, account settings, addresses and contacts.

Type​

Customer object​

A customer: a partner with the customer role.