Get a customer by email
const url = 'https://apibase.ecomweb.app/api/v1/stores/example/customers/example';const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://apibase.ecomweb.app/api/v1/stores/example/customers/example \ --header 'x-api-key: <x-api-key>'Deprecated: use GET /customers/{customerId}. Returns the customer with this email, with their order figures. When no customer has the email the response is 200 with an empty body, not 404.
Required scopes: read:customers
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The customer’s email address.
The store’s ref, as returned by GET /stores.
Responses
Section titled “Responses”object
Account status set by the store. An inactive customer cannot sign in.
Ordering activity: active for a recent order, inactive for an old one, never_ordered for none. Separate from status.
Customer ID.
Email address. Empty for a customer created with a phone number only.
Full name.
Phone number, or null.
Avatar image URL, or null.
ID of the sign-in identity linked to the customer, or null for a customer who never signed in.
Internal notes about the customer, or null.
When the customer was created, as an ISO 8601 timestamp.
When the customer was last updated, as an ISO 8601 timestamp.
When the customer was deleted, or null while the customer is live.
Date of the first order, as an ISO 8601 timestamp. Absent when the customer has no orders.
Date of the latest order, as an ISO 8601 timestamp. Absent when the customer has no orders.
Days since the latest order. Absent when the customer has no orders.
Orders placed by the customer.
Cancelled orders.
Refunded orders.
Orders that count towards revenue: those neither cancelled nor refunded.
Total spent across revenue orders, in the store currency.
Average value of a revenue order, in the store currency.
Orders placed as a guest with the customer’s email and linked to them by it.
Example
{ "status": "active", "activity_state": "active"}The key is missing, invalid, revoked or expired.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}The key may not do this: a missing scope, a readonly key, a publishable key on a Store API route, or a disallowed origin.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}