1. Home
  2. Docs
  3. 授權扣款 Authorized Payment
  4. API列表 (API Lists)
  5. 授權扣款 Authorization deduction request

授權扣款 Authorization deduction request

授權扣款 transaction API

Method:POST
Domain:
https://[Host]/platform/authpay/transaction

說明:
電商平台呼叫此API,發動該筆平台授權序號的授權扣款。

請求參數 (Request Parameter)

參數名稱
Parameter
資料型態
Data Type
最大長度
Maximum
必要
Required
說明Description
auth_noString30Y街口端授權編號Jkopay authorization number
orderAuthOrderUnitYAuthOrderUnit

AuthOrderUnit

參數名稱
Parameter
資料型態
Data Type
最大長度
Maximum
必要
Required
說明Description
platform_order_idString60Y電商平台端交易序號
需為唯一值,不可重複。
The ID of the order is saved on the platform.
This ID needs to be unique and unrepeated.
trade_nameString30Y交易名稱
(會顯示於app中授權交易記錄頁)
Transaction name
(shown in the authorization record page in the JKOPay app)
currencyString3Y原始幣別 [ISO 4217]Original currency [ISO 4217]
total_priceDecimal18,0Y訂單價格(原始幣別)Total price (original currency)
final_priceDecimal18,0Y訂單應付價格(原始幣別)Final price would be paid (original currency)
unredeemDecimalN訂單不可折抵回饋金額(原始幣別)
預設為0
The amount that cannot be discounted or not qualified for reward (original currency)
Default = 0
productsProduct[]N商品資訊Product information
remarkString500N備註Memo

Products

參數名稱
Parameter
資料型態
Data Type
最大長度
Maximum
必要
Required
說明Description
nameString60N商品名稱(charset=utf-8)
imgString500N商品網址
unit_countIntN商品數量
unit_priceDecimal18,0N商品單價(原價)
unit_final_priceDecimal18,0N商品單價(付款價格)
category_pathList<string>N

返回參數 (Response JSON Body)

參數名稱
Parameter
資料型態
Data Type
最大長度
Maximum
必要
Required
說明Description
resultStringY回覆結果
messageStringY回覆訊息
(扣款金額驗證失敗時會提供error message)
result_objectObject (result_object)N回覆物件 (成功才會有)

result_object

參數名稱
Parameter
資料型態
Data Type
說明Description
result_objectTransactionTransaction

Transaction

參數名稱
Parameter
資料型態
Data Type
最大長度
Maximum
必要
Required
說明Description
platform_order_idString60Y電商平台端交易序號
需為唯一值,不可重複。
The ID of the order is saved on the platform.
This ID needs to be unique and unrepeated.
statusintY(Status非0時,以下欄位不回覆)(When the status does not equal 0, the following parameters will not be returned)
tradeNoString25Y街口端交易序號JKOPay transaction number
trans_timeStringY交易時間
YYYY-mm-dd HH:MM:SS
Transaction time
YYYY-mm-dd HH:MM:SS
currencyString3Y原始幣別 [ISO 4217](TWD)Currency [ISO 4217](TWD)
final_priceDecimal18,0Y訂單應付價格(原始幣別)The final price would be paid (original currency)
redeem_amountDecimal18,0Y折抵金額=街口幣折抵+官方街口券折抵+店家街口券折抵Discounted amount = amount of JKO coin + JKO official coupon + store coupon
redeem_detailRedeemDetail[]Y
debit_amountDecimal18,0Y付款方式扣款金額(折抵後金額)Amount paid (after discount)
refund_historyRefundTransaction[]Y
invoice_vehicleString20Y街口帳戶發票載具Jkopay account invoice carrier
maskNoString16N付款工具使用信用卡時提供卡號前六後四碼
格式:222222******3333
When channel_type is “credit card” then the JKOPay server will reply with the card number(The first six numbers and last four numbers)
Format: 222222******3333
channel_type StringY支付工具
account: 儲值帳戶
bank: 銀行帳戶
creditcard: 信用卡
User’s payment method
account: JKOPay balance
bank: bank account
creditcard: credit card (not available for crossborder payment)

RefundTransaction

參數名稱
Parameter
資料型態
Data Type
最大長度
Maximum
必要
Required
說明Description
refund_tradeNoString25Y街口端退款交易序號Jkopay refund transaction number
amountDecimal18,0Y退款金額Refund amount
redeem_amountDecimal18,0Y退還折抵金額Amount redeemed
redeem_detailRedeemDetailY
debit_amountDecimal18,0Y消費者付款方式退款金額Amount refunded to the user’s payment method
timeStringY退款時間(UTC+8)
YYYY-mm-dd HH:MM:SS
Refund time
YYYY-mm-dd HH:MM:SS

RedeemDetail

參數名稱
Parameter
資料型態
Data Type
最大長度
Maximum
必要
Required
說明Description
jko_coin_amountDecimal18,0Y街口幣折抵金額JKO coin redeem amount
official_coupon_amountDecimal20,0Y官方街口券折抵金額official coupon redeem amount
store_coupon_amountDecimal20,0Y店家街口券折抵金額store coupon redeem amount

範例 (Example):

授權扣款 transaction API Request:

{
"auth_no": "605495635344494592",
"order": {
"platform_order_id": "test-roy-010",
"trade_name":"第X次扣款",
"currency": "TWD",
"total_price": 50,
"final_price": 50,
"unredeem": 0,
"products": [{
"name": "商品1",
"img": null,
"unit_count": 1,
"unit_price": 50,
"unit_final_price": 50,
"category_path": []}],
"remark": "備註"
}
}

授權扣款 transaction API Response (成功):

{
"result": "000",
"message": null,
"result_object": {
"platform_order_id": "67ada7353b123",
"status": 0,
"tradeNo": "J0153402025021300123",
"trans_time": "2025-02-13 16:03:01",
"currency": "TWD",
"final_price": 225,
"redeem_amount": 0,
"redeem_detail": {
"jko_coin_amount": 0,
"official_coupon_amount": 0,
"store_coupon_amount": 0
},
"debit_amount": 225,
"refund_history": null,
"invoice_vehicle": "/JURT123",
"remain_JKO_fee": 0,
"maskNo": null,
"channel_type": "creditcard",
"re": 0,
"netPaid": 0,
"transaction_seq": null
}
}

授權扣款 transaction API Response (失敗):

{
"result": "121",
"message": "Insufficient bank account balance.",
"result_object": null
}