Skip to content
Get started

List customers

client.customers.list(CustomerListParams { created_from, created_to, email, 12 more } params?, RequestOptionsoptions?): PageNumberSchema<Data { id, created_at, email, 6 more } >
GET/v1/customers

Lists or searches customers connected to your account. All supported query parameters are optional. If none are provided, the response will include all customers connected to your account. This endpoint supports advanced sorting and filtering options.

ParametersExpand Collapse
params: CustomerListParams { created_from, created_to, email, 12 more }
created_from?: string

Query param: Start date for filtering by created_at date.

formatdate-time
created_to?: string

Query param: End date for filtering by created_at date.

formatdate-time
email?: string

Query param: Filter customers by email address.

external_id?: string

Query param: Filter by your system's external_id.

name?: string

Query param: Filter customers by name (partial match).

page_number?: number

Query param: Page number for paginated results. Starts at 1.

formatint32
page_size?: number

Query param: Number of results per page. Maximum: 1000.

formatint32
search_text?: string

Query param: General search term to filter customers.

sort_by?: "name" | "created_at"

Query param

One of the following:
"name"
"created_at"
sort_order?: "asc" | "desc"

Query param

One of the following:
"asc"
"desc"
status?: Array<"pending" | "review" | "verified" | 2 more>

Query param: Filter customers by their current status.

One of the following:
"pending"
"review"
"verified"
"inactive"
"rejected"
types?: Array<"individual" | "business">

Query param: Filter by customer type individual or business.

One of the following:
"individual"
"business"
correlationID?: string

Header param: Optional client generated identifier to trace and debug a series of requests.

requestID?: string

Header param: Optional client generated identifier to trace and debug a request.

straddleAccountID?: string

Header param: For use by platforms to specify an account_id to set the scope of a request.

formatuuid
ReturnsExpand Collapse
Data { id, created_at, email, 6 more }
id: string

Unique identifier for the customer.

formatuuid
created_at: string

Timestamp of when the customer record was created.

formatdate-time
email: string

The customer's email address.

formatemail
name: string

Full name of the individual or business name.

phone: string

The customer's phone number in E.164 format.

status: "pending" | "review" | "verified" | 2 more
One of the following:
"pending"
"review"
"verified"
"inactive"
"rejected"
type: "individual" | "business"
One of the following:
"individual"
"business"
updated_at: string

Timestamp of the most recent update to the customer record.

formatdate-time
external_id?: string | null

Unique identifier for the customer in your database, used for cross-referencing between Straddle and your systems.

List customers

import Straddle from '@straddlecom/straddle';

const client = new Straddle({
  apiKey: process.env['STRADDLE_API_KEY'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const customer of client.customers.list()) {
  console.log(customer.id);
}
{
  "data": [
    {
      "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "created_at": "2019-12-27T18:11:19.117Z",
      "email": "dev@stainless.com",
      "name": "name",
      "phone": "+46991022",
      "status": "pending",
      "type": "individual",
      "updated_at": "2019-12-27T18:11:19.117Z",
      "external_id": "external_id"
    }
  ],
  "meta": {
    "api_request_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "api_request_timestamp": "2019-12-27T18:11:19.117Z",
    "max_page_size": 0,
    "page_number": 0,
    "page_size": 0,
    "sort_by": "sort_by",
    "sort_order": "asc",
    "total_items": 0,
    "total_pages": 0
  },
  "response_type": "object"
}
Returns Examples
{
  "data": [
    {
      "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "created_at": "2019-12-27T18:11:19.117Z",
      "email": "dev@stainless.com",
      "name": "name",
      "phone": "+46991022",
      "status": "pending",
      "type": "individual",
      "updated_at": "2019-12-27T18:11:19.117Z",
      "external_id": "external_id"
    }
  ],
  "meta": {
    "api_request_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "api_request_timestamp": "2019-12-27T18:11:19.117Z",
    "max_page_size": 0,
    "page_number": 0,
    "page_size": 0,
    "sort_by": "sort_by",
    "sort_order": "asc",
    "total_items": 0,
    "total_pages": 0
  },
  "response_type": "object"
}