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

# Offramp

> Convert stablecoins to fiat by setting up autoramp rules that offramp crypto received at a deposit address to a registered bank account.

## Use Case

Enable users to offramp **stablecoins into fiat** across various chains.

This works via setting up an autoramp rule on Iron that offramps stablecoins that are received into that address to your bank account.

Examples:

* Setup **wallet address 1** which turns stablecoins (e.g. USDC) into fiat and sends them to your bank account at Deutsche Bank
* Setup **wallet address 2** which turns stablecoins (e.g. USDC) into fiat and sends them to your personal bank account at Revolut

## Example Flow

<Steps>
  <Step>
    Max sets up a **wallet address 1** owned by Iron
  </Step>

  <Step>
    Now an `autoramp` is activated which turns USDC to EUR and is tied to his bank account
  </Step>

  <Step>
    Max sends 1000 USDC to **wallet address 1**
  </Step>

  <Step>
    As soon as funds hit this address, Iron turns them into EUR and pays them to Max's bank account
  </Step>

  <Step>
    Max can transfer at any time. This **wallet address 1** is persistent.
  </Step>

  <Step>
    Non-supported assets sent to **wallet address 1** will be returned to sender
  </Step>
</Steps>

## Prerequisites

Every step must complete before moving to the next. Sandbox-only steps are marked.

<Steps>
  <Step title="Customer is Active">
    Your customer must have `Active` status. This means they have completed [identification](/onboarding) (KYC/KYB) and signed all required documents.
  </Step>

  <Step title="Register a bank account">
    Register the destination bank account via `POST /addresses/fiat`. See [Fiat Addresses](/fiat-addresses). The account starts in `RegistrationPending` status.
  </Step>

  <Step title="Sandbox: approve the fiat address">
    In Sandbox, the fiat address stays in `RegistrationPending` until you manually advance it:

    ```bash theme={null}
    curl -X PUT "https://api.sandbox.iron.xyz/api/sandbox/fiat-verification/<fiat_address_id>" \
      -H "Content-Type: application/json" \
      -H "X-API-Key: $API_KEY" \
      -d '"Registered"'
    ```

    In production, registration is handled automatically.
  </Step>

  <Step title="Register crypto addresses">
    Register your customer's wallet addresses via [Crypto Addresses](/crypto-addresses) for [Travel Rule](/travel-rule) compliance. Funds from unregistered wallets may be delayed for manual review.
  </Step>

  <Step title="(Optional) Get a quote">
    If you need a locked rate, request a quote via `GET /autoramps/quote`. See [Quotes](/quotes). Otherwise, the autoramp executes at the current mid-market rate.

    If you started with a quote, you can keep attaching further quotes after the offramp is created via `POST /autoramps/{autoramp_id}/quotes`. Standalone offramps (created without an initial quote) cannot use this and always execute at the current rate.
  </Step>

  <Step title="Create the offramp autoramp">
    Create the autoramp via `POST /autoramps` using the registered bank account's `account_identifier`.
  </Step>

  <Step title="Sandbox: approve the autoramp">
    In Sandbox, the autoramp starts in `Authorized` status. Approve it to enable transaction processing:

    ```bash theme={null}
    curl -X PUT "https://api.sandbox.iron.xyz/api/sandbox/autoramp/<autoramp_id>" \
      -H "Content-Type: application/json" \
      -H "X-API-Key: $API_KEY" \
      -d '"Approved"'
    ```

    In production, autoramps are approved automatically after compliance review.
  </Step>
</Steps>

<Note>
  The `account_identifier` you provide in `recipient_account` must match a bank account you've already registered via the [Fiat Addresses API](/fiat-addresses). Iron uses this to ensure secure and compliant payouts.
</Note>

## Implementation

Create an autoramp that converts USDC on Ethereum to EUR and pays out to a SEPA bank account.

`POST` `/autoramps`

### Request fields

| Field                    | Required | Description                                                                                                                                              |
| ------------------------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `source_currencies`      | Yes      | Array of input currencies (Crypto or Fiat objects)                                                                                                       |
| `destination_currency`   | Yes      | Output currency (Crypto or Fiat object)                                                                                                                  |
| `recipient_account`      | Yes      | Destination account. For fiat: `{ "type": "Fiat", "account_identifier": { ... } }`. For crypto: `{ "type": "Crypto", "chain": "...", "address": "..." }` |
| `customer_id`            | Yes      | The customer's UUID                                                                                                                                      |
| `source_is_third_party`  | No       | Whether the source allows third-party payments                                                                                                           |
| `sepa_payment_reference` | No       | Reference for outgoing SEPA transfers (max 140 chars)                                                                                                    |
| `ach_payment_reference`  | No       | Reference for outgoing ACH transfers (max 10 chars)                                                                                                      |
| `batch_payout`           | No       | If `true`, payouts are batched daily instead of sent individually. Fiat destinations only.                                                               |

The `account_identifier` inside `recipient_account` uses the same payment rail discriminator as [Fiat Addresses](/fiat-addresses): `SEPA` (requires `iban`), `ACH` / `Wire` / `RTP` (require `routing_number` + `account_number`), `SWIFT` (requires `bic` + `account_number`), `CHAPS` / `FPS` (require `sort_code` + `account_number`).

### Request

<CodeGroup>
  ```bash Bash theme={null}
  curl -X POST "https://api.sandbox.iron.xyz/api/autoramps" \
    -H "Content-Type: application/json; charset=utf-8" \
    -H "IDEMPOTENCY-KEY: <your-idempotency-key>" \
    -H "X-API-Key: <your-api-key>" \
    -d '{
      "source_currencies": [{
        "type": "Crypto",
        "token": "USDC",
        "blockchain": "Ethereum"
      }],
      "destination_currency": {
        "type": "Fiat",
        "code": "EUR"
      },
      "recipient_account": {
        "type": "Fiat",
        "account_identifier": {
          "type": "SEPA",
          "iban": "DE89370400440532013000"
        }
      },
      "customer_id": "123e4567-e89b-12d3-a456-426614174000",
      "source_is_third_party": false
    }'
  ```
</CodeGroup>

### Response

<CodeGroup>
  ```json theme={null}
  {
    "id": "9a7b6c5d-e3f1-4g2h-8i7j-6k5l4m3n2o1p",
    "status": "Authorized",
    "deposit_rails": [
      {
        "type": "Wallet",
        "id": "xyz98765-lkjh-4321-mnop-0987654321ab",
        "blockchain": "Ethereum",
        "address": "0xYourEthereumAddress",
        "currency": {
          "type": "Crypto",
          "token": "USDC",
          "blockchain": "Ethereum"
        }
      }
    ],
    "created_at": "2025-01-20T13:45:23Z"
  }
  ```
</CodeGroup>

<Note>
  The `deposit_rails` array contains the payment details. The legacy `deposit_account` field is deprecated.
</Note>

Now you are ready to show the user their custom wallet address which will be auto-connected to this offramp rule. Please also show supported assets for this wallet address (e.g. EURC, USDC). Non-supported assets will be returned to sender.
