Skip to main content
POST
Set refund status (sandbox)
Sandbox only. This endpoint returns 400 in production. It operates only on refunds created through the Simulator payment gateway — a refund on a real gateway is rejected.

Overview

A real refund walks INITIATED → 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

Setting REFUNDED also stamps refunded_at with the current time, if it is not already set.
Terminal statuses are reversible here. You may move a refund out of 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

Webhooks fire only on a genuine transition. Setting a refund to the status it already holds returns 200 and sends nothing. To re-trigger an event, move the refund to a different status first.
Your 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:
Each transition fires the corresponding event from the table above.

Testing a failed refund

Your endpoint receives REFUND_FAILED carrying your custom message.

Errors

400 responses use error.code = ERR_REFUND_002:
404 does not use the standard envelope. A refund that does not exist — or belongs to another merchant — returns a bare {"detail": "..."} rather than the success/error shape. Handle that separately.Note this is a 404, not a 403: refunds are scoped to your account and its sub-merchants, and someone else’s refund is simply not found.
A 500 on this endpoint uses ERR_SERVICE_ERROR_000, unlike its 400s.

Mark as Settled

Settle payments on demand, refunds and chargebacks included.

Create Refund

Create the refund you are going to drive.

Authorizations

X-Client-ID
string
header
required

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.

X-Client-Secret
string
header
required

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.

X-Merchant-ID
string
header
required

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.

X-API-Version
string
header
required

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

refund_id
string
required

UID of the refund.

Body

application/json
status
enum<string>
required

Target status. Uppercase"refunded" is rejected, "REFUNDED" is accepted.

Available options:
INITIATED,
PROCESSING,
REFUNDED,
FAILED,
REVERSED,
ON_HOLD,
BANK_REJECTED_REFUND
Example:

"FAILED"

status_message
string | null

Custom message carried into the webhook. Omit for the default for that status.

Example:

"Beneficiary account closed"

bank_ref_num
string | null

Bank reference to stamp on the refund. Left unchanged if omitted.

Example:

"BANKREF123"

Response

Refund updated. A transition to a status the refund already held still returns 200, but sends no webhook.

success
boolean
Example:

true

message
string
Example:

"Refund status updated successfully"

data
object