logoAccess

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

Create 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

FieldTypeRequiredDescription
namestringYesFull name (min 1 character)
emailstringNoEmail address. Must be unique per merchant
phone_numberstringNoPhone 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

List customers
curl "https://api.tryaccess.xyz/api/v1/customers?limit=20" \
  -H "x-api-key: sk_..."
ParameterDescription
cursorPagination cursor from the previous response's next_cursor
limitResults per page (1–100, default 20)
emailFilter 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:

Update customer
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

Delete 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

ActionMethodEndpoint
CreatePOST/api/v1/customers
ListGET/api/v1/customers
GetGET/api/v1/customers/:id
UpdatePATCH/api/v1/customers/:id
DeleteDELETE/api/v1/customers/:id

How is this guide?