Skip to main content
Take your first payment with Ionic in three steps. Your server creates a checkout session, the buyer pays on a page Ionic hosts, and your server confirms the result. Ionic hosts the card form and keeps card data off your servers, and everything runs in test mode, where no real money moves. Inline line items let you integrate first and add catalog products later. Building something else? Start from the outcome you want:

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.
Never create checkout sessions directly from browser code with a secret key. Your frontend should call your server, and your server should call Ionic.
If your backend runs Node, install the server SDK. It carries typed request and response shapes for every endpoint, generates an idempotency key for each mutating call, and retries transient failures with backoff. Every step below also shows the raw HTTP call for other stacks.

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 returned url.

3. Verify the result

After the buyer returns to your success page, use the session_id from the URL to look up the session from your server.
Treat the redirect as a user experience step, not confirmation of payment. Fulfill from a verified 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.
Compare integrations in Ways to accept payments, or browse what you can build. When your integration works end to end, Going live moves it to real payments.