API Reference · Payments

Customers

Customer profiles linked to charges, subscriptions, wallets, and mandates.

The customer object

Represents a customer entity in the rafiqPay system.

FieldType & FlagsDescription
id
string
Unique customer ID (cus_...).
email
string
Customer email address.
name
stringNullable
Full name or business name.
phone
stringNullable
E.164 phone number (+234...).
bankAccounts
array
The customer’s permanent bank accounts: id, mode, accountNumber, accountName, bankName. Returned by Retrieve a customer.
savedPaymentMethods
array
Active saved cards: id (pm_...), type, label (for example "Visa ending 4081 (expires 09/28)") and mode.
mandates
array
Direct-debit mandates: id, maxAmount, frequency, status and mode.
hasMandate
boolean
True when the customer has an active mandate.
Example customer JSON
customer example payload
{
  "id": "cus_amina_01",
  "object": "customer",
  "email": "amina@kanzu.ng",
  "name": "Amina Bello",
  "phone": "+2348034567890",
  "bankAccounts": [
    {
      "id": "cba_01J9KANZU5",
      "mode": "live",
      "accountNumber": "0123456781",
      "accountName": "Kanzu Learning - Amina Bello",
      "bankName": "GTBank"
    }
  ],
  "savedPaymentMethods": [
    {
      "id": "pm_01J9KANZU3",
      "type": "card",
      "label": "Visa ending 4081 (expires 09/28)",
      "mode": "live"
    }
  ],
  "mandates": [],
  "hasMandate": false
}

Endpoints & Operations

POST/v1/customersProposed

Create a customer

Creates a customer record.

Request Example
POST /v1/customers
cURL · v1
curl -X POST "https://api.rafiqpay.net/v1/customers" \
  -H "Authorization: Bearer rp_test_sk_kanzu_9f8a7b6c5d4e3f2a" \
  -H "Idempotency-Key: idem_create-customer_01" \
  -H "Content-Type: application/json" \
  -d '{
  "email": "amina@kanzu.ng",
  "name": "Amina Bello"
}'
Response (200 OK)
Response payload
{
  "id": "cus_amina_01",
  "email": "amina@kanzu.ng"
}
GET/v1/customers/:idProposed

Retrieve a customer

Retrieves a customer, with their bank accounts, saved cards and mandates.

Request Example
GET /v1/customers/:id
cURL · v1
curl -X GET "https://api.rafiqpay.net/v1/customers/:id" \
  -H "Authorization: Bearer rp_test_sk_kanzu_9f8a7b6c5d4e3f2a"
Response (200 OK)
Response payload
{
  "id": "cus_amina_01",
  "email": "amina@kanzu.ng",
  "bankAccounts": [],
  "savedPaymentMethods": [],
  "mandates": [],
  "hasMandate": false
}
PATCH/v1/customers/:idProposed

Update a customer

Updates customer fields.

Request Example
PATCH /v1/customers/:id
cURL · v1
curl -X PATCH "https://api.rafiqpay.net/v1/customers/:id" \
  -H "Authorization: Bearer rp_test_sk_kanzu_9f8a7b6c5d4e3f2a" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Amina Bello-Yusuf"
}'
Response (200 OK)
Response payload
{
  "id": "cus_amina_01",
  "name": "Amina Bello-Yusuf"
}
GET/v1/customersProposed

List customers

Lists customers.

Request Example
GET /v1/customers
cURL · v1
curl -X GET "https://api.rafiqpay.net/v1/customers" \
  -H "Authorization: Bearer rp_test_sk_kanzu_9f8a7b6c5d4e3f2a"
Response (200 OK)
Response payload
{
  "object": "list",
  "data": [],
  "hasMore": false,
  "nextCursor": null
}

These events are dispatched to your webhook endpoints when actions occur on this resource: