List customers
Lists customers with search and pagination. Returns only essential fields: id, createdAt, name, phone, email, and latestPaymentMethod. Search supports customer ID, name, email, or phone (supports comma-separated terms).
Lists customers with search and pagination. Returns only essential fields: id, createdAt, name, phone, email, and latestPaymentMethod. Search supports customer ID, name, email, or phone (supports comma-separated terms).
Authorization
api-key API key for merchant integrations. Send as Authorization: Bearer <your key>.
In: header
Query Parameters
Filter by customer type: registered (merchant-created) or guest (auto-created during checkout)
Search by customer ID, name, email, or phone (supports comma-separated terms)
Number of items per page
Page number (1-based)
Response Body
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/customers"{
"data": [
{
"id": "cus_abc123",
"type": "registered",
"createdAt": "2024-01-01T00:00:00.000Z",
"name": "John Doe",
"email": "john@example.com",
"phone": "+201234567890",
"country": "EG",
"latestPaymentMethod": {
"card": {},
"valu": {}
},
"spendData": {}
}
],
"totalCount": 42
}{
"error": {
"type": "authentication_error",
"code": "authentication_required",
"message": "No valid API key provided.",
"doc_url": "https://docs.xpay.app/integrate/errors/api-error-codes#authentication_required"
},
"request_id": "req_abc123def456"
}{
"error": {
"type": "invalid_request_error",
"code": "permission_denied",
"message": "The API key does not have permission to perform this action.",
"doc_url": "https://docs.xpay.app/integrate/errors/api-error-codes#permission_denied"
},
"request_id": "req_abc123def456"
}{
"error": {
"type": "api_error",
"code": "internal_error",
"message": "An unexpected error occurred. Please try again or contact support.",
"doc_url": "https://docs.xpay.app/integrate/errors/api-error-codes#internal_error"
},
"request_id": "req_abc123def456"
}