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",
"card": {
"cvc": "100",
"expiry_month": "12",
"expiry_year": "24",
"name": "John Doe",
"number": "4000000000001091"
},
"payment_method": {
"type": "scheme",
"store_payment_method": true
},
"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",
"merchant_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": "fc565b43-26f5-4906-92ae-d849edc3c3a1",
"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は、購入または認証プロセス中に敏感なカード情報をトークン化し、実際のカード詳細を公開せずに安全な取引を可能にします。
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",
"card": {
"cvc": "100",
"expiry_month": "12",
"expiry_year": "24",
"name": "John Doe",
"number": "4000000000001091"
},
"payment_method": {
"type": "scheme",
"store_payment_method": true
},
"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",
"merchant_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": "fc565b43-26f5-4906-92ae-d849edc3c3a1",
"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
}
}
カードをトークン化することで、カード詳細を再入力することなく繰り返し取引を行うことができ、セキュリティとユーザー体験の向上が図れます。
生成されたトークンは、購入と認証の両方の取引で使用でき、さまざまな支払いタイプに対応する柔軟性を提供します。
重要なパラメータには通常、カード番号、有効期限、CVV、顧客情報が含まれます。
store_payment_method
: 将来の使用のためにカードトークンを保存するには、ペイロードで true
に設定する必要があります。
{
"payment_method": {
"type": "scheme",
"store_payment_method": true
}
store_payment_method
を true
に設定することで、カード詳細を再入力することなく、カードトークンが今後の取引のために保存されます。
{
"transaction_details": {
"id": "<transaction_id>",
"ref": <ref>,
"timestamp": "yyyy-mm-ddThh:mm:ss.000Z",
"merchant_txn_ref": "<string>",
"stored_payment_method_id": "094db781-fabc-4c6d-8fcd-18bee06a527a"
}
}
stored_payment_method_id
は、カード詳細を再入力することなく、今後の取引でカードトークンAPIを使用するために利用できます。
認証のためのAPIキー。フォーマット: 'Basic YOUR_API_KEY_HERE'
x-api-key専用のAPIキー。
決済取引を処理するためのリクエストペイロード。
The body is of type object
.
支払いが正常に処理されました。
The response is of type object
.