How it works
- Your backend starts an order with
POST /onramp/ordersand receives a hosted checkout. - Your app shows the checkout in an iframe or in-app browser.
- The user completes payment and any required KYC with Swapped.
- The order advances through its stages, pushed as
ramp-orderwebhooks. - 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. Starting an order 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.
Start an order
provider, kind, and account are required. Every other field is optional and prefills the checkout:
method takes a Swapped payment group, such as "creditcard", "apple-pay", "bank-transfer", "pix", or "google-pay"; the set depends on the user’s region. A value Swapped doesn’t support for the user is ignored rather than rejected, so an unrecognized method never blocks checkout. The one exception is a personalized method the user’s country doesn’t offer, which returns 400.
An unknown field returns 400, so a typo can’t be silently ignored.
The response is 202 Accepted:
The URL is signed by the service, so its parameters, such as the destination wallet and asset, can’t be modified client-side. Start a fresh order for each checkout session. An order becomes visible to
GET /onramp/orders/{id} once Swapped first reports it, which happens when the user starts paying.
Full request and response schemas: POST /onramp/orders.
List payment methods
To render your own method picker, list what the user’s country offers:methods is the short list the deposit widget shows as its own rows: the country’s Popular pick, then card, bank transfer and Apple Pay where available. otherMethods holds every other method Swapped offers in the country (for example Google Pay, Skrill or Neteller), in Swapped’s order. Show both to give users every option. Each method carries:
Convert
minAmount / maxAmount from EUR if you show limits in another currency; Swapped’s widget enforces the exact limits at checkout.
country is null when the country or Swapped’s catalog is unknown; fall back to your own defaults. Pass a chosen method back as method with methodSelectionSource: "personalized". Full schema: GET /onramp/options.
Show the hosted checkout
EmbednextAction.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 ramp-order webhook or by polling the order, then dismiss the hosted checkout from your own UI.
KYC, identity verification, and purchase limits are handled by Swapped inside the hosted UI.
Migrate from the deprecated route
POST /onramp/swapped/widget-url is deprecated. It keeps working unchanged until its retirement is announced, but new integrations should use POST /onramp/orders. The mapping:
Every other request field and every error response is the same.