C scan B - refund

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

Refund order

Refund order API

URL/api/v1/cscanb/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

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"}