API · Direct

Customers

A long-lived payer profile scoped to your merchant. Stripe-shaped — attach payment methods, retrieve charges, query default payment method, query lifetime value.

CRUDcus_

Endpoints

POST/v1/customers

Create a customer.

GET/v1/customers

List customers (filter by email/phone, paginate).

GET/v1/customers/{id}

Retrieve a specific customer.

PATCH/v1/customers/{id}

Update mutable fields (name, email, default_payment_method).

DELETE/v1/customers/{id}

Soft-delete. Charges remain; the link is removed.

Create

NameTypeDescription
emailstringCustomer email — used for receipts.
phoneE.164Customer phone, ideally the MSISDN they pay from.
full_namestringDisplay name.
localestring"en", "fr", "ar" — drives receipt language.
addressobjectBilling / shipping address (AVS / 3DS2).
metadatamapFree-form key/value.

Sample

bashbash
curl -X POST https://api.merashub.com/v1/customers \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
    "email": "alice@example.com",
    "phone": "+25377xxxxxxx",
    "full_name": "Alice Mohamed",
    "locale": "en"
  }'
201 Createdjson
{
  "id": "cus_01HZ...",
  "email": "alice@example.com",
  "phone": "+25377xxxxxxx",
  "full_name": "Alice Mohamed",
  "locale": "en",
  "default_payment_method_id": null,
  "created_at": "2026-05-25T10:15:30Z"
}

Attaching payment methods

A PaymentMethod is attached to a Customer by passing customer: "cus_…" on POST /v1/payment_methods. After that, you can create intents with payment_method: "pm_…" and we resolve everything else from the token.