訂單退款 Refund API

位置:https://{Please update according to test/production path provided by JKOPAY}/platform/refund

Method:POST

說明:電商平台呼叫此 API,將該筆電商平台交易序號執行退款,可支援多此部分、多次部分退款,累積退款金額不可超過訂單實際消費金額。

Online merchant platform merchant calls Refund API to execute refund process. Partial and split refunds are supported. Total refund amount cannot exceed final price of per purchase order.

整合流程 (Integration Workflow)

Merchant refund initiation workflow

請求參數 (Request Parameter)

參數名稱
Parameter
資料型態
Data Type
最大長度
Maximum
必要
Required
說明Description
platform_order_idString60Y原電商平台端交易序號
街口端需比對電商平台退款單號是否
正確。
ID of order saved in the platform. JKOPAY is required to ensure that the platform refund ID matches the corresponding order ID.
refund_order_id60N電商端退款單號,須為唯一值,一筆退款單號僅能退款一次,若要再次發起退款需更換單號。ID of order refund saved in the platform.
refund_amountdecimal20,0Y退款金額;允許部分、多次部分退
款,但該筆訂單加總退款金額不可超
過訂單實際消費金額。
Refund amount with order currency; partial and split refunds allowed. Total refund amount cannot exceed final price of purchase order.

範例 (Example):

POST https://{街口路徑}/platform/refund
Content-Type: application/json
API-KEY: 4h0Ms
DIGEST: 80b9967b29287605e4ef10b45668792f9d5235777ab305bb72217078dec3205a

{"platform_order_id": 87, "refund_amount": 100} 

返回參數 (Response JSON Body)

參數名稱
Parameter
資料型態
Data Type
大長度
Maximum
說明Description
resultString請參照 API 回覆代碼
(ResponseCode)。
Please refer to API response code (responseCode).
messageString25結果訊息或失敗理由。Result message or reason of error.
result_object.refund_tradeNoString20,0街口端退款交易序號。JKOPAY refund trade number.
result_object.debit_amountdecimal20,0消費者付款方式退款金額。User payment method refund amount.
result_object.redeem_amountdecimal退還折抵金額。Redeem amount.
transaction.redeem_detailRedeemDyail
result_object.refund_timeString退款時間。
格式: YYYY-mm-dd HH:MM:SS
Time of refund in UTC+8 time zone.
Format: YYYY-mm-dd HH:MM:SS

範例 (Example):

{
 "result": "000",
 "message": null, 
 "result_object": {
"refund_tradeNo": "K0026910118070413C4001",
"debit_amount": 70,
" redeem_amount": 30, 
"redeem_detail":{
"jko_coin_amount": 20,
"official_coupon_amount": 0,
"store_coupon_amount": 10,
},
 "refund_time": "2018-07-01- 12:20:20"
 }
}