Skip to main content

List customers

List customer resources.


Endpoint

GET /customers

Sample code

const client = require('payrex-node')('insert your PayRex Secret API key.');

// Return 10 records and search for customers with email juan@gmail.com
const customers = await client.customers.list({
limit: 10,
email: 'juan@gmail.com'
});

Parameters

limit optional

Limits the number of resources returned by the endpoint. Minimum amount is 1 and maximum is 100.


before optional

A cursor used in pagination. before is a resource ID that defines your place in the list. For example, if you call a list request and receive 10 resources, starting with cus_1234, your subsequent calls can include before=cus_1234 in order to fetch the previous page of the list.


after optional

A cursor used in pagination. after is a resource ID that defines your place in the list. For example, if you call a list request and receive 10 resources, ending with cus_1234, your subsequent calls can include after=cus_1234 in order to fetch the next page of the list.


email optional

Search customers via customer e-mail address.


name optional

Search customers via customer name.


metadata optional

Search customers via stored metadata. e.g. metadata[internal_id]=12345

Returns

Returns a paginated list of Customer resources.