訂單查詢 Inquiry API
Domain:https://{Please update according to test/production path provided by JKOPAY}/platform/inquiry?platform_order_ids=
Method:GET
說明:電商平台呼叫此 API,查詢該筆電商平台交易序號的付款、退款歷程。
Platform server calls Inquiry API to search platform order transactions’ payment and refund history.
整合流程 (Integration Workflow)
請求參數 (Request Parameter)
參數名稱 Parameter | 資料型態 Data Type | 最大長度 Maximum | 必要的 Required | 說明 | Description |
---|---|---|---|---|---|
platform_order_ids[] | String | 60 | Y | 電商平台端交易序號 最多可以查詢 20 筆交易。 | ID of order saved in the platform. Platform can search up to 20 order IDs at a time. |
範例 (Example):
GET https://{街口路徑}/platform/inquiry?platform_order_ids=87,88
Content-Type: application/json
API-KEY: 4h0Ms
DIGEST: a0836fefb028ea7493118c8b5eb6752113f552ac8ef35f3cb8cda91808c77188
/*
Secret key='QxN1X'
(hmac(“platform_order_ids=87, 88”))
*/
返回參數 (Response JSON Body)
參數名稱 Parameter | 資料型態 Data Type | 最大長度 Maximum | 說明 | Description |
---|---|---|---|---|
result | String | 請參照 API 回覆代碼 (ResponseCode)。 | Please refer to API response code (responseCode). | |
message | String | 25 | 結果訊息或失敗理由。 | Result message or reason of error. |
result_object fields | ||||
transactions[] | 依 JSON 格式,陣列帶入訂單資 訊。 | Provides purchase order information according to JSON format. | ||
platform_order_id | String | 60 | 電商平台端交易序號 | Online merchant platform order ID. |
status | Int | 請參照 OrderStatusCode | Please refer to orderStatusCode. | |
tradeNo | String | 25 | 街口端交易序號 | JKOPAY trade number. |
trans_time | String | 訂單交易時間 格式: YYYY-mm-dd HH:MM:SS | Time of transaction in UTC+8 time zone. Format: YYYY-mm-dd HH:MM:SS | |
final_price | String | 20 | 訂單實際消費金額。 | Final price of order with payment currency. |
redeem_amount | String | 20 | 折抵金額=街口幣折抵+官方街口 券折抵+店家街口券折抵 | Redeemed amount(JKO coins & JKO ticket) |
transaction.redeem_detail | RedeemDyail | |||
redeem_detail.jko_coin_amount | decimal | 20,0 | 街口幣折抵 | JKO coin redeem amount |
redeem_detail.official_coupon_amount | decimal | 20,0 | 官方街口券折抵 | Official coupon redeem amount |
redeem_detail.store_coupon_amount | decimal | 20,0 | 店家街口券折抵 | Store coupon redeem amount |
debit_amount | String | 20 | 付款方式扣款金額(折抵後金 額)。 | Payment method debit amount (after deduct JKO coins) with payment currecny. (final_price = redeem_amount + debit_amount) |
invoice_vehicle | String | 20 | 街口帳戶發票載具 | |
maskNo | String | 16 | 付款工具為信用卡時提供卡號前 六後四碼 格式:222222******3333 | |
channel_type | String | 支付工具 “account”: 儲值帳戶 “bank”: 銀行帳戶 “creditcard”: 信用卡 | Pay tool account : JKOPay account bank : bank account credicard | |
refund_history fields | 列出退款歷程;依 JSON 格式, 陣列帶入退款資訊。 | List refund history; insert refund information according to JSON format. | ||
refund_history.refund_tradeNo | String | 街口端退款交易序號 | JKOPAY refund trade number. | |
refund_history.amount | String | 退款金額。 | Refund amount. | |
refund_history.redeem_amount | String | 退還折抵金額。 | Refund redeemed amount. | |
refund_history.debit_amount | String | 消費者付款方式退款金額。 | User payment method refund debit amount. | |
refund_history.time | String | 退款時間 格式: 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":{
"tranactions":[
{
"platform_order_id": "87",
"status": 0,
"tradeNo": "J0026910118070413C4",
"trans_time": "2018-07-01 12:00:00",
"final_price": "1000",
"redeem_amount": "300",
"debit_amount": "700",
"redeem_detail": {
"jko_coin_amount": 200,
"official_coupon_amount": 0,
"store_coupon_amount": 100,
},
"refund_history":[
{
refund_tradeNo": "K0026910118070413C4001",
"time": "2018-07-01 12:20:20",
"amount": "100",
"debit_amount": "70",
"redeem_amount": "30",
"redeem_detail": {
"jko_coin_amount": 20,
"official_coupon_amount": 0,
"store_coupon_amount": 10,
},
},
{
"refund_tradeNo": " K0026910118070413C4002",
"time": "2018-07-01 12:30:20",
"amount": "200",
"redeem_amount": "60"
"debit_amount": "140"
}
]
},
{
"platform_order_id": "88",
"status": 101
}
]
}
}