miniapp-refund
PUT {{base_url}}/api/v1/redirect/orders/:order_id
Refund order
Refund order API
URL | /api/v1/miniapp/orders/{order_id} |
---|
Method | PUT |
Content-Type | application/json |
Refund order Request parameter
Name | Location | Types | Required | instruction |
---|
order_id | path | string | Yes | The unique order number used by the merchant (merchantorderid when creating the order) |
Body parameters
Name | Location | Types | Required | instruction |
---|
refundorderid | body | string | Yes | Unlimited format, unique refund order number used by merchant |
signature | body | string | Yes | Request signature |
timestamp | body | string | Yes | Timestamp |
refund_amount | body | number | Yes | The refund amount, cents, cannot be greater than the order amount, only partial payment channels support non-full refunds |
mid | body | string | No | The 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"}