APIエンドポイント
- サーバー間通信
- トークン化
- サブスクリプション
- ウォレット
- ホスト決済ページ
エラーとレスポンス
ウェブフック
購入API (v1)
この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": "5200000000001005"
},
"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"
},
"browser_info": {
"acceptHeader": "text/html",
"screenColorDepth": "48",
"javaEnabled": false,
"language": "en",
"screenHeight": "1200",
"screenWidth": "1600",
"challengeWindow": "4",
"userAgent": "Mozilla/4.0 (MSIE 6.0; Windows NT 5.0)"
},
"time_zone": "Asia/Kuala_Lumpur"
}'
{
"success": true,
"status_code": 201,
"is_live": false,
"transaction_type": "PRE_AUTH",
"gateway_response": {
"version": "1",
"type": "INFO",
"message": "Payment Successful.",
"code": "INFO0000"
},
"merchant_details": {
"legal_name": "Tink15 Factory",
"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": "917290",
"currency": "JPY",
"payment_method": "ECMC-SSL",
"scheme": "MASTERCARD",
"card": {
"name": "John Doe",
"number": "5200000000001005",
"exp_month": "12",
"exp_year": "24"
},
"additional_data": {
"payment_data_source": {
"type": "card"
}
}
},
"transaction_details": {
"id": "ab8444e7-fec0-40dd-994d-0ad813785f74",
"ref": 74797,
"timestamp": "2024-11-25T07:22:48.000Z",
"merchant_txn_ref": "qwe",
"stored_payment_method_id": null
},
"risk-details": {
"risk_score": null
}
}
重要なポイント
-
購入APIは、資金を即座にキャプチャし、認証することで、決済を同時に処理して完了させます。
-
このAPIは、金額が固定され、支払いが即座に完了する必要がある取引に最適です。例えば、オンライン小売の購入やデジタル商品販売などです。
-
購入が成功した後、必要に応じて取引を返金することができ、加盟店は顧客に資金を返金できます。
フローダイアグラム
APIパラメータ
Authorizations
認証のためのAPIキー。形式:'Basic YOUR_API_KEY_HERE'
x-api-key専用のAPIキー。
Body
取引の金額。
"1000"
商品の処理通貨の略称(例:JPY)。
3
"JPY"
カードの詳細を含むJSONオブジェクト。
カードのセキュリティコード(ほとんどは3桁、AMEXは4桁)。
4
"100"
カードの有効期限の月(例:12月の場合は12)。
2
"12"
カードの有効期限の年(例:2024年の場合は24)。
2
"24"
カードに記載されたカード所有者の名前。
255
"John Doe"
カード番号。
16
"5200000000001005"
加盟店ID(DASMID)。
128
"< Merchant ID >"
カード所有者の請求先住所を含むJSONオブジェクト。
カード所有者の請求先国コード。
2
"JP"
カード所有者の請求先メールアドレス。
45
"billing@testemail.com"
カード所有者の請求先電話番号。
20
"8112345678"
カード所有者の請求先住所。
199
"1-2-3 Shinjuku"
カード所有者の請求先市区町村。
65
"Shinjuku-ku"
カード所有者の請求先都道府県。
65
"Tokyo"
カード所有者の請求先郵便番号。
45
"1600022"
加盟店の取引参照ID。
45
"qwe"
カード所有者のIPアドレス。
45
"127.0.0.1"
返却URLを含むJSONオブジェクト。(このフィールドは3DS取引で必須です。)
カード所有者の配送先住所を含むJSONオブジェクト(オプション)。
カード所有者の配送先国コード。
2
"JP"
カード所有者の配送先メールアドレス。
45
"shipping@testemail.com"
カード所有者の配送先電話番号。
20
"8112345678"
カード所有者の配送先住所。
199
"1-2-3 Shinjuku"
カード所有者の配送先市区町村。
65
"Shinjuku-ku"
カード所有者の配送先都道府県。
65
"Tokyo"
カード所有者の配送先郵便番号。
45
"1600022"
カード所有者が使用するブラウザの詳細を含むJSONオブジェクト(オプション)。
ブラウザが送信するHTTP Acceptヘッダーの値。
200
"text/html"
画面のビット単位のカラーデプス。
2
"48"
ブラウザでJavaが有効かどうかを示します。
false
ブラウザの言語(通常はブラウザ設定で指定された言語)。
10
"en"
画面の高さ(ピクセル単位)。
5
"1200"
画面の幅(ピクセル単位)。
5
"1600"
カード所有者のブラウザがサポートするチャレンジウィンドウのサイズ。
2
"4"
ブラウザのユーザーエージェント文字列。
500
"Mozilla/4.0 (MSIE 6.0; Windows NT 5.0)"
取引の国別タイムゾーン。
128
"Asia/Kuala_Lumpur"
Response
取引が成功した場合はtrue、失敗した場合はfalse。
true
取引のステータスコード。
201
本番取引の場合はtrue、テスト取引の場合はfalse。
false
取引タイプ(例:PRE_AUTH)。
"PRE_AUTH"
加盟店の詳細を含むJSONオブジェクト。
加盟店の正式名称。
"Tink15 Factory"
加盟店ID(DASMID)。
"< Merchant ID >"
加盟店の取引参照ID。
"qwe"
請求詳細を含むJSONオブジェクト。
請求先住所を含むJSONオブジェクト。
カード所有者の請求先国コード。
"JP"
カード所有者の請求先メールアドレス。
"billing@testemail.com"
カード所有者の請求先電話番号。
"8112345678"
カード所有者の請求先住所。
"1-2-3 Shinjuku"
カード所有者の請求先市区町村。
"Shinjuku-ku"
カード所有者の請求先都道府県。
"Tokyo"
カード所有者の請求先郵便番号。
"1600022"
支払いの詳細を含むJSONオブジェクト。
取引の金額。
1000
アクワイアラー応答コード。
0
アクワイアラーの認証コード。
"917290"
取引の通貨。
"JPY"
支払いカードの種類(例:クレジットカード)。
"ECMC-SSL"
カードブランドのスキーム(例:MASTERCARD)。
"MASTERCARD"
取引の詳細を含むJSONオブジェクト。
取引ID。
"ab8444e7-fec0-40dd-994d-0ad813785f74"
取引の認証コード。
74797
取引の日付と時刻。
"2024-11-25T07:22:48.000Z"
加盟店の取引参照ID。
"qwe"
保存された支払い方法ID(該当する場合)。
null
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": "5200000000001005"
},
"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"
},
"browser_info": {
"acceptHeader": "text/html",
"screenColorDepth": "48",
"javaEnabled": false,
"language": "en",
"screenHeight": "1200",
"screenWidth": "1600",
"challengeWindow": "4",
"userAgent": "Mozilla/4.0 (MSIE 6.0; Windows NT 5.0)"
},
"time_zone": "Asia/Kuala_Lumpur"
}'
{
"success": true,
"status_code": 201,
"is_live": false,
"transaction_type": "PRE_AUTH",
"gateway_response": {
"version": "1",
"type": "INFO",
"message": "Payment Successful.",
"code": "INFO0000"
},
"merchant_details": {
"legal_name": "Tink15 Factory",
"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": "917290",
"currency": "JPY",
"payment_method": "ECMC-SSL",
"scheme": "MASTERCARD",
"card": {
"name": "John Doe",
"number": "5200000000001005",
"exp_month": "12",
"exp_year": "24"
},
"additional_data": {
"payment_data_source": {
"type": "card"
}
}
},
"transaction_details": {
"id": "ab8444e7-fec0-40dd-994d-0ad813785f74",
"ref": 74797,
"timestamp": "2024-11-25T07:22:48.000Z",
"merchant_txn_ref": "qwe",
"stored_payment_method_id": null
},
"risk-details": {
"risk_score": null
}
}