Skip to content
Loading keys…
Authorization<token>

A public key (pk./pk_test.) is accepted on /payments, /customers, /links, /invoices and the catalogue reads (/channels, /providers, /countries, /currencies); anything that moves money out, reads the balance or manages the account answers 406 to it. It is an identifier, never an authorization. Use a secret key (sk./sk_test.) for sensitive operations (transfers, refunds, balance), or a restricted key (rk./rk_test.) scoped to specific permissions. The _test. variant of any key selects the sandbox environment, there is no separate sandbox URL. Never expose your secret key in client-side code.

In: header

Header Parameters

Idempotency-Keystring

Your key for this request, 1 to 128 characters of letters, digits and `. _ : -`. The same request sent again with the same key returns the first answer instead of doing the work twice. See [Idempotency](/api/idempotency).

Request Body

application/json

paymentstringrequired

The payment `id` (e.g. `trx_CSUGajfv9xh0XQ5wu2lx`).

amountnumber | null

Amount to refund in the major currency unit. Omit for a full refund.

currencystring | null

The payment's own currency, as an ISO 4217 code. A refund is always made in the currency of its payment, so this can be omitted; any other currency answers `422`.

fees_bearer"merchant" | "customer"

Who bears the payment's Wajub fee for the refunded share: `merchant` (the payer gets back everything they paid, the fee too if they paid it on top) or `customer` (the fee share is deducted, or not returned). Defaults to your refund settings, else to whoever paid the fee at payment time.

"merchant""customer"
reason"duplicate" | "fraudulent" | "requested_by_customer" | "service_not_delivered" | "product_not_received" | "wrong_amount" | "network_error" | "transaction_error" | "customer_complaint" | "merchant_error" | "reconciliation"required

Why the payment is refunded. One of `duplicate`, `fraudulent`, `requested_by_customer`, `service_not_delivered`, `product_not_received`, `wrong_amount`, `network_error`, `transaction_error`, `customer_complaint`, `merchant_error`, `reconciliation`. Any other value answers `422`.

"duplicate""fraudulent""requested_by_customer""service_not_delivered""product_not_received""wrong_amount""network_error""transaction_error""customer_complaint""merchant_error""reconciliation"
referencestring | null

Your own reference for this refund, up to 255 characters.

metadataobject | null

Your own key-value data. Some keys are reserved by Wajub.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.wajub.com/refunds" \  -H "Idempotency-Key: refund-order-1042" \  -H "Content-Type: application/json" \  -d '{    "payment": "trx_CSUGajfv9xh0XQ5wu2lx",    "reason": "requested_by_customer"  }'
POST
/refunds
{  "code": 201,  "status": "Created",  "message": "Refund created successfully",  "refund": {    "id": "rfd_Pm3Vc8Lx2Nq7Rb5Tk9Hw",    "transaction": "trx_CSUGajfv9xh0XQ5wu2lx",    "amount": 5000,    "currency": "XAF",    "fees_bearer": "merchant",    "fee_amount": 100,    "payer_amount": 5000,    "status": "pending",    "reason": "requested_by_customer",    "created_at": "2026-01-15T12:00:00+00:00"  }}

Refund created

What did you think of this content?