API ReferencePayments
Create a payment
POST /v1/payments : initiate a collection on a resolved method.
POST /v1/payments
Headers
| Header | Required | Value |
|---|---|---|
Authorization | yes | Bearer sk_... |
Idempotency-Key | yes | unique per operation |
Content-Type | yes | application/json |
Body
| Field | Type | Required | Notes |
|---|---|---|---|
customer_id | string | yes | Customer ULID |
amount_minor | int | yes | Positive integer minor units |
currency | string | yes | ISO 4217 |
method | string | yes | A selectable method from /payments/methods |
reference | string | no | Your reference for reconciliation |
method must be selectable for the customer: query
GET /v1/payments/methods first. virtual_account is never selectable: it is
a funding instrument, not a checkout method.
Request
curl https://api.ouipay.africa/v1/payments \
-H "Authorization: Bearer sk_test_..." \
-H "Idempotency-Key: pay-001" \
-H "Content-Type: application/json" \
-d '{
"customer_id": "01M2S17...",
"amount_minor": 50000,
"currency": "NGN",
"method": "card"
}'Response 201
The payment object. method-dependent
next action is in provider: e.g. redirect_url for card.
Errors
| HTTP | error.code | Cause |
|---|---|---|
| 400 | VALIDATION | Invalid field |
| 422 | METHOD_NOT_SELECTABLE | Method not enabled for the customer |
| 422 | INSUFFICIENT_FUNDS | Wallet/funding short (wallet method) |