redirect-refund

PUT {{base_url}}/api/v1/redirect/orders/:order_id

Refund order

Refund order API

URL/api/v1/redirect/orders/{order_id}
MethodPUT
Content-Typeapplication/json

Refund order Request parameter

NameLocationTypesRequiredinstruction
order_idpathstringYesThe unique order number used by the merchant (merchantorderid when creating the order)

Body parameters

NameLocationTypesRequiredinstruction
refundorderidbodystringYesUnlimited format, unique refund order number used by merchant
signaturebodystringYesRequest signature
timestampbodystringYesTimestamp
refund_amountbodynumberYesThe refund amount, cents, cannot be greater than the order amount, only partial payment channels support non-full refunds.
providerbodystringNoPayment gateway
midbodystringNoThe merchant ID of this order is only valid when there are multiple sub-merchants under the same account.

Request body example

{
    "refund_amount": 88,
    "refund_order_id": "mr_1626780710",
    "signature": "49B80F2A260918CF02081578B415D726B25417C1A6C7536FE5909834104F4752",
    "timestamp": "1626780710"
}

Response result

The refund interface returns the refund result synchronously. If the refund is successful, the interface returns the order details, and the error_code is REFUNDED.

Successful response example
{
    "id": "358",
    "status": "Refunded",
    "timestamp": "1626835729",
    "currency": "THB",
    "error_code": "REFUNDED",
    "order_type": "Refund",
    "reference": "mc_1626835648",
    "api_name": "general",
    "locked": false,
    "channel": "wechat",
    "gateway_order_id": "dev358",
    "cleared": false,
    "acquirer_order_id": "90020210721104935321056",
    "amount": -100,
    "error_message": "The order is refunded.",
    "channel_order_id": "50201008942021072110392377943",
    "signature": "0086AF4E0F73FA6D76A43B85ADBF5A8AA44145751CD30E88E97ED0542CC0F9C7",
    "force_clear": false,
    "merchant_order_id": "mr_1626835728",
    "log_entry_url": "https://dev.vip.ksher.net/web#action=153&view_type=form&model=rest.log&id=1277"
}

Request Body

{"refund_order_id"=>"refund1_20220117100000", "refund_amount"=>1, "signature"=>"{{signature}}", "timestamp"=>"1234567890"}

RESPONSES

status: OK

{"amount":-1,"reference":"20220117100000","acquirer":"Ksher","acquirer_order_id":"90020220117110415824651","channel_order_id":"220117100416372DP5PB","reserved2":"False","mid":"False","status":"Refunded","currency":"THB","reserved1":"2201171000247785","reserved3":"False","id":"423","order_date":"2022-01-17 03:02:55.939737","gateway_order_id":"snut423","signature":"594CAAD0093B63542E7238986D9D802E4F49E1ECB09FF314061FB0DC175318DA","order_type":"Refund","locked":false,"cleared":false,"error_code":"DUPLICATED","error_message":"Duplicated Order ID","merchant_order_id":"refund_20220117100000","channel":"truemoney","api_name":"general","note":"string","reserved4":"False","force_clear":false}