Set Refund Status (Sandbox)
Force a refund to any status on demand and fire the matching webhook, so one refund can exercise every branch of your handler.
Overview
A real refund walksINITIATED → REFUNDED or INITIATED → FAILED, driven by the bank on its own timetable. Statuses like REVERSED or BANK_REJECTED_REFUND are rare enough that you may never see one before it happens in production.
This endpoint forces a refund straight to any status and fires the same webhook a real change would, so you can exercise every branch of your handler deliberately.
Statuses
REFUNDED also stamps refunded_at with the current time, if it is not already set.
REFUNDED or FAILED and back again. This is deliberate — it lets one refund cover the whole matrix instead of needing a fresh one per branch.Which webhook fires
status_message is carried into the webhook, so you can assert on it end to end.
Case asymmetry
You send"status": "FAILED" and receive "refund_status": "failed".
Requests take uppercase; responses return lowercase. Sending "refunded" is rejected as an invalid choice — the most common cause of a 400 on this endpoint. Uppercase the response value before comparing it to what you sent.
Exercising every branch
Walk one refund through each status, checking your handler at each step:Testing a failed refund
REFUND_FAILED carrying your custom message.
Errors
400 responses use error.code = ERR_REFUND_002:
500 on this endpoint uses ERR_SERVICE_ERROR_000, unlike its 400s.
Related
Mark as Settled
Create Refund
Authorizations
Client Application ID - Your unique application identifier used to authenticate API requests. You can find your Client ID in the Developer Settings section of the merchant dashboard.
Client Secret Key - Your secret key used alongside the Client ID for secure authentication. Keep this confidential and never expose it in client-side code. Available in the Developer Settings section of the merchant dashboard.
Merchant Identifier - The unique ID for the merchant account. This is required for PSP (Payment Service Provider) merchants who manage multiple merchant accounts. You can find merchant IDs in the Merchant Management section of the dashboard.
API Version - Specifies which version of the API to use (e.g., '1.X.X', '2.X.X', or '3.X.X'). This header allows you to control which API version your integration uses. Default version information is available in the Developer Settings.
Path Parameters
UID of the refund.
Body
Target status. Uppercase — "refunded" is rejected, "REFUNDED" is accepted.
INITIATED, PROCESSING, REFUNDED, FAILED, REVERSED, ON_HOLD, BANK_REJECTED_REFUND "FAILED"
Custom message carried into the webhook. Omit for the default for that status.
"Beneficiary account closed"
Bank reference to stamp on the refund. Left unchanged if omitted.
"BANKREF123"