Developers

Customers

Markdown

Update a customer name

Changes `name`, `first_name` or `last_name`. The phone and email of a customer cannot be changed by an app.

PATCH/stores/{storeId}/v1/customers/{id}

A phone or email decides who can sign in to the account, so only the customer changes them. When you send first_name or last_name without name, the full name is rebuilt from them.

Path parameters

idstringrequired

Request body

namestring
first_namestring
last_namestring

Response

dataobjectrequired
idstringrequired
namestringrequired
first_namestring
last_namestring
phonestring | nullrequired
Phone number in E.164 format, such as +966512345678, or null if it is not a valid number.
emailstring | null (email)required
orders_countintegerrequired
Delivered orders that were not refunded.
total_spentstringrequired
The total of those orders in SAR.
last_order_atstring | null (date-time)
created_atstring (date-time)required
executionobject
Who executed the request: the app, version, installation and store. Field names here are camelCase.
appIdstring (uuid)
versionIdstring (uuid)
installationIdstring (uuid)
storeIdstring (uuid)
requestIdstring (uuid)
generationinteger
routeEpochinteger
appAuthEpochinteger
grantRevisioninteger
metaobjectrequired
request_idstring (uuid)
The request ID; include it in any support request.

Errors

HTTPCodeMeaning
404RESOURCE_NOT_FOUNDThe ID does not exist in this store.
422EMPTY_MUTATIONNo name was sent.
422INVALID_TEXTA name is empty or too long.
422UNKNOWN_FIELDAny field other than a name.
403SCOPE_REQUIREDThe token does not carry the required scope.
503APPS_SCOPE_RUNTIME_NOT_READYThe resource is not enabled on this merchant's store yet.

Shared codes are listed in Errors.

    ↑↓ moveEnter openEsc close