訂單退款 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. Full refund and partial 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_idstring60N電商端退款單號,須為唯一值,一筆退款單號僅能退款一次,若要再次發起退款需更換單號。ID of order refund saved in the platform.
refund_amountdecimal20,0Y退款金額;允許部分、多次部分退
款,但該筆訂單加總退款金額不可超
過訂單實際消費金額。
Refund amount with order currency. Full refund and partial refunds are allowed. Total refund amount cannot exceed final price of purchase order.

範例 (Example):

POST https://{街口路徑}/platform/refund
Content-Type: application/json
api-key: c775e7b757ede630cd0aa1113bd102661ab38829ca52a6422ab782862f268646
digest: 80b9967b29287605e4ef10b45668792f9d5235777ab305bb72217078dec3205a

{
"platform_order_id": "Kt12345",
"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 fields
result_object.refund_tradeNostring25街口端退款交易序號。JKOPAY refund trade number.
result_object.debit_amountdecimal20,0消費者付款方式退款金額。User payment method refund amount.
result_object.redeem_amountdecimal20,0退還折抵金額。Redeem amount.
result_object.redeem_detail fields
result_object.redeem_detail.jko_coin_amountdecimal街口幣折抵JKO coin redeem amount
result_object.redeem_detail.official_coupon_amountdecimal官方街口券折抵Official coupon redeem amount
result_object.redeem_detail.store_coupon_amount
decimal店家街口券折抵Store coupon redeem amount
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"
}
}