List customers
const url = 'https://apibase.ecomweb.app/api/v1/stores/example/customers?limit=20&offset=0&status=active&sort_by=name&sort_order=asc&sort=name&order=asc&filters=%5B%7B%22field%22%3A%22status%22%2C%22operator%22%3A%22is%22%2C%22values%22%3A%5B%22active%22%5D%7D%5D';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?limit=20&offset=0&status=active&sort_by=name&sort_order=asc&sort=name&order=asc&filters=%5B%7B%22field%22%3A%22status%22%2C%22operator%22%3A%22is%22%2C%22values%22%3A%5B%22active%22%5D%7D%5D' \ --header 'x-api-key: <x-api-key>'Returns a page of the store’s customers that are not deleted, newest first by default. Use limit and offset to page, search for free text over name, email and phone, and status to narrow the list. Each customer carries order figures such as total_orders and total_spent. sort_by accepts total_orders, total_spent and last_order_date, but those three order only the rows of the current page. filters takes a JSON array of {field, operator, values} clauses (at most 10 clauses and 50 values each).
Required scopes: read:customers
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The store’s ref, as returned by GET /stores.
Query Parameters
Section titled “Query Parameters”Example
20Number of items per page
Example
0Number of items to skip
Search by name/email/phone
Filter by status
Sort field
Example
descSort order
Deprecated. Use sort_by.
Deprecated. Use sort_order.
Example
[{"field":"status","operator":"is","values":["active"]}]Admin list-view filters, a JSON array of {field, operator, values}. At most 10 clauses, at most 50 values each.
Responses
Section titled “Responses”object
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.
object
Total number of items matching the request.
Maximum number of items in this page.
Number of items skipped before this page.
Current page number, starting at 1.
Total number of pages.
Whether a next page exists.
Whether a previous page exists.
Example
{ "data": [ { "status": "active", "activity_state": "active" } ]}The request is malformed or failed validation.
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 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"}