Customers

A customer represents an end-user of your merchant. Customers are scoped per merchant and per environment. They are matched by email and/or phone.

Auto-creation

If you pass customerEmail and/or customerPhone when creating a session, minnha will auto-upsert a customer record. No need to call POST /customers explicitly unless you want to attach a name or external ID upfront.

Create / upsert

bash
POST /api/v1/customers
{
  "email": "customer@example.com",
  "phone": "+966512345678",
  "name": "Sara",
  "externalId": "your-crm-id-42"
}

List

bash
GET /api/v1/customers?page=0&size=20

Returns a paginated list with transactionsCount and totalSpent aggregated per customer.

Retrieve with history

bash
GET /api/v1/customers/{id}

Returns the customer plus their transactions and stored paymentMethods.

Export

bash
GET /api/v1/customers/export?from=2026-05-01&to=2026-05-31