1. Home
  2. Docs
  3. 授權扣款 Authorized Payment
  4. API列表 (API Lists)
  5. 授權綁定結果通知 Authorization CallBack

授權綁定結果通知 Authorization CallBack

授權綁定結果通知 CallBack 實作規格

Method:POST

說明:
此為平台需實作的API提供給街口callback;
當用戶授權流程結束且成功時,街口服務端會 callback 此平台request提供的 result_url 通知授權結果。
街口認定HTTP Status Code 200 為成功,HTTP Status Code 500 認定失敗且須Retry

連線規則:
Connection timeout:5 秒
Read timeout:10 秒

Retry規則:
每間隔 2^指數時間(秒數)Retry,最多 12 次,約在 2 小時內完成。舉例說明 callback 失敗後,間隔 1 秒後第一次Retry,如果失敗再間隔 2 秒第二次 Retry,如果失敗再間隔 4 秒第三次 Retry 依此類推。

請求參數 (Request Parameter)

參數名稱
Parameter
資料型態
Data Type
最大長度
Maximum
必要
Required
說明Description
authpayObjectY授權資料Granted authpay information

authpay

參數名稱
Parameter
資料型態
Data Type
最大長度
Maximum
必要
Required
說明Description
GrantedAuthPayObjectY授權資料Granted authpay information

GrantedAuthPay

參數名稱
Parameter
資料型態
Data Type
最大長度
Maximum
必要
Required
說明Description
typeString30Y授權類型
regular: 定期定額授權扣款
Authorization type
regular: recurring payment (fixed amount)
statusString30Y授權狀態
ungranted: 未授權
granted: 已授權
cancel: 已取消
Authorization status
ungranted: not yet authorized
granted: authorized
cancel: authorization canceled
auth_noString30Y街口端授權編號JKOPay authorization number
platform_authpay_idString60Y平台授扣編號(留存用)Merchant platform authorization number(for record-keeping)
jkos_accountString100Y街口帳號JKOPay user’s account
billing_currencyStringN原始扣款幣別,預設TWDOriginal currency, default= TWD
billing_amountDecimal18,0N原始扣款金額Original amount
billing_cyclebilling_cycle[]定期定額: Y
不定期不定額: N
扣款週期與扣款次數(定期定額適用)Deduction cycle and times (For type is regular)

billing_cycle

注:時區統一為 UTC+8(Note: UTC+8 timezone)

參數名稱
Parameter
資料型態
Data Type
最大長度
Maximum
必要
Required
說明Description
billing_cycle.periodStringY扣款週期,時區限制為UTC+8,限帶入以下字串(e.g.week)
week:週(Sun~Mon)
month:月
quarter:季
year:年
Deduction cycle period, timezone is UTC+8, and input the following string only (e.g.week)
week:(From Sun to Mon)
month
quarter
year
billing_cycle.timesIntN每週期內,扣款次數。
(限帶入整數,如未帶此參數,系統預設為1次)
Week <= 7次
Month <= 7次
Quarter <= 7次
Year <= 12次
The deduction time in regular period. (input Int only, default= 1)
If the period is a week, then the times-limit <= 7
If the period is a month, then the times-limit <= 7
If period is a quarter, then the times-limit <= 7
If the period is a year, then the times-limit <= 12

範例 (Example):

定期定額 callback Request:

{
"authpay": {
"type": "regular",
"auth_no": "591692855148417024",
"status": "granted",
"platform_authpay_id": "AUTHPAY_001",
"jkos_account": "987654321"
}
}

不定期不定額 callback Request:

{
"authpay": {
"type": "limited",
"auth_no": "591692855123456789",
"status": "granted",
"platform_authpay_id": "AUTHPAY_002",
"jkos_account": "987654321"
}
}

{
"authpay": {
"type": "regular",
"auth_no": "591692855148417024",
"status": "granted",
"platform_authpay_id": "AUTHPAY_001",
"jkos_account": "987654321"
}
}

HTTP Response

HTTP 200