Skip to main content
Your server creates the checkout session with the platform secret key and the merchant’s ID, the buyer pays on a page Ionic hosts, and the payment belongs to that merchant. The buyer pays on Ionic’s domain, so this flow needs no payment form and no payment domain registration. Session fields and options are the same as in Hosted Checkout.

Before you begin

  • Platform test keys from Connect → API keys, with the secret key on your server.
  • An active connection granting sessions:write and sessions:read, with those permissions also on the platform key.
  • The connected account’s ID (mer_…), selected by your application’s authorization logic.
  • @ionicfi/sdk 0.4.1 or later for the TypeScript examples, installed from npm.
Live payments also require the merchant’s account to accept live payments. See Know when payments are enabled.

Create the session on your server

Pass the merchant with the server SDK’s account option, or send it as the Ionic-Account header. The session and the payment it creates belong to that merchant.
The idempotency key’s scope includes the receiving merchant and mode. Store the merchant ID with your order and the returned session id. Line items can be inline amounts, as above, or the merchant’s catalog prices by price_id. The merchant creates its products and prices. Your platform can list them with Ionic-Account and products:read.

Redirect the buyer

Return the session’s url to your frontend and redirect the buyer to it. The buyer completes the payment on the Ionic-hosted page and returns to your success_url.

Confirm the payment

Retrieve the session for the same merchant to confirm the result. The redirect only updates the buyer’s screen.
Fulfill when the session is both complete and paid.

Fulfill from platform webhooks

A platform webhook endpoint receives checkout.session.completed for a connected account when that account’s connection grants sessions:read. The event’s account field names the merchant. Match it, the session ID, and the mode to the order your application stored before fulfilling. See Webhooks for platforms.

Keep checkout data with the correct merchant

Availability

Embedded checkout renders only on websites in the merchant’s own Web domains list, so a platform’s own website takes payments with hosted checkout or Ionic Blocks. Your platform can list and retrieve a connected account’s payment links; the connected account creates and edits them with its own keys.

What’s next

Refund and capture

Refund, capture, or cancel a connected account’s payment from your platform.

Handle webhooks

Receive every connected account’s events on one endpoint and match each to its connected account.