APIエンドポイント
- サーバー間通信
- トークン化
- サブスクリプション
- ウォレット
- ホスト決済ページ
エラーとレスポンス
ウェブフック
トークン化
トークン使用API
カードトークンは、敏感なカード詳細を再入力することなく、購入または認証取引を安全に完了するために使用されます。このトークン化アプローチは、セキュリティとユーザー体験を向上させます。
POST
/
api
/
v1
/
server-to-server-interface
/
payment
curl --request POST \
--url https://api-dev.paymentoptions.com/api/v1/api/v1/server-to-server-interface/payment \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '{
"amount": "1000",
"currency": "JPY",
"payment_method": {
"type": "scheme",
"store_payment_method": true,
"store_payment_method_id": "094db781-fabc-4c6d-8fcd-18bee06a527a"
},
"merchant_txn_ref": "qwe",
"customer_ip": "127.0.0.1",
"merchant_id": "< Merchant ID >",
"return_url": {
"webhook_url": "< Webhook url >",
"success_url": "http://www.successurl.com/",
"decline_url": "http://www.declineurl.com/"
},
"billing_address": {
"country": "JP",
"email": "billing@testemail.com",
"phone_number": "8112345678",
"address1": "1-2-3 Shinjuku",
"city": "Shinjuku-ku",
"state": "Tokyo",
"postal_code": "1600022"
},
"shipping_address": {
"country": "JP",
"email": "shipping@testemail.com",
"phone_number": "8112345678",
"address1": "1-2-3 Shinjuku",
"city": "Shinjuku-ku",
"state": "Tokyo",
"postal_code": "1600022"
},
"time_zone": "Asia/Kuala_Lumpur"
}'
{
"success": true,
"status_code": 201,
"is_live": false,
"transaction_type": "CAPTURE",
"gateway_response": {
"version": "1",
"type": "INFO",
"message": "Payment Successful.",
"code": "INFO0000"
},
"merchant_details": {
"legal_name": "アイベック株式会社",
"mid": "< Merchant ID >",
"merchant_txn_ref": "qwe",
"billing_details": {
"billing_address": {
"country": "JP",
"email": "billing@testemail.com",
"phone_number": "8112345678",
"address1": "1-2-3 Shinjuku",
"city": "Shinjuku-ku",
"state": "Tokyo",
"postal_code": "1600022"
}
},
"device_details": {
"visited_ip": "127.0.0.1",
"customer_ip": "127.0.0.1"
}
},
"payment_details": {
"amount": 1000,
"response_code": 0,
"auth_code": "268004",
"currency": "JPY",
"payment_method": "ECMC-SSL",
"scheme": "MASTERCARD",
"card": {
"name": "John Doe",
"number": "4000000000001091",
"exp_month": "12",
"exp_year": "24"
},
"additional_data": {
"payment_data_source": {
"type": "card"
}
}
},
"transaction_details": {
"id": "0db1fac1-e064-4644-a387-08d143960c8f",
"ref": 74811,
"timestamp": "2024-11-25T08:24:36.000Z",
"merchant_txn_ref": "qwe",
"stored_payment_method_id": "094db781-fabc-4c6d-8fcd-18bee06a527a"
},
"risk-details": {
"risk_score": null
}
}
重要なポイント
-
一度カードトークンが生成されると、それを使用して購入または認証取引を実行できます。
-
カードトークンは実際のカード詳細の必要性を置き換え、取引中に敏感なデータが決して公開されないことを保証します。
-
この方法は通常、次の目的で使用されます: ワンクリック決済、 定期的な取引(例:サブスクリプション)、 保存された顧客の支払い詳細。
フローダイアグラム
APIパラメータ
カードトークン
stored_payment_method_id
(トークン作成時に生成される)をペイロードに使用して取引を完了します。
リクエスト例
"payment_method":{
"type":"scheme",
"store_payment_method":true,
"stored_payment_method_id": "094db781-fabc-4c6d-8fcd-18bee06a527a"
},
stored_payment_method_id
はカードトークン化プロセスから生成されたトークンであり、今後の取引を安全に完了させるために使用されます。
Authorizations
認証のためのAPIキー。フォーマット: 'Basic YOUR_API_KEY_HERE'
x-api-key専用のAPIキー。
Body
application/json
決済トランザクションを処理するためのリクエストペイロード。
The body is of type object
.
Response
201 - application/json
支払いが正常に処理されました。
The response is of type object
.
curl --request POST \
--url https://api-dev.paymentoptions.com/api/v1/api/v1/server-to-server-interface/payment \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '{
"amount": "1000",
"currency": "JPY",
"payment_method": {
"type": "scheme",
"store_payment_method": true,
"store_payment_method_id": "094db781-fabc-4c6d-8fcd-18bee06a527a"
},
"merchant_txn_ref": "qwe",
"customer_ip": "127.0.0.1",
"merchant_id": "< Merchant ID >",
"return_url": {
"webhook_url": "< Webhook url >",
"success_url": "http://www.successurl.com/",
"decline_url": "http://www.declineurl.com/"
},
"billing_address": {
"country": "JP",
"email": "billing@testemail.com",
"phone_number": "8112345678",
"address1": "1-2-3 Shinjuku",
"city": "Shinjuku-ku",
"state": "Tokyo",
"postal_code": "1600022"
},
"shipping_address": {
"country": "JP",
"email": "shipping@testemail.com",
"phone_number": "8112345678",
"address1": "1-2-3 Shinjuku",
"city": "Shinjuku-ku",
"state": "Tokyo",
"postal_code": "1600022"
},
"time_zone": "Asia/Kuala_Lumpur"
}'
{
"success": true,
"status_code": 201,
"is_live": false,
"transaction_type": "CAPTURE",
"gateway_response": {
"version": "1",
"type": "INFO",
"message": "Payment Successful.",
"code": "INFO0000"
},
"merchant_details": {
"legal_name": "アイベック株式会社",
"mid": "< Merchant ID >",
"merchant_txn_ref": "qwe",
"billing_details": {
"billing_address": {
"country": "JP",
"email": "billing@testemail.com",
"phone_number": "8112345678",
"address1": "1-2-3 Shinjuku",
"city": "Shinjuku-ku",
"state": "Tokyo",
"postal_code": "1600022"
}
},
"device_details": {
"visited_ip": "127.0.0.1",
"customer_ip": "127.0.0.1"
}
},
"payment_details": {
"amount": 1000,
"response_code": 0,
"auth_code": "268004",
"currency": "JPY",
"payment_method": "ECMC-SSL",
"scheme": "MASTERCARD",
"card": {
"name": "John Doe",
"number": "4000000000001091",
"exp_month": "12",
"exp_year": "24"
},
"additional_data": {
"payment_data_source": {
"type": "card"
}
}
},
"transaction_details": {
"id": "0db1fac1-e064-4644-a387-08d143960c8f",
"ref": 74811,
"timestamp": "2024-11-25T08:24:36.000Z",
"merchant_txn_ref": "qwe",
"stored_payment_method_id": "094db781-fabc-4c6d-8fcd-18bee06a527a"
},
"risk-details": {
"risk_score": null
}
}