1
Create an API key
In the dashboard, open Integrations → API keys and select Create API key. Give it the
checkout_api permission. Copy the key, which starts with sk_.2
Store the key on your server
Keep the key in an environment variable on your backend. It must never ship to a browser or mobile app.
3
Create a checkout session
Send the items you want to charge for. The response contains a hosted checkout URL.
4
Redirect the customer
Send the customer to the returned
url. After paying they land on your success_url. To fulfil orders reliably, listen for the checkout.session.completed webhook rather than relying on the redirect.