OuiPay
API ReferencePayments

Create a payment

POST /v1/payments : initiate a collection on a resolved method.

POST /v1/payments

Headers

HeaderRequiredValue
AuthorizationyesBearer sk_...
Idempotency-Keyyesunique per operation
Content-Typeyesapplication/json

Body

FieldTypeRequiredNotes
customer_idstringyesCustomer ULID
amount_minorintyesPositive integer minor units
currencystringyesISO 4217
methodstringyesA selectable method from /payments/methods
referencestringnoYour 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

HTTPerror.codeCause
400VALIDATIONInvalid field
422METHOD_NOT_SELECTABLEMethod not enabled for the customer
422INSUFFICIENT_FUNDSWallet/funding short (wallet method)

On this page