> ## 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.

# Track onramp and exchange orders

> Track Swapped provider orders and distinguish provider completion from final deposit settlement.

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

Fiat checkouts and exchange connections share the same normalized provider-order lifecycle. A completed provider order means Swapped sent crypto on-chain; it does not necessarily mean the deposit reached the account's final target.

## Order lifecycle

Orders move through a normalized lifecycle:

| Status       | Meaning                                | Terminal |
| ------------ | -------------------------------------- | -------- |
| `pending`    | Order created; awaiting payment or KYC | no       |
| `processing` | Payment captured; crypto not yet sent  | no       |
| `completed`  | Crypto sent on-chain                   | yes      |
| `failed`     | Order cancelled or declined            | yes      |

Each transition fires an [`onramp-order`](/deposits/headless/processing-and-tracking/webhooks#onramp-order) webhook carrying the normalized `status`, Swapped's `rawStatus`, the fiat receipt, and — once completed — the on-chain `transactionId`.

## Poll the latest order

You can also poll the account's latest order:

```ts theme={null}
const response = await fetch(
    `${DEPOSIT_SERVICE_URL}/onramp/swapped/status/0xUSER_ACCOUNT_ADDRESS`,
    { headers: { "x-api-key": API_KEY } },
);
const order = await response.json();
// {
//     ok: true,
//     orderId: "…",
//     status: "order_broadcasted",
//     orderCrypto: "USDC",
//     orderCryptoAmount: "98.61",
//     transactionId: "0xdef456…",
//     paidAmountUsd: 101.75,
//     onrampFeeUsd: 1.75,
//     paymentMethod: "creditcard",
//     receivedAt: "2025-01-15T12:03:00.000Z"
// }
```

Polling reflects the account's most recent order and returns `{ ok: false, reason: "no_order" }` before the first order update arrives. Full schema: [`GET /onramp/swapped/status/{smartAccount}`](/api-reference/deposit-service/onramp/get-funding-status).

Once the order completes, either funding method hands off to the regular pipeline: `transactionId` reappears as the `transactionHash` on the [`deposit-received`](/deposits/headless/processing-and-tracking/webhooks#deposit-received) event, followed by the usual bridge events. Card and Apple Pay orders typically complete within minutes; bank transfers can take days. Exchange timing depends on the provider flow. Orders stay trackable for 7 days.

## Processing caveats

* **Session coverage** — on-ramp purchases land on Base, so the account's session set must include Base. The default [registration flow](/deposits/headless/setup/account-registration) covers every supported chain; if you restrict `sessionChainIds`, include Base or landed funds can't be bridged.
* **Deposit whitelist** — if you [restrict accepted deposits](/deposits/headless/setup/project-configuration#restrict-accepted-deposits), allow USDC on Base above your minimum. Otherwise every on-ramp purchase is rejected with [`deposit-rejected`](/deposits/headless/processing-and-tracking/webhooks#deposit-rejected).
* **Same-chain target** — when the account's target is USDC on Base paid to the account itself, the purchase is already at its destination: no bridge events fire, and `onramp-order` with `status: "completed"` is your terminal signal.
* **KYC and limits** — identity verification and purchase limits are handled by Swapped inside the hosted UI.
