コンテンツにスキップ
アカウントを作成
または
サインイン
Stripe ドキュメントのロゴ
/
AI に質問する
アカウントを作成
サインイン
始める
支払い
財務の自動化
プラットフォームおよびマーケットプレイス
資金管理
開発者向けのツール
始める
支払い
財務の自動化
始める
支払い
財務の自動化
プラットフォームおよびマーケットプレイス
資金管理

オンランプのシステムをアップグレードする公開プレビュー

オンランプのベータのシステムをアップグレードする際の API の変更をご紹介します。

ページをコピー

注意

2023-06-21 より前にオンランプ API を導入した場合は、このガイドに従ってください。

公開リリースの一部として Stripe 法定通貨から仮想通貨へのオンランプ API を変更しました。2023-06-21 より前にオンランプを導入している場合は、ベータのオンランプ API が使用されています。

このガイドでは、変更内容、構築済みのシステムに対する影響、この最新バージョンへの移行の手順について説明します。

オンランプベータからの変更

  • 上位の POST /v1/crypto/onramp_sessions リクエスト本文に transaction_details をフラット化しました
  • オンランプの API リクエストとレスポンスの以下のフィールドの名前が変更されました
    • supported_destination_currencies は destination_currencies になりました
    • supported_destination_networks は destination_networks になりました
    • source_exchange_amount は source_amount になりました
    • destination_exchange_amount は destination_amount になりました
  • オンランプの見積もりのパスを /v1/crypto/onramp/quotes から /v1/crypto/onramp_quotes に変更しました

オンランプのリクエストとレスポンスでの変更の例は以下のとおりです。

オンランプの見積もりを取得する

オンランプの見積もりを取得するには、次のようなコマンドを実行します。

Command Line
curl -G https://api.stripe.com/v1/crypto/onramp_quotes \ curl -G https://api.stripe.com/v1/crypto/onramp/quotes \ -u
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:
\ -H "Stripe-Version: 2025-04-30.basil;crypto_onramp_beta=v2" \ -d "source_amount"="200" \ -d "source_exchange_amount"="200" \

次のようなレスポンスを受信します。

{ "id": "2e5818944df6a2325c7e9c1e72d27174b9bedfc8e64ace47c081370a5b982a7b", "rate_fetched_at": 1674265506.3408287, "destination_network_quotes": { "ethereum": [ { "id": "d160a80828eabb6b6d4aeafac585eee62d95425c7fb7577866ab04b9a786df00", "destination_currency": "eth", "destination_amount": "0.253568242640499553", "destination_exchange_amount": "0.253568242640499553", "destination_network": "ethereum", "fees": { "network_fee_monetary": "1.45", "transaction_fee_monetary": "12.71" }, "source_total_amount": "214.20" }, { "id": "53f864cb28a42f11e1d9d5aff7e43ac96b056406f74cbf618399c6fa40f3d275", "destination_currency": "usdc", "destination_amount": "200.00", "destination_exchange_amount": "200.00", "destination_network": "ethereum", "fees": { "network_fee_monetary": "5.80", "transaction_fee_monetary": "12.76" }, "source_total_amount": "218.56" } ], ... }, "livemode": true, "source_currency": "usd", "source_amount": "200.00", "source_exchange_amount": "200.00" }

オンランプセッションを作成する

オンランプセッションを作成するには、次のようなコマンドを実行します。

Command Line
curl -X POST https://api.stripe.com/v1/crypto/onramp_sessions \ -u
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:
\ -H "Stripe-Version: 2025-04-30.basil;crypto_onramp_beta=v2" \ -d "wallet_addresses[ethereum]"="0xB00F0759DbeeF5E543Cc3E3B07A6442F5f3928a2" \ -d "source_currency"="usd" \ -d "destination_amount"="0.1" \ -d "destination_currency"="eth" \ -d "destination_network"="ethereum" \ -d "destination_currencies[]"="eth" \ -d "destination_networks[]"="ethereum" \ -d "transaction_details[wallet_addresses][ethereum]"="0xB00F0759DbeeF5E543Cc3E3B07A6442F5f3928a2" \ -d "transaction_details[source_currency]"="usd" \ -d "transaction_details[destination_exchange_amount]"="10" \ -d "transaction_details[destination_currency]"="eth" \ -d "transaction_details[destination_network]"="ethereum" \ -d "transaction_details[supported_destination_currencies][]"="eth" \ -d "transaction_details[supported_destination_networks][]"="ethereum"

次のようなレスポンスを受信します。

{ "id": "cos_0MYvv9589O8KAxCGPm84FhVR", "object": "crypto.onramp_session", "client_secret": "cos_0MYvv9589O8KAxCGPm84FhVR_secret_IGBYKVlTlnJL8UGxji48pKxBO00deNcBuVc", "created": 1675794575, "livemode": false, "status": "initialized", "transaction_details": { "destination_currency": "eth", "destination_network": "ethereum", "fees": null, "lock_wallet_address": false, "source_currency": "usd", "source_amount": null, "destination_amount": "0.100000000000000000", "destination_currencies": [ "eth" ], "destination_networks": [ "ethereum" ], "source_exchange_amount": null, "destination_exchange_amount": "0.100000000000000000", "supported_destination_currencies": [ "eth" ], "supported_destination_networks": [ "ethereum" ], "transaction_id": null, "wallet_address": null, "wallet_addresses": { "bitcoin": null, "ethereum": "0xB00F0759DbeeF5E543Cc3E3B07A6442F5f3928a2", "polygon": null, "solana": null, "stellar": null, "destination_tags": null } } }

既存のシステムに対する影響

これらの変更は、既存のベータで構築されたシステムに影響しない方法でリリースされています。システムで問題が発生した場合は、Stripe サポートにお問い合わせください。

ベータから最新のオンランプバージョンに移行する

よくある間違い

以下の場合にのみ、このセクションに従ってください。

  • Stripe は、オンランプの登録の申し込みを 2023-06-21 より前に承認しました。
  • 2023-06-21 より前にオンランプを導入しました。

それ以外の場合、すでに最新のオンランプバージョンが使用されているため、ここに記載されている手順は不要です。

バージョンの互換性

公開プレビュー

API バージョンをアップグレードする場合、最初に、リクエストの Stripe-Version ヘッダーの一部として crypto_onramp_beta=v2 を指定します。

ベータの導入では、Stripe-Version ヘッダーの一部として crypto_onramp_beta バージョンを渡すことで、ベータまたは最新のオンランプ API バージョンを利用できるようになりました。渡される Stripe-Version ヘッダーに基づいて想定される動作を判断するには、次のマトリックスを使用してください。

バージョンヘッダー想定される API の動作
未指定Stripe-Version: 2025-04-30.basilベータ
v1Stripe-Version: 2025-04-30.basil;crypto_onramp_beta=v1ベータ
v2Stripe-Version: 2025-04-30.basil;crypto_onramp_beta=v2最新

API バージョンをアップグレードする場合、最初に、リクエストの Stripe-Version ヘッダーの一部として crypto_onramp_beta=v2 を指定します。

このページはお役に立ちましたか。
はいいいえ
お困りのことがございましたら 、サポートにお問い合わせください。
早期アクセスプログラムにご参加ください。
変更ログをご覧ください。
ご不明な点がございましたら、お問い合わせください。
LLM ですか?llms.txt を読んでください。
Powered by Markdoc