List all customers
list_customersRetrieve a paginated list of customers for your authenticated workspace, filtering by email, country, program, partner, or search query, using cursor-based pagination.
Instructions
Retrieve a paginated list of customers for the authenticated workspace.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | DEPRECATED. Use `startingAfter` instead. | |
| No | A case-sensitive filter on the list based on the customer's `email` field. The value must be a string. Takes precedence over `externalId`. | ||
| search | No | A search query to filter customers by email, name, or customer ID (`cus_...`). If `email` or `externalId` is provided, this will be ignored. | |
| account | No | Exact configured private workspace profile label; not a tenant or provider account ID. | |
| country | No | A filter on the list based on the customer's `country` field. | |
| link_id | No | A filter on the list based on the customer's `linkId` field (the referral link ID). | |
| sort_by | No | The field to sort the customers by. The default is `createdAt`. | createdAt |
| page_size | No | The number of items per page. | |
| partner_id | No | Partner ID to filter by. | |
| program_id | No | Program ID to filter by. | |
| sort_order | No | The sort order. The default is `desc`. | desc |
| external_id | No | A case-sensitive filter on the list based on the customer's `externalId` field. The value must be a string. Takes precedence over `search`. | |
| ending_before | No | If specified, the query only searches for results before this cursor. Mutually exclusive with `startingAfter`. | |
| starting_after | No | If specified, the query only searches for results after this cursor. Mutually exclusive with `endingBefore`. | |
| include_expanded_fields | No | Whether to include expanded fields on the customer (`link`, `partner`, `discount`). |