Skip to main content

Get All Customers

Retrieves a list of customers with pagination. You can filter the list by name, email, company, status, dates and metafield values.

HTTP Request​

  • URL: /customers
  • Method: GET
  • Headers:
    • accessToken: Required. Your API access token.
  • Required scope: READ_CUSTOMER or READ_WRITE_CUSTOMER

Query Parameters​

ParameterTypeDescription
pageIntegerPage number to retrieve. Default is 1.
limitIntegerNumber of customers per page. Default is 10.
nameStringFilter by first name (partial, case-insensitive match).
emailStringFilter by exact email address.
email:inStringFilter by a comma-separated list of email addresses.
idStringFilter by a single customer ID.
id:inStringFilter by a comma-separated list of customer IDs.
companyStringFilter by company ID.
company:inStringFilter by a comma-separated list of company IDs.
isB2BBooleantrue for business (B2B) customers, false for B2C customers.
statusStringFilter by status: active, pending, invited or inactive.
date_created:minStringCustomers created on or after this date (YYYY-MM-DD).
date_created:maxStringCustomers created on or before this date (YYYY-MM-DD).
date_modified:minStringCustomers updated on or after this date (YYYY-MM-DD).
date_modified:maxStringCustomers updated on or before this date (YYYY-MM-DD).
metafields:<code>StringCustomers whose metafield <code> equals this value, for example metafields:erp_contact_id=1254.
metafields-in:<code>StringCustomers whose metafield <code> matches any of these comma-separated values.

cURL Example​

curl --location '<BASE_URL>/customers?page=1&limit=10&status=active&company=665434c100e82884676936b9' \
--header 'accessToken: <ACCESS_TOKEN>'

Response​

  • 200 OK: The list of customers was returned successfully.
  • 400 Bad Request: The access token is missing or invalid, the token does not have the required scope, or a filter value is not valid.

Sample JSON Response​

{
"success": true,
"data": [
{
"id": "66a5023524b16685e42a1eda",
"firstName": "Maria",
"lastName": "Lopez",
"email": "maria.lopez@northwindsupply.com",
"phoneNumber": "9735550142",
"notes": "Primary purchasing contact",
"isB2B": true,
"status": "active",
"role": "663a0aff4587085935a4fb94",
"company": "665434c100e82884676936b9",
"verifiedEmail": false,
"newsletter": false,
"productGroups": {
"groups": [],
"restrictStoreProductVisibility": false
},
"address": [
{
"id": "66a5023524b16685e42a1edb",
"firstName": "Maria",
"lastName": "Lopez",
"address1": "1200 Industrial Ave",
"address2": "Suite 4",
"city": "Elizabeth",
"state": { "code": "NJ", "name": "New Jersey" },
"country": { "code": "US", "name": "United States" },
"zipcode": "07202",
"phoneNumber": "9735550142",
"isDefaultAddress": true,
"status": true
}
],
"metaFields": [],
"salesReps": [],
"createdBy": {
"id": "66a0f138a8323b0b86b0f1dc",
"name": "ERP Connector",
"type": "api"
},
"createdAt": "2024-07-27T14:20:37.573Z",
"updatedAt": "2024-08-03T10:29:32.489Z"
}
],
"pagination": {
"page": 1,
"total": 42,
"count": 10
}
}

Response Details​

Customer Data​

FieldTypeDescription
idStringUnique identifier of the customer.
firstNameStringFirst name of the customer.
lastNameStringLast name of the customer.
emailStringEmail address of the customer (stored in lowercase).
phoneNumberStringPhone number of the customer.
imageStringURL of the customer's profile image.
notesStringInternal notes about the customer.
isB2BBooleanWhether the customer is a business (B2B) customer.
statusStringCustomer status: active, pending, invited or inactive. Default is pending.
roleStringID of the customer's role. See Get All Customer Roles.
companyStringID of the company the customer belongs to.
verifiedEmailBooleanWhether the customer has verified their email address.
newsletterBooleanWhether the customer is subscribed to the newsletter.
storeCreditBalanceNumberStore credit balance of the customer, if any.
paymentAccessObjectPayment methods the customer can use. See Create Customer.
productGroupsObjectProduct groups the customer can or cannot see. See Create Customer.
addressArraySaved addresses of the customer. See Get Customer.
metaFieldsArrayCustom field values. See Metafields.
salesRepsArraySales reps assigned to the customer (id, name, email).
createdByObjectWho created the customer: id, name and type (for example api, admin or store).
createdAtStringDate and time the customer was created (ISO 8601).
updatedAtStringDate and time the customer was last updated (ISO 8601).

Pagination Details​

FieldTypeDescription
pageIntegerCurrent page number.
totalIntegerTotal number of customers that match the filters.
countIntegerNumber of customers returned on this page.

Notes​

  • Use page and limit to move through large customer lists.
  • Dates can be sent as YYYY-MM-DD or as a full ISO 8601 date and time.