Before you begin
- Platform test keys from Connect → API keys, with the secret key on your server.
- An active connection granting
sessions:writeandsessions:read, with those permissions also on the platform key. - The connected account’s ID (
mer_…), selected by your application’s authorization logic. @ionicfi/sdk0.4.1 or later for the TypeScript examples, installed from npm.
Create the session on your server
Pass the merchant with the server SDK’saccount option, or send it as the
Ionic-Account header. The session and the payment it creates belong to that
merchant.
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’surl 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.complete and paid.
Fulfill from platform webhooks
A platform webhook endpoint receivescheckout.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.
- Accept a payment with Hosted Checkout: every session field and option.
- Create a checkout session: the full request and response contract.

