Set up a subscription with stablecoin paymentsPrivate Vorschau
Learn how to create and charge for a subscription with stablecoins.
Use this guide to set up a subscription that withdraws recurring stablecoin payments from a customer’s crypto wallet.
Create a product and priceDashboard
Products represent the item or service you’re selling. Prices define how much and how frequently you charge for a product. This includes how much the product costs, what currency you accept, and whether it’s a one-time or recurring charge. If you only have a few products and prices, create and manage them in the Dashboard.
This guide uses a stock photo service as an example and charges customers a 15 USD monthly subscription. To model this:
- Go to the Products page and click Create product.
- Enter a Name for the product. You can optionally add a Description and upload an image of the product.
- Select a Product tax code. Learn more about product tax codes.
- Select Recurring. Then enter 15 for the price and select USD as the currency.
- Choose whether to Include tax in price. You can either use the default value from your tax settings or set the value manually. In this example, select Auto.
- Select Monthly for the Billing period.
- Click More pricing options. Then select Flat rate as the pricing model for this example. Learn more about flat rate and other pricing models.
- Add an internal Price description and Lookup key to organize, query, and update specific prices in the future.
- Click Next. Then click Add product.
After you create the product and the price, record the price ID so you can use it in subsequent steps. The pricing page displays the ID and it looks similar to this: price_
.
Create a Checkout SessionServer-side
Your customer must authorize you to use their crypto wallet for future payments through Stripe.
Add a checkout button to your website that calls a server-side endpoint to create a Checkout Session.
<html> <head> <title>Checkout</title> </head> <body> <form action="/create-checkout-session" method="POST"> <button type="submit">Checkout</button> </form> </body> </html>
Create a Checkout Session in subscription
mode to collect the required information. After creating the Checkout Session, redirect your customer to the URL that the response returns.
Confirm the payment is successful
When your customer completes a payment, Stripe redirects them to the URL that you specified in the success_
parameter. Typically, this is a page on your website that informs your customer that their payment was successful.
However, crypto is a delayed notification payment method, which means that funds aren’t immediately available. Because of this, delay order fulfillment until the funds are available. After the payment succeeds, the underlying PaymentIntent status changes from processing
to succeeded
.
A crypto payment typically takes a few minutes to make the funds available.
You can confirm the payment is successful in several ways:
Test your integration
Test your Pay with Crypto integration with your test API keys by viewing the redirect page. You can test the successful payment case by authenticating the payment on the redirect page.
In sandbox, pay with testnet crypto assets on the payment page you’re redirected to.
Configure your wallet to the test network you intend to pay over. For example, if you want to pay with USDC on Ethereum, make sure your wallet is set to Ethereum’s Sepolia test network.
Fund your wallet with test assets
You can use testnet “faucets” to top up your wallet. Here are a few: