APIエンドポイント
- サーバー間通信
- トークン化
- サブスクリプション
- ウォレット
- ホスト決済ページ
エラーとレスポンス
ウェブフック
サブスクリプションキャンセルAPI
サブスクリプションキャンセルAPIは、加盟店が顧客のサブスクリプションを永久に停止し、今後の請求サイクルとサービスを防ぐことを可能にします。
curl --request POST \
--url https://api-dev.paymentoptions.com/api/v1/api/v1/server-to-server-interface/subscription/{subscription_id}/cancel \
--header 'Authorization: <api-key>' \
--header 'x-api-key: <api-key>'
{
"success": true,
"status_code": 200,
"is_live": false,
"gateway_response": {
"version": "1",
"type": "INFO",
"message": "Subscription Updated.",
"code": "INFO3000"
},
"subscription_details": {
"id": "664dc930-88bd-4696-8807-5e0f1fedba0b",
"type": "CYCLE",
"max_cycle_count": 10,
"status": "CANCELLED",
"completed_payment_cycle": 1,
"last_payment_status": "SUCCESSFUL",
"next_payment_date": "2024-11-28T01:31:29.154Z",
"next_payment_cycle": 2,
"subscription_plan_details": {
"name": "Three weeks plan",
"desc": "Billed every two days",
"billing_cycle_type": "DAYS",
"billing_cycle_interval": 2,
"amount": 1000,
"ccy": "JPY",
"trial_period_duration": "",
"trial_period_duration_type": "NONE",
"plan_discount_percentage": 10,
"plan_discount_duration": 2
},
"subscription_transaction_details": [
{
"id": "359f39bd-673a-47b3-b9ec-cbd6cd313b8e",
"ref": 74860,
"cycle": 1,
"status": "SUCCESSFUL",
"transaction_date": "2024-11-26T01:31:29.000Z",
"amount": 900,
"ccy": "JPY",
"event": "CAPTURED"
}
]
}
}
重要なポイント
フローダイアグラム
APIパラメータ
Authorizations
認証のためのAPIキー。形式:'Basic YOUR_API_KEY_HERE'
x-api-key専用のAPIキー。
Path Parameters
サブスクリプションのサブスクリプション ID。例: 664dc930-88bd-4696-8807-5e0f1fedba0b。
36
Response
操作が成功したかどうかを示します。
true
レスポンスの HTTP ステータスコード。
200
取引がライブ取引かテスト取引かを示します。
false
キャンセルされたサブスクリプションの詳細。
サブスクリプション ID。
"664dc930-88bd-4696-8807-5e0f1fedba0b"
サブスクリプションの種類(例:CYCLE または Unlimited)。
"CYCLE"
最大請求サイクル数。
10
サブスクリプションの更新されたステータス。
"CANCELLED"
完了した請求サイクルの数。
1
このサブスクリプションの最後の支払いステータス。
"SUCCESSFUL"
サブスクリプションの次回支払日。
"2024-11-28T01:31:29.154Z"
次の支払いサイクルの番号。
2
サブスクリプションプランの詳細。
サブスクリプションプランの名前。
"Three weeks plan"
サブスクリプションプランの説明。
"Billed every two days"
請求サイクルの種類(例:日単位または月単位)。
"DAYS"
請求サイクル間隔。
2
サブスクリプションプランの支払額。
1000
サブスクリプション取引の通貨。
"JPY"
試用期間の長さ(該当する場合)。
""
試用期間の種類(例:日単位または月単位)。
"NONE"
サブスクリプションプランの割引率。
10
割引の適用期間(請求サイクル単位)。
2
サブスクリプションの取引詳細リスト。
このサブスクリプション取引の取引 ID。
"359f39bd-673a-47b3-b9ec-cbd6cd313b8e"
サブスクリプション取引の参照番号。
74860
取引の支払いサイクル番号。
1
サブスクリプション取引のステータス。
"SUCCESSFUL"
サブスクリプション取引の日付。
"2024-11-26T01:31:29.000Z"
取引の支払額。
900
取引の通貨。
"JPY"
取引のイベントタイプ(例:CAPTURED)。
"CAPTURED"
curl --request POST \
--url https://api-dev.paymentoptions.com/api/v1/api/v1/server-to-server-interface/subscription/{subscription_id}/cancel \
--header 'Authorization: <api-key>' \
--header 'x-api-key: <api-key>'
{
"success": true,
"status_code": 200,
"is_live": false,
"gateway_response": {
"version": "1",
"type": "INFO",
"message": "Subscription Updated.",
"code": "INFO3000"
},
"subscription_details": {
"id": "664dc930-88bd-4696-8807-5e0f1fedba0b",
"type": "CYCLE",
"max_cycle_count": 10,
"status": "CANCELLED",
"completed_payment_cycle": 1,
"last_payment_status": "SUCCESSFUL",
"next_payment_date": "2024-11-28T01:31:29.154Z",
"next_payment_cycle": 2,
"subscription_plan_details": {
"name": "Three weeks plan",
"desc": "Billed every two days",
"billing_cycle_type": "DAYS",
"billing_cycle_interval": 2,
"amount": 1000,
"ccy": "JPY",
"trial_period_duration": "",
"trial_period_duration_type": "NONE",
"plan_discount_percentage": 10,
"plan_discount_duration": 2
},
"subscription_transaction_details": [
{
"id": "359f39bd-673a-47b3-b9ec-cbd6cd313b8e",
"ref": 74860,
"cycle": 1,
"status": "SUCCESSFUL",
"transaction_date": "2024-11-26T01:31:29.000Z",
"amount": 900,
"ccy": "JPY",
"event": "CAPTURED"
}
]
}
}