Design your own checkout
You choose the layout, the fields, and the Pay button. Ionic Blocks
supplies the secure card inputs and confirms the payment.
Take card payments at the counter
Send a sale to a terminal from your point-of-sale backend, starting with
the simulated terminals in your test account.
Launch subscriptions
Bill recurring prices automatically, with free trials, renewals, and
retries handled by Ionic.
Turn your software into a payments platform
Onboard the businesses you serve and take payments for each of them with
one set of platform keys.
Prerequisites
- A test-mode secret key (
sk_v1_test_...) from Developers → API keys. Test keys move no money. See Authentication. - A backend route that can call Ionic without exposing the secret key to the browser.
- A success URL and cancel URL in your application.
1. Create a session
Create the session from your server.amount is in cents: 15000 is $150.00. Repeating the request with the same
Idempotency-Key and body returns the original session instead of creating a
duplicate; the SDK generates a key per call when you omit the field. The
response includes a session id, status fields, line item totals, and a hosted
checkout url when the session can be opened by the buyer.
2. Redirect the buyer
On your frontend, redirect to the returnedurl.
3. Verify the result
After the buyer returns to your success page, use thesession_id from the URL to look up the session from your server.
checkout.session.completed webhook only when the session is
both complete and paid. Set one up with the
webhook quickstart.
What to build next
Fulfill every order once
A signed
checkout.session.completed event tells your server when to
fulfill. Skip duplicates and fulfill each order once.Keep buyers on your site
Embed the same checkout inside your page, so customers finish the purchase
without leaving your website.
Price once, sell everywhere
Replace inline amounts with products and prices you reuse in checkout,
payment links, and subscriptions.
Sell add-ons at checkout
Offer optional items and let buyers adjust quantities on the same hosted
page.
Sell with a link or QR code
Turn an offer into a reusable link for sales teams, QR codes, and
campaigns. Edit or retire it without a deploy.
Sign up subscribers
Switch the session to subscription mode and sign up recurring customers on
the same hosted page.

