代碼意義 API Response Code
📋 重要說明:欄位大小寫差異
| API 類型 | result 欄位 | message 欄位 | result_object 欄位 | Result Code 類型 |
|---|---|---|---|---|
| Platform APIs | result (小寫) | message (小寫) | result_object (小寫) | 字串 (“000”, “999”) |
Platform APIs
重要: 所有 Platform APIs 使用以下 Response 格式:(小寫欄位: result, message, result_object)
{
"result": "string",
"message": "string or null",
"result_object": object or null
}
1.1 POST /platform/entry
功能:訂單建立
所有可能的 Response:
| result | message | result_object | 觸發條件 |
|---|---|---|---|
"000" | null | {payment_url, qr_img, qr_timeout} | 成功建立付款連結 |
"101" | "Order is paid" | null | 訂單已付款 |
"200" | "Bad request" | {動態訊息:會說明哪些欄位資料錯誤原因} | BadParams (參數錯誤) |
"200" | "Store not found" | null | BadParams (參數錯誤) store_id 資料錯誤 |
"200" | "Using the currency unsupported by the Store" | null | BadParams (參數錯誤)currency 資料錯誤 |
"200" | "Entry of this store needs identity verification" | null | BadParams (參數錯誤) 該 store 訂單需要驗證 identities 資料 |
"200" | "Order has been used as entry but they do not match with each others" | null | BadParams (參數錯誤) 同一 platform_order_id 號碼,但是多次 request 的 store_id, currency, total_price , final_price 資料不一致時會觸發 |
"200" | "Invalid number of digits for the order currency amount" | null | BadParams (參數錯誤) 依據 currency 與 total_price, final_price 小數點檢核異常時觸發 |
"200" | "Order price below limit for this currency" | null | BadParams (參數錯誤) 當 total_price, final_price 小於該外幣 currency 最低金額時時觸發JPY = 5USD = 0.02CNY = 0.11HKD = 0.13 |
"999" | "Internal Error" | null | 街口方系統出現非預期錯誤 |
成功 result_object 結構:
{
"payment_url": "https://...",
"qr_img": "https://...qr_code.png",
"qr_timeout": 600
}
1.2 POST /platform/refund
功能:訂單退款
所有可能的 Response:
| result | message | result_object | 觸發條件 |
|---|---|---|---|
"000" | null | 退款資訊物件 | 成功建立退款 |
"100" | "Invaid Order ID" | null | 訂單不存在 |
"102" | "Order has excessed 180 days cannot be refunded" | null | 超過退款期限 |
"105" | "Inconsistent remain amount" | null | 剩餘金額不一致 |
"105" | "Inconsistent refund amount" | null | 退款金額不一致,兩次 request 使用同一個 refund_order_id 但 refund_amount 不同時觸發 |
"111" | "Transaction has been closed" | null | 交易已關閉 (已關帳) |
"113" | "Refund reject due to refund amount exceeds total unreimbursed amount." | null | 商家餘額不足 |
"116" | "JKOPAY coupon reimbursement failed, please contact JKOPAY for assistance in refund" | null | 退款失敗 (Coupon) |
"117" | "JKOPAY Coupon is used in this transaction, and we will only accept full refund" | null | 使用 Coupon 的訂單僅接受全額退款 |
"200" | "Invalid number of digits for the order currency amount" | null | BadParams (參數錯誤) 依據 currency 與 total_price, final_price 小數點檢核異常時觸發 |
"922" | "Refund amount exceeds order final price" | null | 退款金額超過可退款金額 |
"922" | {動態訊息} | null | 退款失敗 錯誤訊息參考 message 回傳資訊 |
"978" | "Closed account can't use JKOPay's service, please contact the JKOPay's customer service." | null | 帳戶無法使用街口服務 |
"999" | "Internal Error" | null | 街口方系統出現非預期錯誤 |
1.3 GET /platform/inquiry
功能:訂單查詢
所有可能的 Response:
| result | message | result_object | 觸發條件 |
|---|---|---|---|
"000" | null | {transactions: [...]} | 成功查詢 (含所有訂單狀態) |
transactions 陣列中每筆訂單的 status:
0– 付款成功100– 付款失敗101– 尚未付款102– 查無此訂單
result_object 結構 (TWD 訂單):
{
"transactions": [
{
"platform_order_id": "ORDER_001",
"status": 0,
"tradeNo": "J2025010100000000001",
"trans_time": "2025-01-15 14:30:00",
"currency": "TWD",
"final_price": "1000",
"redeem_amount": "0",
"redeem_detail": {
"jko_coin_amount": 0,
"official_coupon_amount": 0,
"store_coupon_amount": 0
},
"debit_amount": "1000",
"invoice_vehicle": "/ABCDABC",
"channel_type": "bank",
"refund_history": [...]
}
]
}
result_object 結構 (非 TWD 訂單):
{
"transactions": [
{
"platform_order_id": "ORDER_002",
"status": 0,
"tradeNo": "J2025010100000000002",
"trans_time": "2025-01-15 14:30:00",
"currency": "JPY",
"final_price": "1230",
"redeem_amount": "0",
"redeem_detail": {
"jko_coin_amount": 0,
"official_coupon_amount": 0,
"store_coupon_amount": 0
},
"debit_amount": "249",
"invoice_vehicle": "",
"channel_type": "bank",
"refund_history": [...]
}
]
}