Skip to content

Create a refund

The call that returns funds on a succeeded payment, its parameters and its answer.

The payment is named by its Wajub id. Your own reference on the payment is not accepted here.

POSThttps://api.wajub.com/refunds
paymentstringrequired
The payment's id, such as trx_test_CSUGajfv9xh0XQ5wu2lx. Your merchant reference is not accepted.
reasonenumrequired
Why you are refunding. The accepted values are listed below.
amountnumberoptional
Amount in the major unit, decimals allowed and rounded to two. Omit it for a full refund of whatever is left.
currencystringoptional
Must equal the payment's currency. Defaults to it.
fees_bearerenumoptional
merchant or customer: who bears the payment's Wajub fee for the refunded share. Defaults to your refund settings, else to whoever paid the fee at payment time. See below.
referencestringoptional
Your own reference for this refund, up to 255 characters. Comes back on reads.
metadataobjectoptional
Free-form key-value data, echoed back on the refund object. One key is reserved: dispute_settlement marks the refund Wajub creates when you accept a dispute, and is dropped if you send it.

reason is required and closed. Sending anything outside this list is a 422, so pick the closest match rather than inventing one.

ReasonUse it when
requested_by_customerThe customer asked, and you agreed
duplicateThe same order was paid twice
fraudulentYou believe the payment was not made by the cardholder or account owner
product_not_receivedGoods never arrived
service_not_deliveredA service was paid for and not rendered
wrong_amountYou charged more than you should have
customer_complaintA complaint you settled without assigning fault
merchant_errorYour own mistake: wrong item, wrong price, wrong customer
network_errorThe payment went through on your side but not on theirs
transaction_errorA technical failure in the payment itself
reconciliationCleaning up a discrepancy found while reconciling

Send the call from your server, with an Idempotency-Key if the refund can be triggered by anything that retries.

curl https://api.wajub.com/refunds \
  -H "Authorization: sk_test.xxxxxxxxxxxxxxxx…" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: refund-order-4172" \
  -d '{
    "payment": "trx_test_CSUGajfv9xh0XQ5wu2lx",
    "amount": 2000,
    "reason": "product_not_received",
    "reference": "rma-881"
  }'

Wajub answers 201 Created. Nothing has left your balance yet: the refund has been accepted, and status tells you how far it has got.

Response · 201 Created
{
"code": 201,
"status": "Created",
"message": "Refund created successfully",
"refund": {
"id": "rfd_test_9xh0XQ5wu2lxCSUGajfv",
"transaction": "trx_test_CSUGajfv9xh0XQ5wu2lx",
"reference": "rma-881",
"amount": 2000,
"currency": "XAF",
"status": "processing",
"reason": "product_not_received",
"metadata": {
},
"sandbox": true,
"created_at": "2026-09-11T10:30:00+00:00"
}
}

The payment is carried in transaction, not payment. Reads also return a tax breakdown where tax applies, a timeline of the status changes, and failure_reason with failure_message when the refund failed. A refund that took money from your balance also returns ledger_balance_currency, ledger_balance_before and ledger_balance_after: your balance just before the refund and just after it, so the difference is what it took, the payment fee's share included when it moved with the refund. In sandbox they are your sandbox balance's. The refund.succeeded payload carries them too. A refund that took nothing, because a lost dispute already had, has none of the three.

Idempotency-Key, and what it keys on

The key never expires: the same key always returns the same refund, never a second one, and reusing it for another payment or another amount answers 422. A key is spent for good, so derive it from this one refund, an order and a refund number, not from the order alone: a second refund of the same amount would only hand you back the first.

What did you think of this content?