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

# Fiat Ramps

> Let users buy and sell crypto directly in your React Native or Expo app using hosted provider widgets, iOS Coinbase Apple Pay, Brale ACH bank transfers, and headless card or iOS Apple Pay checkouts.

Your app can offer fiat on-ramps and off-ramps directly inside your own React Native or Expo UI without routing users to an external website. `@getpara/react-native-wallet` provides hooks and helpers for hosted provider checkouts, headless iOS Coinbase Apple Pay orders, headless Brale ACH bank transfers, and routed headless card and iOS Apple Pay checkouts.

> [!NOTE]
>
> Providers, enabled networks, allowed assets, Apple Pay domains, and Brale Plaid mobile OAuth settings are configured per API key in the **Developer Portal**. Set those up first in [Set Up Fiat Onramps](https://docs.getpara.com/v3/react-native/setup/developer-portal-payments.md).

## Discover Providers and Assets

Read your key's configuration and available catalog assets before rendering buy or sell controls. `useOnRampConfig` returns feature flags, your default asset, and any inline Apple Pay providers enabled for your device, while `useOnRampCatalog` pages through supported asset implementations and their providers.

```tsx RampCatalog.tsx theme={null}
import { useOnRampCatalog, useOnRampConfig } from "@getpara/react-native-wallet";

function useRampCatalog() {
  const { data: config } = useOnRampConfig({ walletTypes: ["EVM", "SOLANA"] });
  const { data: catalogPages } = useOnRampCatalog("", 50);

  const items = catalogPages?.pages.flatMap((page) => page.items) ?? [];
  const defaultAsset = config?.defaultOnRampAssetImplementation;

  return { config, defaultAsset, items };
}
```

> [!NOTE]
>
> `ParaMobile` detects `Platform.OS` automatically when constructed. On Android devices, `CDP` (Coinbase Apple Pay) is omitted from `config.inlineApplePayProviders` and `catalog` results because Coinbase Apple Pay is iOS-only.

## Hosted Checkout (Buy and Off-Ramp)

Hosted checkout supports card and bank purchases across Stripe, MoonPay, Ramp Network, Coinbase (Widget), Transak, and Banxa, as well as off-ramp sales (`SELL`) for providers that support withdrawals. Your app creates an order with `client.createHostedOnRampOrder`, opens the returned `portalUrl`, and inspects the callback URL or flat `getOnRampOrder` response when the user returns.

### Option 1: System Auth Session (Expo / ASWebAuthenticationSession)

Use Expo's `WebBrowser.openAuthSessionAsync` with a deep link created via `Linking.createURL` to open the Para Portal in an authentication browser session that returns directly to your app.

> [tab] Buy (On-Ramp)
>
> Create a `BUY` order with `createHostedOnRampOrder`, open `portalUrl`, and parse the returned callback status with `parseOnRampCallbackUrl`.
>
> ```tsx HostedBuyButton.tsx theme={null}
> import * as Linking from "expo-linking";
> import * as WebBrowser from "expo-web-browser";
> import {
>   OnRampPurchaseType,
>   parseOnRampCallbackUrl,
>   useClient,
>   useOnRampCatalog,
>   useOnRampOrder,
>   useWallet,
>   type OnRampPurchase,
> } from "@getpara/react-native-wallet";
> import { useState } from "react";
> import { Button } from "react-native";
>
> export function HostedBuyButton() {
>   const client = useClient();
>   const { data: wallet } = useWallet();
>   const { data: catalogPages } = useOnRampCatalog("", 25);
>   const [purchaseId, setPurchaseId] = useState<string>();
>   const { refetch } = useOnRampOrder({ purchaseId, walletId: wallet?.id, enabled: Boolean(purchaseId) });
>
>   const buyAsset = async () => {
>     const asset = catalogPages?.pages[0]?.items.find((item) =>
>       item.providers.some((p) => p.isBuy && p.provider !== "CDP" && p.provider !== "BRALE")
>     );
>     const provider = asset?.providers.find(
>       (p) => p.isBuy && p.provider !== "CDP" && p.provider !== "BRALE"
>     )?.provider;
>     if (!client || !wallet?.id || !asset || !provider) return;
>
>     const nativeCallbackUrl = Linking.createURL("onramp");
>     const { onRampPurchase, portalUrl } = await client.createHostedOnRampOrder({
>       walletId: wallet.id,
>       nativeCallbackUrl,
>       params: {
>         type: OnRampPurchaseType.BUY,
>         provider: provider as OnRampPurchase["provider"],
>         walletType: asset.walletType,
>         assetImplementationId: asset.assetImplementationId,
>         fiatQuantity: "25",
>       },
>     });
>
>     setPurchaseId(onRampPurchase.id);
>     const result = await WebBrowser.openAuthSessionAsync(portalUrl, nativeCallbackUrl);
>
>     if (result.type === "success" && result.url) {
>       parseOnRampCallbackUrl(result.url);
>       await refetch();
>     }
>   };
>
>   return <Button title="Buy Crypto" onPress={buyAsset} />;
> }
> ```

> [tab] Sell (Off-Ramp)
>
> Create a `SELL` order for a provider where `p.isSell` is true. When the callback reports `status === "deposit_required"`, fetch `pendingDeposit` via `useOnRampOrder` and broadcast the deposit with `client.sendOffRampDeposit`.
>
> ```tsx HostedSellButton.tsx theme={null}
> import * as Linking from "expo-linking";
> import * as WebBrowser from "expo-web-browser";
> import {
>   OnRampPurchaseType,
>   parseOnRampCallbackUrl,
>   useClient,
>   useOnRampCatalog,
>   useOnRampOrder,
>   useWallet,
>   type OnRampPurchase,
> } from "@getpara/react-native-wallet";
> import { useState } from "react";
> import { Button } from "react-native";
>
> export function HostedSellButton() {
>   const client = useClient();
>   const { data: wallet } = useWallet();
>   const { data: catalogPages } = useOnRampCatalog("", 25);
>   const [purchaseId, setPurchaseId] = useState<string>();
>   const { refetch } = useOnRampOrder({ purchaseId, walletId: wallet?.id, enabled: Boolean(purchaseId) });
>
>   const sellAsset = async () => {
>     const asset = catalogPages?.pages[0]?.items.find((item) =>
>       item.providers.some((p) => p.isSell && p.provider !== "CDP" && p.provider !== "BRALE")
>     );
>     const provider = asset?.providers.find(
>       (p) => p.isSell && p.provider !== "CDP" && p.provider !== "BRALE"
>     )?.provider;
>     if (!client || !wallet?.id || !asset || !provider) return;
>
>     const nativeCallbackUrl = Linking.createURL("onramp");
>     const { onRampPurchase, portalUrl } = await client.createHostedOnRampOrder({
>       walletId: wallet.id,
>       nativeCallbackUrl,
>       params: {
>         type: OnRampPurchaseType.SELL,
>         provider: provider as OnRampPurchase["provider"],
>         walletType: asset.walletType,
>         assetImplementationId: asset.assetImplementationId,
>         fiatQuantity: "25",
>       },
>     });
>
>     setPurchaseId(onRampPurchase.id);
>     const result = await WebBrowser.openAuthSessionAsync(portalUrl, nativeCallbackUrl);
>
>     if (result.type === "success" && result.url) {
>       const callback = parseOnRampCallbackUrl(result.url);
>       const updated = await refetch();
>       const pendingDeposit = updated.data?.pendingDeposit;
>
>       if (callback?.status === "deposit_required" && pendingDeposit && updated.data) {
>         await client.sendOffRampDeposit({
>           onRampPurchase: updated.data,
>           depositRequest: {
>             destinationAddress: pendingDeposit.destinationAddress,
>             assetQuantity: String(pendingDeposit.assetQuantity),
>             chainId: pendingDeposit.chainId,
>             contractAddress: pendingDeposit.contractAddress,
>             providerOrderId: pendingDeposit.providerOrderId,
>           },
>         });
>       }
>     }
>   };
>
>   return <Button title="Sell Crypto" onPress={sellAsset} />;
> }
> ```

### Option 2: In-App WebView Bridge

If you embed the Para Portal inside `react-native-webview` instead of a system browser session, wire `createOnRampWebViewBridge` to forward portal signing and deposit messages to `ParaMobile`.

```tsx PortalWebView.tsx theme={null}
import { useRef, useState } from "react";
import { WebView } from "react-native-webview";
import {
  createOnRampWebViewBridge,
  isOnRampCallbackUrl,
  parseOnRampCallbackUrl,
  useClient,
  type OnRampPurchase,
} from "@getpara/react-native-wallet";

export function PortalWebView({ portalUrl, callbackUrl, initialPurchase }: {
  portalUrl: string;
  callbackUrl: string;
  initialPurchase: OnRampPurchase;
}) {
  const client = useClient();
  const webViewRef = useRef<WebView>(null);
  const [purchase, setPurchase] = useState(initialPurchase);

  if (!client) return null;

  const bridge = createOnRampWebViewBridge({
    para: client,
    getPurchase: () => purchase,
    setPurchase,
    injectJavaScript: (script) => webViewRef.current?.injectJavaScript(script),
    onDepositRequest: async ({ depositRequest }) => {
      await client.sendOffRampDeposit({ onRampPurchase: purchase, depositRequest });
    },
  });

  return (
    <WebView
      ref={webViewRef}
      source={{ uri: portalUrl }}
      onMessage={(event) => bridge.handleMessage(event.nativeEvent.data, event.nativeEvent.url)}
      onShouldStartLoadWithRequest={(request) => {
        if (!isOnRampCallbackUrl(request.url, callbackUrl)) return true;
        parseOnRampCallbackUrl(request.url);
        return false;
      }}
    />
  );
}
```

> [!NOTE]
>
> When `type` is `OnRampPurchaseType.SELL`, the provider supplies crypto deposit instructions after the user confirms the sale in the portal. Call `client.sendOffRampDeposit` when the callback reports `status === "deposit_required"` (or in `onDepositRequest` when using `createOnRampWebViewBridge`) to broadcast the deposit transaction from the user's Para wallet.

## Coinbase Apple Pay (Headless, iOS Only)

Coinbase headless guest checkout renders an Apple Pay payment sheet inside an iOS WebView on your verified Apple Pay merchant domain.

> [!WARNING]
>
> Coinbase headless Apple Pay is available on **iOS only** and requires a registered Apple Pay domain in both Coinbase Developer Platform and the Developer Portal (see [Coinbase setup](https://docs.getpara.com/v3/react-native/setup/developer-portal-payments.md#coinbase-apple-pay--hosted-widget)), plus a verified U.S. phone number and email on the user's account. Android devices cannot create Coinbase Apple Pay orders.

### Method Sequence

1. Optionally call `client.checkCoinbaseOnrampLimits({ phoneNumber })` and `client.createCoinbaseOnrampLimitUpgrade({ phoneNumber })` to obtain and open `upgradeUrl` when `limits.upgradeable` is true.
2. Call `client.createCoinbaseOnrampOrder` with `isQuote: true` to preview fees, then with `isQuote: false` (or omitted) to create the order and obtain `paymentLink.url` and `purchaseId`.
3. Render `paymentLink.url` in an iOS `WebView`, listening for `onramp_api.polling_success` or `onramp_api.commit_success` messages with `parseCoinbaseApplePayEvent`.
4. Call `client.settleCoinbaseOnrampPurchase({ purchaseId, walletId })` when payment completes to confirm settlement status.

```tsx CoinbaseApplePayButton.tsx theme={null}
import { useState } from "react";
import * as Linking from "expo-linking";
import { Button } from "react-native";
import { WebView, type WebViewMessageEvent } from "react-native-webview";
import { parseCoinbaseApplePayEvent, useClient, useWallet } from "@getpara/react-native-wallet";

const COINBASE_MESSAGE_BRIDGE = `
  (function () {
    window.addEventListener("message", function (event) {
      if (window.ReactNativeWebView) {
        window.ReactNativeWebView.postMessage(
          typeof event.data === "string" ? event.data : JSON.stringify(event.data)
        );
      }
    });
  })();
  true;
`;

export function CoinbaseApplePayButton({
  assetImplementationId,
  userPhoneNumber,
  userEmail,
}: {
  assetImplementationId: string;
  userPhoneNumber: string;
  userEmail: string;
}) {
  const client = useClient();
  const { data: wallet } = useWallet();
  const [paymentUrl, setPaymentUrl] = useState<string>();
  const [purchaseId, setPurchaseId] = useState<string>();

  const startApplePay = async () => {
    if (!client || !wallet?.id) return;

    const limits = await client.checkCoinbaseOnrampLimits({ phoneNumber: userPhoneNumber });
    if (limits.upgradeable) {
      const { upgradeUrl } = await client.createCoinbaseOnrampLimitUpgrade({ phoneNumber: userPhoneNumber });
      if (upgradeUrl) {
        await Linking.openURL(upgradeUrl);
        return;
      }
    }

    const order = await client.createCoinbaseOnrampOrder({
      walletId: wallet.id,
      assetImplementationId,
      paymentAmount: "25.00",
      phoneNumber: userPhoneNumber,
      email: userEmail,
    });

    setPurchaseId(order.purchaseId);
    setPaymentUrl(order.paymentLink?.url);
  };

  const handleWebViewMessage = async (event: WebViewMessageEvent) => {
    const parsed = parseCoinbaseApplePayEvent(event.nativeEvent.data, {
      origin: event.nativeEvent.url ? new URL(event.nativeEvent.url).origin : undefined,
      allowedOrigins: paymentUrl ? [paymentUrl] : undefined,
    });
    if (!parsed || !client || !wallet?.id || !purchaseId) return;

    if (parsed.eventName === "onramp_api.polling_success" || parsed.eventName === "onramp_api.commit_success") {
      await client.settleCoinbaseOnrampPurchase({ purchaseId, walletId: wallet.id });
      setPaymentUrl(undefined);
    } else if (parsed.eventName === "onramp_api.cancel") {
      setPaymentUrl(undefined);
    }
  };

  if (paymentUrl) {
    return (
      <WebView
        source={{ uri: paymentUrl }}
        injectedJavaScriptBeforeContentLoaded={COINBASE_MESSAGE_BRIDGE}
        onMessage={handleWebViewMessage}
      />
    );
  }

  return <Button title="Buy with Apple Pay" onPress={startApplePay} />;
}
```

> [!NOTE]
>
> `userPhoneNumber` and `userEmail` are placeholders for the signed-in buyer's verified contact details. In production, the server validates both against the user's verified Para records.

### Order States and Partner Events

* **Order states**: Real orders start as `INITIATED` and transition to `FINISHED` on settlement or `CANCELLED` if abandoned or failed. Quotes (`isQuote: true`) do not create an order record or emit partner events.
* **Partner events**: `ONRAMP_LAUNCHED` fires when `createCoinbaseOnrampOrder` creates a real order. `ONRAMP_TRANSACTION_COMPLETE_V2` and the `onramp.completed` server webhook fire when `settleCoinbaseOnrampPurchase` or background reconciliation records `FINISHED`.

> [!NOTE]
>
> Because mobile apps do not send a browser `Origin` header, Para selects the first allowlisted Apple Pay domain configured on your API key in the Developer Portal unless you pass `domain` explicitly. On non-production API keys, Coinbase Apple Pay orders run in sandbox mode (`?useApplePaySandbox=true`) and simulate immediate settlement.

## Brale ACH (Pay by Bank, Headless)

Brale ACH lets users buy USDC with a U.S. bank account using `react-native-plaid-link-sdk` (`^12.8.9`) and Para's `useBraleAchCheckout` hook (or the underlying `ParaMobile` methods).

> [!WARNING]
>
> Production Brale ACH requires the Growth plan or higher, ACH enabled in the Developer Portal, and a user signed in with Para biometrics (guest and external-wallet-only logins are rejected). When bundling with Metro, you **must** pass `plaidSdk: { create, open }` imported from `react-native-plaid-link-sdk` to `openBralePlaidLink`, because Metro cannot resolve dynamic `require` calls. Forward `usePlaidEmitter` events to the `onEvent` handler returned by `openBralePlaidLink` so identity-mismatch exits are detected accurately.

### Method Sequence

1. Call `useBraleAchCheckout` (which wraps `client.createBraleAchCheckout`, `client.linkBraleAchBank`, `client.submitBraleAchDeposit`, and `client.getBraleAchCheckout`).
2. Call `ach.start()`. `start()` derives `authorizationText` and calls `createBraleAchCheckout(...)`. If the user has a saved bank (and `linkNewBank` is not `true`), `ach.step` moves to `"REVIEW"`; when `linkNewBank: true` or `nextAction === "launch_plaid"`, it skips `"REVIEW"` and transitions straight to `"LINKING"` with `ach.plaidLinkToken` set.
3. On `"REVIEW"`, collect `ach.legalName` when `ach.reviewMode === "FIRST_PURCHASE"`, display `ach.authorizationText`, and call `ach.confirm()` to submit the debit (or, when `linkNewBank: true` is passed to `confirm()`, create a new link checkout and move to `"LINKING"`).
4. When `ach.plaidLinkToken` is set, open native Plaid Link with `openBralePlaidLink`, passing `plaidSdk: { create, open }`, and forward `usePlaidEmitter` events to the returned `onEvent` handler so `completeBankLink` automatically submits the debit.
5. Inspect transfer progress with `client.getBraleAchCheckout({ checkoutId })` or `client.listBraleAchTransfers()`.

```tsx BraleAchScreen.tsx theme={null}
import { useEffect, useRef } from "react";
import { Button, Platform, Text, TextInput, View } from "react-native";
import { create, open, usePlaidEmitter } from "react-native-plaid-link-sdk";
import {
  openBralePlaidLink,
  useBraleAchCheckout,
  useWallet,
  type PlaidLinkEvent,
} from "@getpara/react-native-wallet";

export function BraleAchScreen() {
  const { data: wallet } = useWallet();
  const onPlaidEventRef = useRef<((event: PlaidLinkEvent) => void) | null>(null);
  const platform = Platform.OS === "ios" || Platform.OS === "android" ? Platform.OS : undefined;
  const ach = useBraleAchCheckout({
    walletId: wallet?.id,
    amountUsd: "25.00",
    platform,
    ...(platform === "ios" ? { redirectUri: "https://app.example.com/plaid-oauth" } : {}),
    ...(platform === "android" ? { androidPackageName: "com.example.app" } : {}),
  });

  usePlaidEmitter((event) => {
    onPlaidEventRef.current?.(event);
  });

  useEffect(() => {
    if (!ach.plaidLinkToken) return;
    onPlaidEventRef.current = openBralePlaidLink({
      plaidLinkToken: ach.plaidLinkToken,
      completeBankLink: ach.completeBankLink,
      exitBankLink: ach.exitBankLink,
      plaidSdk: { create, open },
    });
    return () => {
      onPlaidEventRef.current = null;
    };
  }, [ach.plaidLinkToken, ach.completeBankLink, ach.exitBankLink]);

  return (
    <View>
      {ach.step === "REVIEW" ? (
        <View>
          {ach.reviewMode === "FIRST_PURCHASE" && (
            <TextInput value={ach.legalName} onChangeText={ach.setLegalName} placeholder="Legal Name" />
          )}
          <Text>{ach.authorizationText}</Text>
          <Button title="Confirm Bank Debit" onPress={ach.confirm} />
        </View>
      ) : (
        <Button title="Buy USDC with Bank" onPress={ach.start} />
      )}
    </View>
  );
}
```

### Order States and Partner Events

* **Checkout stages and `nextAction`**: A checkout moves through `stage: "link_required"` (`nextAction: "launch_plaid"`), `stage: "linked"` (`nextAction: "confirm_deposit"`), and `stage: "submitted"` (`nextAction: "wait"`). The `useBraleAchCheckout` hook exposes UI steps: `"IDLE"`, `"STARTING"`, `"REVIEW"`, `"LINKING"`, `"SUBMITTING"`, `"SUBMITTED"`, and `"FAILURE"`.
* **Brale transfer and order states**: `braleStatus` tracks Brale's settlement (`"pending"`, `"compliance review"`, `"processing"`, `"complete"`, `"canceled"`, `"failed"`, `"refunding"`, `"refunded"`). Transfers in `"compliance review"` keep the checkout (`stage: "submitted"`, `nextAction: "wait"`) and underlying order (`INITIATED`) open until settled `FINISHED` or failed `CANCELLED`.
* **Partner events**: `ONRAMP_LAUNCHED` fires when `submitBraleAchDeposit` submits the debit. Because ACH transfers take 1 to 3 business days to clear, `ONRAMP_TRANSACTION_COMPLETE_V2` does not fire when the bank settles.

> [!WARNING]
>
> Subscribe to both [`onramp.completed` and `onramp.cancelled`](https://docs.getpara.com/v3/general/webhooks#event-types) webhooks on your backend for Brale ACH transfers. If a bank returns an ACH debit after initial delivery, Brale reverses the transfer and Para sends `onramp.cancelled` after `onramp.completed`.

> [!NOTE]
>
> For iOS and Android bank OAuth redirects inside Plaid Link, enter your **iOS Plaid OAuth redirect URI** (`https://...` Universal Link) and **Android package name** (for example `com.example.app`) in the **ACH** section of the Developer Portal (saving either notifies Para for Brale allowlisting), or pass `redirectUri` / `androidPackageName` per checkout to override them. Until allowlisted by Brale, Para leaves those values out of the Plaid link token and OAuth banks can't finish linking.

## Headless Card, Apple Pay & Reusable KYC

Use `useHeadlessOnRampCheckout` together with the optional `@getpara/react-native-wallet/ramps/meld` subpath (powered by `@meldcrypto/react-native-sdk`) to present routed card or iOS Apple Pay payments inline inside your app without bundling Meld unless you import `/ramps/meld`. Headless card and Apple Pay orders are currently fulfilled through `BANXA`; headless Meld Apple Pay is iOS-only and requires a registered Apple Pay domain. Installing `@meldcrypto/react-native-sdk` (an optional peer dependency) requires a native iOS/Android rebuild via EAS Build or `expo prebuild` and is not included in Expo Go. Reusable KYC (`getKycStatus`, `createKycSession`, `shareKyc`) lets users verify once and share credentials across Banxa and Transak.

> [!NOTE]
>
> Google Pay is in the works for routed headless checkout. [Talk to us](mailto:support@getpara.com?subject=Google%20Pay%20Fiat%20Ramps%20Request) if you need Google Pay support.

### Method Sequence

1. Call `useHeadlessOnRampCheckout` and trigger `checkout.start()`, which fetches a quote (`getHeadlessOnRampQuote`) and prerequisites (`getHeadlessOnRampRequirements`).
2. If `checkout.step === "VERIFICATION_REQUIRED"`, run your Sumsub KYC flow (`getKycStatus`, `createKycSession`, or `shareKyc`) and call `checkout.start()` again.
3. On `checkout.step === "REVIEW"`, display quote fees and any required agreements, then call `checkout.confirm()` to record agreement acceptance (`acceptHeadlessOnRampAgreements`) and create the order (`createHeadlessOnRampOrder`).
4. When `checkout.step === "PAYMENT"` and `checkout.order` is set, mount `HeadlessOnRampPaymentView` and forward `onPaymentSubmitted`, `onCancel`, and `onError` to `checkout`.

```tsx HeadlessCheckout.tsx theme={null}
import {
  OnRampProvider,
  useHeadlessOnRampCheckout,
  useWallet,
} from "@getpara/react-native-wallet";
import { HeadlessOnRampPaymentView } from "@getpara/react-native-wallet/ramps/meld";
import { Button, Text, View } from "react-native";

export function HeadlessCardCheckout({ assetImplementationId }: { assetImplementationId: string }) {
  const { data: wallet } = useWallet();
  const checkout = useHeadlessOnRampCheckout({
    walletId: wallet?.id,
    assetImplementationId,
    amountUsd: "50.00",
    provider: OnRampProvider.BANXA,
    paymentMethod: "CARD",
  });

  if (checkout.step === "VERIFICATION_REQUIRED") {
    // Check KYC via client.getKycStatus(), createKycSession() / shareKyc(), then checkout.start().
  }

  return (
    <View>
      {checkout.step === "IDLE" && <Button title="Quote" onPress={checkout.start} />}
      {checkout.step === "REVIEW" && <Button title="Pay" onPress={checkout.confirm} />}
      {checkout.step === "PAYMENT" && checkout.order && (
        <HeadlessOnRampPaymentView
          order={checkout.order.order}
          environment={checkout.environment}
          style={{ minHeight: 420, width: "100%" }}
          onPaymentSubmitted={() => checkout.onPaymentSubmitted()}
          onCancel={() => checkout.onPaymentCancelled()}
          onError={(code, opts) => checkout.onPaymentError(code, opts)}
        />
      )}
      {checkout.step === "SUCCESS" && <Text>Purchase completed</Text>}
      {checkout.step === "FAILURE" && <Text>{checkout.error}</Text>}
    </View>
  );
}
```

### Order States and Partner Events

* **Order states**: Orders start as `INITIATED` and transition to `FINISHED` on settlement or `CANCELLED` if failed or abandoned. `useHeadlessOnRampCheckout` polls `getOnRampOrder` after submission until a terminal state.
* **Partner events**: Unlike hosted, Coinbase Apple Pay, and Brale ACH flows, `createHeadlessOnRampOrder` does not emit `ONRAMP_LAUNCHED` or `ONRAMP_TRANSACTION_COMPLETE_V2` client events. Subscribe to the server [`onramp.completed` and `onramp.cancelled`](https://docs.getpara.com/v3/general/webhooks#event-types) webhooks for authoritative fulfillment updates.

## Listen for SDK Events and Test Mode

Subscribe to Para's client events via `onParaEvent` to react in your app UI as orders launch and settle. Both `ONRAMP_LAUNCHED` and `ONRAMP_TRANSACTION_COMPLETE_V2` deliver the `OnRampEventData` payload matching the `onramp.completed` webhook schema (`transactionHash` and `completedAt` are `null` at launch).

```tsx RampEvents.tsx theme={null}
import { useEffect } from "react";
import { onParaEvent, ParaEvent } from "@getpara/react-native-wallet";

export function useRampEvents() {
  useEffect(() => {
    const stopLaunch = onParaEvent(ParaEvent.ONRAMP_LAUNCHED, (event) => {
      console.log("Order launched:", event.detail.data.purchaseId);
    });
    const stopComplete = onParaEvent(ParaEvent.ONRAMP_TRANSACTION_COMPLETE_V2, (event) => {
      console.log("Order completed:", event.detail.data.transactionHash);
    });
    return () => {
      stopLaunch();
      stopComplete();
    };
  }, []);
}
```

> [!NOTE]
>
> Test mode is determined by your API key's environment (Beta keys run in test mode; production keys reject `testMode: true`). In test mode, Brale ACH orders deliver `SBC` on Sepolia, Base Sepolia, Avalanche Fuji, or Solana Devnet (Optimism has no ACH test network), and Coinbase Apple Pay orders simulate settlement immediately.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.