Skip to main content

The customer object

A customer represents a buyer who has interacted with your business through Orafi. Customers are typically created automatically during payment flows.
id
string
Unique identifier for the customer.
firstname
string
Customer’s first name.
lastname
string
Customer’s last name.
email
string
Customer’s email address.
mode
string[]
Environments the customer has interacted in. Contains test, live, or both.
totalSpent
number
default:"0"
Aggregate amount the customer has spent across all completed transactions.
createdAt
datetime
When the customer record was created.
updatedAt
datetime
When the customer record was last updated.
{
  "id": "cmjr4c7qq0000v8hozkzz4em5",
  "firstname": "Melvin",
  "lastname": "Charles",
  "email": "mekus@orafi.app",
  "mode": ["test"],
  "totalSpent": 0,
  "createdAt": "2025-12-29T12:12:29.615Z",
  "updatedAt": "2025-12-29T12:12:29.615Z"
}

Create a customer

POST /customers/create
Manually creates a customer record.
In most flows, customers are created automatically when a payment is completed. Manual creation is intended for pre-registration, data migrations, or account-based billing.

Request body

firstname
string
required
Customer’s first name.
lastname
string
required
Customer’s last name.
email
string
required
Customer’s email address.
curl -X POST https://api.orafi.app/customers/create \
  -H "Content-Type: application/json" \
  -H "x-api-key: ora_test_your_api_key" \
  -d '{
    "firstname": "John",
    "lastname": "Doe",
    "email": "john@example.com"
  }'

List customers

GET /customers
Returns a paginated list of customers. All query parameters are optional.

Query parameters

amountSpent
string
Filter by spending range. One of BELOW10USDT, FROM10TO30USDT, FROM30TO100USDT, FROM100TO200USDT, FROM200TO500USDT, ABOVE500USDT.
mode
string
Filter by environment. test or live.
limit
number
default:"20"
Maximum number of results per page.
cursor
string
Pagination cursor. Results start after the referenced customer.
curl -X GET "https://api.orafi.app/customers?mode=test&limit=10" \
  -H "x-api-key: ora_test_your_api_key"

Retrieve a customer

GET /customers/{customerId}
Returns the details of a specific customer.

Path parameters

customerId
string
required
The customer ID to retrieve.
curl -X GET https://api.orafi.app/customers/cmjr4c7qq0000v8hozkzz4em5 \
  -H "x-api-key: ora_test_your_api_key"

Delete a customer

DELETE /customers/{customerId}
Permanently deletes a customer record. This action cannot be undone.
Deleting a customer is irreversible. Only use this for duplicate records, accidental creation, or compliance-related data removal requests. We recommend keeping records for transaction history and reconciliation.

Path parameters

customerId
string
required
The customer ID to delete.
curl -X DELETE https://api.orafi.app/customers/cmjr4c7qq0000v8hozkzz4em5 \
  -H "x-api-key: ora_test_your_api_key"