sk_sandbox_… key · nothing touches real money.
1
Create a product
Omit
recurringInterval for a one-time product; set it for a subscription plan.data.id is your pro_….2
Open a checkout session
Mint a Test card
cs_… token and redirect the buyer to its url.4242 4242 4242 4242, any future expiry, any CVC.3
Register a webhook endpoint
Add your destination in dashboard settings
and store the
whsec_… secret it shows once · you need it to
verify signatures.4
Grant access
In your handler, verify the signature and grant on the right event ·
which one depends on the payment method.
Charge without a hosted page
Two calls, in this order, and only for the pay-as-you-go case · metered billing, a top-up, a threshold crossed. 1. Store the card. Asetup session takes no amount and charges nothing.
data.url. Once they are through, read the stored card:
A card charge with the buyer present is refused here. Collecting a card needs
a page that renders card fields, and that page is ours · so there is no way to
hand this endpoint a card token, and no card data ever reaches your servers.
Full API reference
Every parameter and response field.

