Request a refund
const url = 'https://cybqa.pesapal.com/pesapalv3/api/Transactions/RefundRequest';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"confirmation_code":"example","amount":"example","username":"example","remarks":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://cybqa.pesapal.com/pesapalv3/api/Transactions/RefundRequest \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "confirmation_code": "example", "amount": "example", "username": "example", "remarks": "example" }'Submits a refund request against a completed payment.
Only one request is accepted per payment. A second request against the
same confirmation_code is rejected regardless of amount, so a partial
refund permanently forecloses refunding the remainder.
The response carries no refund identifier, amount or timestamp, and
getTransactionStatus continues to report the payment as completed.
There is no way to query a refund afterwards, so log the request and
response yourself.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
From a completed payment.
May be less than the original amount.
Your identifier for whoever authorised the refund.
Examplegenerated
{ "confirmation_code": "example", "amount": "example", "username": "example", "remarks": "example"}Responses
Section titled “Responses”Returned for both success and failure. This response has no error
key in either case. Read status.
Returned by cancellation and refund operations. There is no error key
in this shape, on success or failure.
object
"200" on success, "500" on failure.
Examples
{ "status": "200", "message": "Refund request successfully"}{ "status": "500", "message": "Refund request has been received already"}