Create customer
Create customer
Creates a new customer record scoped to the authenticated merchant’s store. The storeId is derived from the API key context (not supplied in the body), and a UUID id is generated server-side.
Authentication
- Send the merchant API key in the
x-api-keyheader (aliasx-account-api-key). - Requires the scope:
Merchant.customer.create. - Optionally scope the key to a specific store/account with the
x-application-account-idheader (aliasx-account-id) or theapplication_account_id/account_idquery param.
Body
JSON body (application/json). Only name and email are required. The optional fields accepted by CreateCustomerDto are mobile, addressLine1, addressLine2, city, state, postalCode and country. Unknown properties are stripped by the validation pipe.
Side-effects / validation
- Email must be unique per store (case-insensitive). If a customer with the same email already exists for the store, the request fails with 400 Bad Request (
"A customer with this email already exists for your store."). - Returns the full persisted customer record on success.
Notas: storeId and id are set server-side and cannot be supplied by the client. Email uniqueness is enforced per store (case-insensitive) and returns 400 on conflict. Related endpoints: GET /v1/customers, PATCH /v1/customers/:id.
Authentication
Headers
Scope the request to a specific store / account instead of the one resolved from the API key. Aliases: the x-account-id header, or the application_account_id / account_id query parameter.
