Authorization
default 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
Path Parameters
The payment's `id`.
Header Parameters
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
`keep` the instalments collected, or `refund` them.
"keep""refund"With `outcome: refund`, why the payment is refunded: one of the refund reasons. Defaults to `requested_by_customer`.
With `outcome: refund`, who bears the fee share of the refund: `merchant` (default) or `customer`.
"merchant""customer"Response Body
application/json
application/json
application/json
curl -X POST "https://api.wajub.com/payments/trx_8Hc2kLm4Qp9Rs3Tv/close" \ -H "Idempotency-Key: close-order-1042" \ -H "Content-Type: application/json" \ -d '{ "outcome": "keep" }'{ "code": 200, "status": "OK", "message": "Payment closed", "transaction": { "id": "trx_8Hc2kLm4Qp9Rs3Tv", "amount": 10000, "amount_paid": 5000, "currency": "XAF", "status": "succeeded" }}OK