> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rhinestone.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Create an exchange connection

> Create a Swapped Connect flow for funding from a centralized exchange balance.

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](/deposits/headless/setup/account-registration). Minting a Connect URL for an account that is not registered to your project returns `403 Unauthorized`.
* A [webhook URL](/deposits/headless/processing-and-tracking/webhooks#configure-webhooks) 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.

```ts theme={null}
const DEPOSIT_SERVICE_URL =
  "https://v1.orchestrator.rhinestone.dev/deposit-processor";
const API_KEY = "YOUR_RHINESTONE_API_KEY";
```

## 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](/deposits/headless/funding/create-an-onramp-checkout#mint-a-checkout-url):

```ts theme={null}
const response = await fetch(`${DEPOSIT_SERVICE_URL}/onramp/swapped/connect-url`, {
    method: "POST",
    headers: { "Content-Type": "application/json", "x-api-key": API_KEY },
    body: JSON.stringify({
        smartAccount: "0xUSER_ACCOUNT_ADDRESS",
        connection: "binance",
    }),
});
```

List the supported exchanges with [`GET /onramp/swapped/connect-exchanges`](/api-reference/deposit-service/onramp/list-supported-exchanges-and-wallets); full schema at [`POST /onramp/swapped/connect-url`](/api-reference/deposit-service/onramp/create-an-exchange-funding-url).

## Show the hosted connection flow

Embed the returned URL in an iframe with the permissions needed by the provider:

```html theme={null}
<iframe src={url} allow="payment; camera; microphone; clipboard-write" />
```

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`](/deposits/headless/processing-and-tracking/webhooks#onramp-order) webhook or by [polling order status](/deposits/headless/processing-and-tracking/track-onramp-and-exchange-orders#poll-the-latest-order), then dismiss the provider UI from your own interface.

<Warning>
  A user who abandons the connection flow produces no terminal event. Apply your own timeout when waiting on an order.
</Warning>
