Create or update customer
PUT/api/v1/stores/{store_id}/customers/{customer_id}
Creates the customer with the shop's ID, or updates it. Orders and carts do this themselves with their customer.
A customer never becomes a contact and never receives mailings because they have made a purchase. If the customer has consented to newsletters: sign them up to a list with POST /lists/{id}/members, with the proof of consent.
Fields you omit are kept; null clears them. Returns 201 when the customer was created and 200 when it was updated.
Scope
ecommerce:writeEdit e-commerce – the person behind the key must be editor or higher.
Path parameters
store_idstringrequired- The store's ID, which you choose.
customer_idstringrequired- The customer's ID in your shop.
Body
JSON, Content-Type: application/json. Unknown fields return 422.
emailstringrequired- The customer's email address.at most 254 characters
first_namestring | null- First name.at most 100 characters
last_namestring | null- Last name.at most 100 characters
companystring | null- Company.at most 200 characters
Retrying a request
PUT creates or updates using the shop's own ID: the same call twice gives the same result, so it can always be repeated. Batch and idempotency
Response
200 The customer (201 if it was created).
idstringrequiredemailstringrequiredfirst_namestring | nullrequiredlast_namestring | nullrequiredcompanystring | nullrequiredcontact_idstring | nullrequired- The workspace's contact with the same address, if there is one. A customer never becomes a contact on its own.
orders_countintegerrequired- Paid orders.
total_spentnumberrequired- The total of the paid orders.
last_order_atstring (time, ISO 8601) | nullrequired- The most recent paid order.
created_atstring (time, ISO 8601)required- When the customer was first sent in.
updated_atstring (time, ISO 8601)required- When the customer was last changed.
Errors
- 400
- bad_request
- 404
- not_found
- 429
- rate_limited