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/customersCreate a customer.
GET
/v1/customersList 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
| Name | Type | Description |
|---|---|---|
email | string | Customer email — used for receipts. |
phone | E.164 | Customer phone, ideally the MSISDN they pay from. |
full_name | string | Display name. |
locale | string | "en", "fr", "ar" — drives receipt language. |
address | object | Billing / shipping address (AVS / 3DS2). |
metadata | map | Free-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.