Customers
Create and manage customer records for your business.
Customers represent the people or entities that interact with your business. Each customer can have transactions, invoices, and checkout sessions.
Create a Customer
curl -X POST https://api.tryaccess.xyz/api/v1/customers \
-H "Content-Type: application/json" \
-H "x-api-key: sk_..." \
-d '{
"name": "Abebe Kebede",
"email": "abebe@example.com",
"phone_number": "+251911234567"
}'Response:
{
"id": "cus_01HXYZ...",
"name": "Abebe Kebede",
"email": "abebe@example.com",
"phone_number": "+251911234567",
"created_at": "2025-01-15T10:00:00.000Z",
"updated_at": "2025-01-15T10:00:00.000Z"
}Parameters
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Full name (min 1 character) |
email | string | No | Email address. Must be unique per merchant |
phone_number | string | No | Phone number in E.164 format (e.g. +251911234567) |
Customer IDs are prefixed with cus_. Duplicate emails within the same merchant are rejected with a duplicate error.
List Customers
curl "https://api.tryaccess.xyz/api/v1/customers?limit=20" \
-H "x-api-key: sk_..."| Parameter | Description |
|---|---|
cursor | Pagination cursor from the previous response's next_cursor |
limit | Results per page (1–100, default 20) |
email | Filter by email (partial match, case-insensitive) |
Response:
{
"data": [
{
"id": "cus_01HXYZ...",
"name": "Abebe Kebede",
"email": "abebe@example.com",
"phone_number": "+251911234567",
"created_at": "2025-01-15T10:00:00.000Z",
"updated_at": "2025-01-15T10:00:00.000Z"
}
],
"has_more": false,
"next_cursor": null
}Get a Customer
curl https://api.tryaccess.xyz/api/v1/customers/cus_01HXYZ... \
-H "x-api-key: sk_..."Update a Customer
Only provided fields are changed:
curl -X PATCH https://api.tryaccess.xyz/api/v1/customers/cus_01HXYZ... \
-H "Content-Type: application/json" \
-H "x-api-key: sk_..." \
-d '{ "phone_number": "+251922345678" }'Updatable fields: name, email, phone_number.
Delete a Customer
curl -X DELETE https://api.tryaccess.xyz/api/v1/customers/cus_01HXYZ... \
-H "x-api-key: sk_..."Response:
{ "id": "cus_01HXYZ...", "deleted": true }Deleting a customer cascades to their checkout sessions.
Endpoint Summary
| Action | Method | Endpoint |
|---|---|---|
| Create | POST | /api/v1/customers |
| List | GET | /api/v1/customers |
| Get | GET | /api/v1/customers/:id |
| Update | PATCH | /api/v1/customers/:id |
| Delete | DELETE | /api/v1/customers/:id |
How is this guide?