Skip to main content
Create a signed Swapped Connect URL for a registered account, then show Swapped’s hosted UI in your app. Headless means you do not use the Rhinestone widget; users still complete the provider flow in Swapped’s UI.

How it works

  1. Your backend requests a signed Connect URL for the user’s account.
  2. Your app shows the URL in an iframe or in-app browser.
  3. The user chooses an exchange and completes the transfer in Swapped’s hosted flow.
  4. Swapped sends provider-order updates as the transfer progresses.
  5. The funded crypto lands on the account and enters the standard deposit pipeline.

Prerequisites

  • The account is registered. Minting a Connect 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 Connect URL

To let users transfer from a centralized exchange balance (Binance, Coinbase, and others) instead of paying with fiat, mint a Connect URL. The request takes a subset of the widget fields — smartAccount plus optional baseCountry, baseCurrencyCode, locale, and a connection preselecting the exchange. There’s no amount or payment-method prefill; the user chooses those inside the exchange flow. The response shape matches the onramp checkout response:
List the supported exchanges with GET /onramp/swapped/connect-exchanges; full schema at POST /onramp/swapped/connect-url.

Show the hosted connection flow

Embed the returned URL in an iframe with the permissions needed by the provider:
In a mobile app, open the URL in an in-app browser (SFSafariViewController on iOS, Chrome Custom Tabs on Android) rather than a plain WebView. Camera access and provider authentication can be restricted in bare WebViews. The URL has no redirect or callback parameter. Detect completion through the onramp-order webhook or by polling order status, then dismiss the provider UI from your own interface.
A user who abandons the connection flow produces no terminal event. Apply your own timeout when waiting on an order.