How it works
- Your backend requests a signed checkout URL for the user’s account.
- Your app shows the URL in an iframe or in-app browser.
- The user completes payment and any required KYC with Swapped.
- Swapped sends provider-order updates as the payment progresses.
- Swapped sends the purchased crypto, currently USDC on Base, to the account; the standard deposit pipeline then routes it to the account’s target.
Prerequisites
- The account is registered. Minting a checkout URL for an account that is not registered to your project returns
403 Unauthorized. - A webhook URL is configured if you want order updates pushed rather than polled.
- Calls are made from your backend. The endpoints require your API key, which never ships in client-side code.
Mint a checkout URL
smartAccount is required — every other field, including method, is optional and simply prefills the widget. If you omit method, Swapped auto-selects the best payment method for the user based on their location and other signals:
method takes a Swapped payment group. Swapped offers 40+ methods and the set available depends on the user’s region — common values include "creditcard", "apple-pay", "bank-transfer", "skrill", "pix", and "sepa-bank-transfer". Pass a method’s payment_group; the authoritative, up-to-date list for your account is Swapped’s Get Payment Methods endpoint. A value Swapped doesn’t support for the user is ignored rather than rejected — the widget falls back to the best available method, so an unrecognized method never blocks checkout.
The response carries the signed URL:
The URL is signed by the service, so its parameters — destination wallet and asset — can’t be modified client-side. Mint a fresh URL for each checkout session. The purchase always settles in the asset reported by
currencyCode; when the account’s target differs, the bridge hop happens automatically.
Full request and response schemas: POST /onramp/swapped/widget-url.
Show the hosted checkout
Embed the URL in an iframe with payment and camera permissions — Apple Pay and camera-based KYC need them:SFSafariViewController on iOS, Chrome Custom Tabs on Android) rather than a plain WebView — Apple Pay and camera access are restricted in bare WebViews.
The URL carries no redirect or callback parameter. Detect completion through the onramp-order webhook or by polling order status, then dismiss the hosted checkout from your own UI.
KYC, identity verification, and purchase limits are handled by Swapped inside the hosted UI. Track provider progress and final deposit settlement separately in Track onramp and exchange orders.