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

# Treasury Withdrawals

> Offramp stablecoins from your treasury wallet to your bank account

Withdrawals allow you to offramp stablecoins from your treasury wallet directly to your bank account. This is the reverse of the [funding process](/stablecoin-orchestration/guides/on-off-ramps/funding-company-wallets#funding-in-production-via-bank-transfer).

This guide shows you how to withdraw stablecoins from your company wallet directly to your bank account.

<Note>
  Looking for embedded offramps for your customers? Read the [Offramp guide](/offramp/overview).
</Note>

Treasury offramps are designed for company-owned wallets. They:

* Work with treasury wallets managed in the Crossmint Console or API
* Do not require per-user KYC, since the business is the verified entity
* Can be initiated programmatically via the [Create Order API](/api-reference/headless/create-order)

## Offramp via API

1. Contact Crossmint to register a bank account and obtain the `paymentMethodId`.
2. Initiate a stablecoin transfer from your treasury wallet to a bank account using the [Create Order API](/api-reference/headless/create-order).

<Accordion title="View code example">
  <CodeGroup>
    ```js Node.js theme={null}
    const serverApiKey = process.env.CROSSMINT_SERVER_SIDE_API_KEY;
    const payerAddress = "YOUR_TREASURY_WALLET_ADDRESS";
    const paymentMethodId = "YOUR_PAYMENT_METHOD_ID";
    const amount = "100";

    const response = await fetch(
        "https://www.crossmint.com/api/2022-06-09/orders",
        {
            method: "POST",
            headers: {
                "Content-Type": "application/json",
                "x-api-key": serverApiKey,
            },
            body: JSON.stringify({
                payment: {
                    method: "base",
                    currency: "usdc",
                    payerAddress: payerAddress,
                },
                recipient: {
                    paymentMethodId: paymentMethodId,
                },
                lineItems: [
                    {
                        currencyLocator: "fiat:usd",
                        executionParameters: {
                            mode: "exact-in",
                            amount: amount,
                        },
                    },
                ],
            }),
        }
    );

    const data = await response.json();
    console.log(data);
    ```

    ```bash cURL theme={null}
    curl --request POST \
      --url 'https://www.crossmint.com/api/2022-06-09/orders' \
      --header 'Content-Type: application/json' \
      --header 'x-api-key: YOUR_SERVER_SIDE_API_KEY' \
      --data '{
        "payment": {
          "method": "base",
          "currency": "usdc",
          "payerAddress": "YOUR_TREASURY_WALLET_ADDRESS"
        },
        "recipient": {
          "paymentMethodId": "YOUR_PAYMENT_METHOD_ID"
        },
        "lineItems": [
          {
            "currencyLocator": "fiat:usd",
            "executionParameters": {
              "mode": "exact-in",
              "amount": "100"
            }
          }
        ]
      }'
    ```

    ```python Python theme={null}
    import os
    import requests

    server_api_key = os.getenv("CROSSMINT_SERVER_SIDE_API_KEY")
    payer_address = "YOUR_TREASURY_WALLET_ADDRESS"
    payment_method_id = "YOUR_PAYMENT_METHOD_ID"
    amount = "100"

    url = "https://www.crossmint.com/api/2022-06-09/orders"
    headers = {
        "Content-Type": "application/json",
        "x-api-key": server_api_key,
    }
    payload = {
        "payment": {
            "method": "base",
            "currency": "usdc",
            "payerAddress": payer_address,
        },
        "recipient": {
            "paymentMethodId": payment_method_id,
        },
        "lineItems": [
            {
                "currencyLocator": "fiat:usd",
                "executionParameters": {
                    "mode": "exact-in",
                    "amount": amount,
                },
            },
        ],
    }

    response = requests.post(url, headers=headers, json=payload)
    data = response.json()
    print(data)
    ```
  </CodeGroup>

  Replace `YOUR_TREASURY_WALLET_ADDRESS` with your company wallet address and `YOUR_PAYMENT_METHOD_ID` with the payment method ID provided by your CSE contact.
</Accordion>

## How It Works

After the withdrawal is initiated:

* Stablecoins are debited from your treasury wallet
* Crossmint converts them into the selected fiat currency
* Funds are sent to your bank account through the selected rail, such as ACH, RTP, or SEPA
* You can track status in the Console or by polling the order status endpoint

### Monitor Withdrawal Status

You can track the status of your withdrawal by polling the order status endpoint:

<Accordion title="View code example">
  <CodeGroup>
    ```js Node.js theme={null}
    const apiKey = process.env.CROSSMINT_SERVER_SIDE_API_KEY;
    const orderId = "YOUR_ORDER_ID";

    const response = await fetch(
        `https://www.crossmint.com/api/2022-06-09/orders/${orderId}`,
        {
            method: "GET",
            headers: {
                "Content-Type": "application/json",
                "x-api-key": apiKey,
            },
        }
    );

    if (!response.ok) {
        throw new Error(`Failed to get order: ${response.status} ${response.statusText}`);
    }

    const data = await response.json();
    console.log(data);
    ```

    ```bash cURL theme={null}
    API_KEY="YOUR_SERVER_SIDE_API_KEY"
    ORDER_ID="YOUR_ORDER_ID"

    curl --request GET \
      --url "https://www.crossmint.com/api/2022-06-09/orders/${ORDER_ID}" \
      --header "Content-Type: application/json" \
      --header "x-api-key: ${API_KEY}"
    ```

    ```python Python theme={null}
    import os
    import requests

    api_key = os.getenv("CROSSMINT_SERVER_SIDE_API_KEY")
    order_id = "YOUR_ORDER_ID"

    url = f"https://www.crossmint.com/api/2022-06-09/orders/{order_id}"
    headers = {
        "Content-Type": "application/json",
        "x-api-key": api_key,
    }

    response = requests.get(url, headers=headers)

    if not response.ok:
        raise Exception(f"Failed to get order: {response.status_code} {response.reason}")

    print(response.json())
    ```
  </CodeGroup>
</Accordion>

## Next Steps

<CardGroup cols={3}>
  <Card title="Product Overview" icon="arrow-right-from-bracket" iconType="duotone" color="#A24EC9" href="/offramp/overview">
    Full offramp documentation
  </Card>

  <Card title="Payment Schemes" icon="credit-card" iconType="duotone" color="#D3A10F" href="/offramp/payment-methods">
    Supported payment methods and schemes
  </Card>

  <Card title="Offramp Quickstart" icon="bolt" iconType="duotone" color="#41B118" href="/offramp/quickstarts/rest-api">
    Get started with the Offramp API
  </Card>
</CardGroup>
