createCustomer
Create a customer: the relationship with a specific buying entity, such as a retailer, a wholesale account or an individual. The name is the identity anchor, the optional handle is the unique key within the company and is useful as an upload upsert key, and the email is plain contact detail.
Business Rules
handle, when given, is unique within the company, archived customers included.emailis contact detail only; several customers may share one.parentIdlinks the customer into a single-level family for reporting rollup: the parent may not itself have a parent.salesChannelIdsets the customer's home sales channel, used for grouping and as the default channel on manual orders.- Every shipping account needs a carrier and an account number.
billingAddressmay be provided only whenbillToSameAsShipTois false.- Contact preference text is trimmed and limited to 100 characters.
Error Scenarios
- **
BAD_REQUEST**:nameis blank or longer than 255 characters;emailorwebsiteis malformed;customerTypeorfreightPayeris outside the accepted values; a contact preference is too long; a billing address is provided while bill-to mirrors ship-to; a shipping account is missing its carrier or account number; the customer is given itself as parent; or the family would end up more than one level deep. - **
NOT_FOUND**:salesChannelId,parentIdordefaultTemplateIddoes not belong to this company. - **
CONFLICT**: another customer in the company already uses thishandle.
Permissions Required
customers:create_customerpermission.
createCustomer(
input: CreateCustomerInput!
): CreateCustomerPayload
Arguments
createCustomer.input ● CreateCustomerInput! non-null input common
Parameters for CreateCustomer
Type
CreateCustomerPayload object common
Autogenerated return type of CreateCustomer.