Find all Customer

Retrieve a list of customers associated with a merchant's account.

The Find All Customers endpoint retrieves a list of customers associated with a merchant's account. This includes all stored customer records that can be filtered, sorted, and searched using flexible query parameters. If no matching customers are found, the data array in the response will be empty.


Key Features

  • Retrieve All Customers: Access a comprehensive list of customer records tied to the merchant account.
  • Search and Filter: Supports advanced filtering by fields such as name, email, company, and custom keywords.
  • Sorting Options: Allows sorting results by specific attributes like firstname or created_at in ascending or descending order.
  • Integration with Update Customer: Use the Update a Customer endpoint to modify customer details retrieved from this endpoint.

Usage Notes

Query Parameters

ParameterTypeDescriptionExample
firstnamestringFilter customers by first name./customer?firstname=James
lastnamestringFilter customers by last name./customer?lastname=Wilson
emailstringSearch customers by email./[email protected]
referencestringSearch by a custom reference field./customer?reference=order123
keywords[]arraySearch across multiple fields using keywords./customer?keywords[]=James&keywords[]=123

Sorting and Ordering Parameters

ParameterTypeDescriptionExample
sortstringAttribute to sort by (e.g., firstname, lastname)./customer?sort=firstname&order=ASC
orderstringSorting order, either ascending (ASC) or descending (DESC)./customer?sort=created_at&order=DESC

Response Structure

CodeResponseDescription
200SuccessReturns a list of matching customer records.
400Bad RequestInvalid query parameters or malformed request.
401UnauthorizedAPI key invalid or missing.
500Internal Server ErrorAn unexpected error occurred on the server.

Important Considerations

Keyword Searches: Using the keywords[] parameter performs a broad search across most customer fields but can be slower, especially with large datasets.

Empty Results: If no customers match the query, the data array in the response will be empty, and the total will be 0.

Sorting Defaults: If no sort parameter is provided, results are ordered by created_at in descending order (DESC) by default.

Pagination: For larger datasets, consider implementing pagination for better performance.


Best Practices

  • Use targeted filters (e.g., email or reference) to narrow down results for faster response times.
  • Combine multiple query parameters to refine searches, such as /customer?firstname=James&[email protected].
  • When using keywords[], limit the number of terms for optimal performance.
Query Params
string

Max: 255. Required if no lastname, email, company supplied

string

Max: 255. Required if no firstname, email, company supplied

string

Max: 255. Required if no firstname, lastname, company supplied

string

Max: 255. Required if no firstname, lastname, email supplied

string

Matching regex: /[0-9]{10,15}/

string

Max: 255

string

Max: 255

string

Max: 255

string

Max: 2

string

Max: 16

string

Max: 3

string

Max: 21844. For internal notes only; not visible to customers in invoices or communications.

string

Max: 255. This field is for the merchant's internal use.

files
array of strings

Array of strings(50) where each index is a valid file_id

files
cc_emails
array of strings

Array of strings(255) where each index is a valid email address

cc_emails
cc_sms
array of strings

Array of strings(255) where each index is a valid email address

cc_sms
boolean
keywords[]
array of strings
keywords[]
Response

Language
Credentials
Bearer
JWT
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json