调至内容部分
创建账户
或
登录
Stripe 文档徽标
/
询问人工智能
创建账户
登录
开始
付款
销售收入
平台和交易市场
资金管理
开发人员资源
概览
关于 Stripe 支付
升级您的集成
支付分析
线上付款
概览查找您的用例Managed Payments
使用 Payment Link
构建结账页面
构建高级集成
构建应用内集成
支付方式
添加支付方式
管理支付方式
用 Link 更快结账
支付接口
Payment Links
结账
Web Elements
应用内 Element
支付场景
处理多种货币
自定义支付流程
灵活收单
编排
线下支付
Terminal
超越支付功能
成立公司
加密货币
    概览
    稳定币支付
    法币兑加密货币入金
      概览
      开始
      嵌入式入金集成快速启动
      可嵌入的入口小部件扩展指南
      独立入金集成指南
      参考编号
      Onramp API
      最佳实践
    稳定币提现
    稳定币金融账户
Financial Connections
Climate
了解欺诈
Radar 欺诈保护
管理争议
验证身份
首页付款CryptoFiat-to-crypto onramp

Use the standalone onramp公开预览

Generate a redirect URL and mint a session for the standalone onramp.

The Stripe-hosted, standalone onramp is a prebuilt frontend integration of the crypto onramp hosted at https://crypto.link.com. Platforms can integrate the crypto onramp by redirecting their users to the standalone onramp, rather than hosting an embedded version of the onramp within their application.

Before you begin

To access the Onramp API, including testing environments, you must follow these steps to submit your application. We review most onramp applications within 48 hours.

  1. Create or sign in to your Stripe account and submit the onramp application.
  2. Complete your Stripe application.
  3. After submitting the application, start development using testing environments.

We notify you when your application is approved or if we need more information. You can check your application status anytime by visiting the onboarding page.

No code standalone onramp

The standalone onramp redirect URL supports parameter customization and lets you prefill fields such as the destination currency and the source amount or destination amount.

Share the link by sending it directly to users or by displaying it with a button, as in the following demo.

来源金额(美元)
输入您要兑换为加密货币的法币的金额
$

将用户直接发送到此 URL

https://crypto.link.com
复制到剪贴板

带有重定向 URL 的示例按钮

Buy Crypto

用代码生成重定向 URL

const standaloneOnramp = window.StripeOnramp.Standalone(); const redirectUrl = standaloneOnramp.getUrl(); return ( <a href={redirectUrl}> Buy Crypto </a> );

Customize the standalone onramp

You can also generate a redirect URL with code using the Standalone function and passing in the desired fields. Choose to either generate a redirect URL or mint a session with a redirect URL:

Customization optionOverviewBest for
Generate a redirect URLGenerate a redirect URL in the frontend without a Stripe account. Customize the suggested source or destination amount, destination currency, and network.If you want a lightweight front-end integration with light customization and no branding.
Mint a session with a redirect URLMint a session with a redirect URL in the backend with a Stripe account. Allows full customization, including the destination wallet address. For a full list of parameters, see Pre-populate transaction parameters.If you want a fully customized onramp with branding.

Generate a redirect URL

Include the following scripts using script tags within the <head> element of your HTML. These scripts must always load directly from Stripe domains (https://js.stripe.com and https://crypto-js.stripe.com) for compatibility and PCI compliance. Don’t include the scripts in a bundle or host a copy yourself. If you do, your integration might break without warning.

<head> <title>Onramp</title> <script src="https://js.stripe.com/basil/stripe.js"></script> <script src="https://crypto-js.stripe.com/crypto-onramp-outer.js"></script> </head>

Generate a redirect URL using the Standalone function, passing in the desired parameters:

const standaloneOnramp = window.StripeOnramp.Standalone({ source_currency: 'usd', amount: {source_amount: '42'}, destination_networks: ['ethereum', 'bitcoin'], destination_currencies: ['eth', 'btc'], destination_currency: 'btc', destination_network: 'bitcoin' }); const redirectUrl = standaloneOnramp.getUrl();

You can pre-populate these parameters:

  • source_currency: The fiat currency for the transaction (usd and eur).
  • amount: The fixed amount of fiat currency or cryptocurrency for this purchase. Specify a fiat amount by passing in source_amount ({source_amount: 42}) . Specify a cryptocurrency amount by passing in destination_amount ({destination_amount: 42}). You can only specify one amount.
  • destination_currencies: An array of cryptocurrencies you want to restrict to (['eth', 'usdc']).
  • destination_networks: An array of crypto networks you want to restrict to (['ethereum', 'polygon']).
  • destination_network: The default crypto network for this onramp (ethereum).
  • destination_currency: The default cryptocurrency for this onramp session (eth).

Redirect your users to the URL for a prebuilt front-end integration of the crypto onramp on the standalone onramp.

Mint a session with a redirect URL

Similar to other integrations, you need to implement a server endpoint to create a new onramp session for every user visit. The onramp session creation request returns a redirect_url. Redirect your users to the URL for a fully customized and branded crypto onramp on the standalone onramp.

Generate a crypto onramp session with a redirect_url by running the following curl command:

Command Line
curl -X POST https://api.stripe.com/v1/crypto/onramp_sessions \ -u
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:

You receive a response similar to the following:

{ "id": "cos_0MpKNb589O8KAxCGjmaOVF8T", "object": "crypto.onramp_session", "client_secret": "cos_0MpKNb589O8KAxCGjmaOVF8T_secret_fqV1TAdhSCFeO9FW5HnygRXca00AwEHIOu8", "created": 1679701843, "livemode": false, "redirect_url": "https://crypto.link.com?session_hash=CCwaGwoZYWNjdF8yOERUNTg5TzhLQXhDR2JMbXh5WijU7vigBjIGmyBbkqO4Oi10eFHEaFln9gFSsTGQBoQf5qRZK-A0NhiEIeH3QaCMrz-d4oYotirrAd_Bkz4", "status": "initialized", "transaction_details": { "destination_currency": null, "destination_amount": null, "destination_network": null, "fees": null, "lock_wallet_address": false, "source_currency": null, "source_amount": null, "destination_currencies": [ "btc", "eth", "sol", "usdc", "xlm" ], "destination_networks": [ "bitcoin", "ethereum", "solana", "polygon", "stellar" ], "transaction_id": null, "wallet_address": null, "wallet_addresses": null } }
此页面的内容有帮助吗?
是否
  • 需要帮助?联系支持。
  • 加入我们的早期使用计划。
  • 查看我们的更改日志。
  • 有问题?联系销售。
  • LLM? Read llms.txt.
  • Powered by Markdoc
相关指南
Onramp API reference