List Customers
Retrieve a list of all customers.
You can filter the list with query parameters.
Nota
A date range that exceeds 90 days, defined with both
starting_afterandending_before, returns ERROR_QUERY_DATE_RANGE_EXCEEDS_90_DAYS.The code samples include successful requests (200), bad requests (400), and an unauthorized request (401). For all error messages that appear due to bad requests, see Customer Errors and General Errors.
ending_before
The ID of the customer created after the last customer you want to retrieve. String starting with cus_.
Date range: 1-90 days. Default: 90 days.
limit
The maximum number of customers to return. Range: 1-100.
10
starting_after
The ID of the customer created before the first customer you want to retrieve. String starting with cus_.
Date range: 1-90 days. Default: 90 days.
Code Samples
.NET
using System; namespace RapydApiRequestSample { class Program { static void Main(string[] args) { try { string result = RapydApiRequestSample.Utilities.MakeRequest("GET", "/v1/customers?limit=2"); Console.WriteLine(result); } catch (Exception e) { Console.WriteLine("Error completing request: " + e.Message); } } } }
JavaScript
const makeRequest = require('<path-to-your-utility-file>/utilities').makeRequest; async function main() { try { const result = await makeRequest( 'GET', '/v1/customers?limit=2' ); console.log(result); } catch (error) { console.error('Error completing request', error); } }
PHP
<?php $path = $_SERVER['DOCUMENT_ROOT']; $path .= "/<path-to-your-utility-file>/utilities.php"; include($path); try { $object = make_request('get', "/v1/customers?limit=2"); var_dump($object); } catch (Exception $e) { echo "Error: $e"; } ?>
Python
from pprint import pprint from utilities import make_request result = make_request(method='get', path='/v1/customers?limit=2') pprint(result)
/v1/customers
List Customers
curl -X get 'https://sandboxapi.rapyd.net/v1/customers?limit=2' \ -H 'access_key: your-access-key-here' \ -H 'Content-Type: application/json' \ -H 'salt: your-random-string-here' \ -H 'signature: your-calculated-signature-here' \ -H 'timestamp: your-unix-timestamp-here'
{ "status": { "error_code": "", "status": "SUCCESS", "message": "", "response_code": "", "operation_id": "8875eb5d-d43b-461e-acba-b603e26ec134" }, "data": [ { "id": "cus_a97ac31867f1e2e9903fc2cb936241a7", "delinquent": false, "discount": null, "name": "Person Customer", "default_payment_method": "", "description": "", "email": "person.customer.162417@example.com", "phone_number": "+14155551237", "invoice_prefix": "", "addresses": [], "payment_methods": null, "subscriptions": null, "created_at": 1753881860, "metadata": { "merchant_defined": true }, "business_vat_id": "", "ewallet": "ewallet_31fb2dbbaf6519461ee4fbe1062220d3", "occupation": "", "birth_country": "", "date_of_birth": "", "nationality": "" }, { "id": "cus_f3d4d8575d30b27aa39230e76fb83a54", "delinquent": false, "discount": null, "name": "Company Customer", "default_payment_method": "", "description": "", "email": "company.customer.162417@example.com", "phone_number": "+14155551236", "invoice_prefix": "", "addresses": [], "payment_methods": { "data": [ { "id": "other_2d1a55ed70548f259f6a488fd81ed96a", "type": "pl_p24_bank", "category": "bank_redirect", "metadata": { "merchant_defined": true }, "image": "https://iconslib.rapyd.net/checkout/pl_p24_bank.png", "webhook_url": "", "supporting_documentation": "", "next_action": "not_applicable", "bic_swift": "", "account_last4": "" } ], "has_more": false, "total_count": 1, "url": "/v1/customers/cus_f3d4d8575d30b27aa39230e76fb83a54/payment_methods" }, "subscriptions": null, "created_at": 1753881859, "metadata": { "merchant_defined": true }, "business_vat_id": "", "ewallet": "ewallet_b5320c566cc4aa01fe77440ad08693f7", "occupation": "", "birth_country": "", "date_of_birth": "", "nationality": "" } ] }
Bad Request - Query Date Range Exceeds 90 Days
curl -X get 'https://sandboxapi.rapyd.net/v1/customers?ending_before=cus_550dbb2aef362826a333f0cf834c3b86&starting_after=cus_e942934d553ca9c1215f4f5201f1fddd' \ -H 'access_key: your-access-key-here' \ -H 'Content-Type: application/json' \ -H 'salt: your-random-string-here' \ -H 'signature: your-calculated-signature-here' \ -H 'timestamp: your-unix-timestamp-here'
{ "status": { "error_code": "ERROR_QUERY_DATE_RANGE_EXCEEDS_90_DAYS", "status": "ERROR", "message": "The request included temporal query parameters for defining a date range, but the date range defined via the IDs of the objects exceeds limit days. Corrective action: Create a query where the date range does not exceed limit days.", "response_code": "ERROR_QUERY_DATE_RANGE_EXCEEDS_90_DAYS", "operation_id": "8966aaef-ea90-4f92-b96c-a3df0a3e1aad" } }
Bad Request - Invalid Limit Query Parameter
curl -X get 'https://sandboxapi.rapyd.net/v1/customers?limit=500' \ -H 'access_key: your-access-key-here' \ -H 'Content-Type: application/json' \ -H 'salt: your-random-string-here' \ -H 'signature: your-calculated-signature-here' \ -H 'timestamp: your-unix-timestamp-here'
{ "status": { "error_code": "INVALID_LIMIT", "status": "ERROR", "message": "The request tried to retrieve a list of objects, but the 'limit' query parameter was not set to a valid value. The request was rejected. Corrective action: Set 'limit' to an integer between 1 and 100.", "response_code": "INVALID_LIMIT", "operation_id": "ada73d14-0ae5-43ba-9eb0-8373d6efc286" } }
Unauthorized
curl -X get 'https://sandboxapi.rapyd.net/v1/customers?limit=2' \ -H 'access_key: your-access-key-here' \ -H 'Content-Type: application/json' \ -H 'salt: your-random-string-here' \ -H 'signature: your-calculated-signature-here' \ -H 'timestamp: your-unix-timestamp-here'
{ "status": { "error_code": "UNAUTHENTICATED_API_CALL", "status": "ERROR", "message": "The request was rejected due to an authentication issue. Corrective action: Check the status of your account in the 'Account Details' page of the Client Portal.", "response_code": "UNAUTHENTICATED_API_CALL", "operation_id": "b3579678-374c-4d5c-8225-c36a1a5516bb" } }