Skip to main content

Get All Customers

This GET endpoint retrieves a list of customers with pagination support. You can specify the page number and the number of items per page using query parameters.

Endpoint

  • URL: /customers?page={page}&limit={limit}
  • Method: GET

Query Parameters

ParameterTypeDescription
pageintThe page number to retrieve. Default is 1.
limitintThe number of items per page. Default and max is 10.
namestringFilter customers by first name using a case-insensitive regex match.
emailstringFilter customers by email address using a case-insensitive regex match.
isB2BbooleanFilter customers by business type (e.g., true or false).
statusstringFilter customers by status (e.g., "active", "pending").
idstringFilter customers by a specific ID.
companystringFilter customers by company ID.
id:instringFilter customers by a list of IDs (comma-separated).
email:instringFilter customers by a list of email addresses (comma-separated).
company:instringFilter customers by a list of company IDs (comma-separated).
date_created:minstringFilter customers created on or after this date (format: YYYY-MM-DD).
date_created:maxstringFilter customers created on or before this date (format: YYYY-MM-DD).
date_modified:minstringFilter customers modified on or after this date (format: YYYY-MM-DD).
date_modified:maxstringFilter customers modified on or before this date (format: YYYY-MM-DD).
metafieldsobjectFilter customers by specific metafield criteria. Example sub-key: metafields:<key>
metafields-inobjectFilter customers by a list of values for a specific metafield. Example sub-key: metafields-in:<key>

Note: For metafields and metafields-in, replace <key> with the specific metafield you want to filter by. The queries allow filtering customers based on associated metafield values.

Authentication

  • Header: accessToken
  • Type: Bearer Token
  • Value: <ACCESS-TOKEN>

Request Headers

HeaderTypeDescription
accessTokenstringAccess token for authentication. (required)

Request Body

No request body is needed for this GET operation.

Response

  • Status Code: 200 OK

Sample Response Body

A successful response will return a list of customers with pagination details:

{
"success": true,
"data": [
{
"email": "Testsample@email.com",
"firstName": "FN",
"lastName": "two",
"phoneNumber": "123456",
"role": "663a0aff4587085935a4fb94",
"company": "665434c100e82884676936b9",
"status": "pending",
"verifiedEmail": false,
"newsletter": false,
"isB2B": true,
"metaFields": [],
"createdBy": {
"id": "66a0f138a8323b0b86b0f1dc",
"name": "Tester Account",
"type": "import"
},
"createdAt": "2024-07-27T14:20:37.573Z",
"updatedAt": "2024-08-03T10:29:32.489Z",
"id": "66a5023524b16685e42a1eda",
"address": {}
}
],
"pagination": {
"page": 1,
"total": 8,
"count": 8
}
}

Success Response

FieldTypeDescription
successbooleanIndicates if the request was successful.
dataarrayList of customer objects.
paginationobjectPagination details for the response data.

Customer Object (data[])

FieldTypeDescription
emailstringEmail address of the customer.
firstNamestringFirst name of the customer.
lastNamestringLast name of the customer.
phoneNumberstringContact number of the customer.
rolestringRole ID associated with the customer.
companystringCompany ID related to the customer.
statusstringCurrent status of the customer (e.g., "pending").
verifiedEmailbooleanIndicates if the customer's email is verified.
newsletterbooleanIndicates subscription to the newsletter.
isB2BbooleanIndicates if the customer is a business customer.
metaFieldsarrayAdditional metadata related to the customer.
createdByobjectInformation about who created the customer entry.
createdAtstring (ISO 8601)Timestamp of when the customer was created.
updatedAtstring (ISO 8601)Timestamp of the last update to the customer data.
idstringUnique identifier for the customer.
addressobjectAddress information of the customer.

Pagination Object (pagination)

FieldTypeDescription
pageintCurrent page number of the response data.
totalintTotal number of available pages.
countintTotal number of records returned.

Error Responses

Status CodeDescription
401 UnauthorizedThe access token is invalid or missing.
403 ForbiddenYou do not have permission to access this resource.
500 Internal Server ErrorAn error occurred on the server.

Notes

  • Make sure the accessToken is valid and that the token has permission to access customer data.
  • Adjust the page and limit query parameters to control pagination according to your needs.
  • Only accessible to authorized users with sufficient access rights.