The new account has no password and is not active. It becomes a real account when the owner of the email registers on the store and proves the email with a code, so an app can never open another person's orders or points. If the email or phone already belongs to a customer you receive CUSTOMER_EXISTS: find them with List customers. When no name is sent, the part of the email before @ becomes the name.
Headers
Idempotency-Keystringrequired
Request body
emailstring (email)required
Saved in lowercase.
phonestring
A valid phone in any form. It comes back in E.164 format.
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
HTTP
Code
Meaning
400
IDEMPOTENCY_KEY_REQUIRED
No Idempotency-Key header.
409
CUSTOMER_EXISTS
A customer already has this email or phone.
422
INVALID_EMAIL
The email is missing or not valid.
422
INVALID_PHONE
The phone is not valid.
422
INVALID_TEXT
A name is empty or too long.
422
UNKNOWN_FIELD
Unknown field.
403
SCOPE_REQUIRED
The token does not carry the required scope.
503
APPS_SCOPE_RUNTIME_NOT_READY
The resource is not enabled on this merchant's store yet.