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

# End of Day Settlement

> Batch fiat payouts into a single daily settlement instead of paying out each transaction individually.

By default, every offramp transaction triggers an immediate payout to the recipient bank account. **End of Day (EOD) Settlement** changes this behavior: individual payouts are accumulated throughout the day and settled in a single batch transfer at the end of the business day.

This is useful when a customer receives many small offramp transactions and prefers fewer, consolidated bank transfers rather than one transfer per transaction.

## How It Works

### Without EOD Settlement (default)

Each offramp transaction is processed independently. As soon as conversion completes, MoonPay Enterprise initiates a separate fiat transfer to the recipient bank account.

```
Transaction 1 (100 USDC → EUR)  →  Payout 1 (€91.20)
Transaction 2 (250 USDC → EUR)  →  Payout 2 (€228.00)
Transaction 3 (50 USDC → EUR)   →  Payout 3 (€45.60)
```

### With EOD Settlement

Transactions are converted as they arrive, but payouts are held and combined into a single transfer at the end of the business day.

```
Transaction 1 (100 USDC → EUR)  ┐
Transaction 2 (250 USDC → EUR)  ├→  Single Payout (€364.80)
Transaction 3 (50 USDC → EUR)   ┘
```

## Enabling EOD Settlement

Set `batch_payout` to `true` when creating an offramp Autoramp. This setting applies to all transactions processed through that Autoramp.

`POST` `/api/autoramps`

<Note>
  This endpoint requires an `Idempotency-Key` header. Send the same key to safely retry a request without creating a duplicate autoramp. A request without one returns `400`.
</Note>

### Request fields

| Field | Type | Required | Description |
| - | - | - | - |
| `batch_payout` | boolean | No | If `true`, payouts are batched daily instead of sent individually. Defaults to `false`. Fiat destinations only. |

<Note>
  `batch_payout` only applies to offramp Autoramps with a fiat destination. Sending `batch_payout: true` with a crypto destination (onramp or swap) returns `400` with `"batch_payout is only supported for fiat destination currencies"`, and no Autoramp is created.
</Note>

### 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,
      "batch_payout": true
    }'
  ```
</CodeGroup>

### Response

<CodeGroup>
  ```json 201 Created theme={null}
  {
    "id": "9a7b6c5d-e3f1-4a2b-8c7d-6e5f4a3b2c1d",
    "status": "Authorized",
    "batch_payout": true,
    "deposit_rails": [
      {
        "type": "Crypto",
        "chain": "Ethereum",
        "address": "0xYourEthereumAddress"
      }
    ],
    "created_at": "2025-01-20T13:45:23Z"
  }
  ```

  ```json 400 Bad Request theme={null}
  "Missing Idempotency-Key header"
  ```
</CodeGroup>

<Note>
  The example above is trimmed to the fields most integrations need. The full `Autoramp` object also returns `kind`, `source`, `recipient`, `customer_id`, `source_currencies`, `destination_currency`, `is_third_party`, `fee_profile_id`, and `quotes`.
</Note>

## Transaction Lifecycle

When EOD Settlement is enabled, transactions follow a modified lifecycle where conversion happens immediately but the fiat payout is deferred until end of day.

| Step | What happens | `transaction_status` | `status` (deprecated) |
| - | - | - | - |
| Deposit received | Crypto arrives at the Autoramp deposit address | `ConversionInProgress`, or `FundsReviewInProgress` if the deposit goes to compliance review | `Pending`, or `InAmlReview` |
| Conversion | Crypto is converted to fiat at the current or locked rate | `ConversionInProgress` | `Pending` |
| Awaiting batch | Converted fiat amount is held for end-of-day settlement | `ConversionInProgress` | `PayoutPending` |
| Batch payout | All pending amounts are paid out in a single fiat transfer | `Completed` | `Completed` |

Every row above arrives as a `transaction_status` webhook event. The first row also emits a `transaction` event.

<Warning>
  `transaction_status` stays `ConversionInProgress` while a converted amount waits for the batch. It does not distinguish "converting" from "converted, held for settlement". Read `status: PayoutPending` when you need to tell those apart.

  A batched transaction never reports `PayoutInProgress`. When the batch payout confirms, it goes straight from `ConversionInProgress` to `Completed`, so do not wait for a payout-in-progress event that will not arrive.
</Warning>

<Note>
  `PayoutPending` is a value of the deprecated `status` field, not of `transaction_status`. See [Webhooks](/webhooks) for both enums.
</Note>

<Tip>
  Individual transactions are still tracked separately. Only the fiat payout step is batched, so you retain full visibility into every transaction via the API and webhooks.
</Tip>

## Webhooks

When EOD Settlement is enabled, webhook behavior changes slightly:

* **`transaction` and `transaction_status` events** are still emitted for each individual transaction as it is received and converted.
* The `transaction_status` for individual transactions will reflect the conversion state. The payout portion settles at end of day.
* A final `transaction_status` webhook with `transaction_status: "Completed"` is sent once the batched payout has been executed and confirmed.

## Fees

Fees come from the same [fee profile](/fees-and-invoices) regardless of whether EOD Settlement is enabled. The transaction fee and the network fee are calculated and applied per transaction.

The banking fee is charged once per batched payout rather than per individual transaction, which can reduce overall costs for high-frequency offramp flows.

## Constraints

* **Fiat destinations only.** `batch_payout: true` is rejected with `400` for crypto-to-crypto swaps and onramp Autoramps. It only applies when the destination is a fiat bank account (offramp).
* **Autoramp-level setting.** The batch behavior is configured per Autoramp. You can have some Autoramps with immediate payouts and others with EOD settlement for the same customer.
* **Cannot be changed after creation.** To switch between immediate and batched payouts, create a new Autoramp with the desired setting.

## When to Use EOD Settlement

| Scenario | Recommended |
| - | - |
| High-frequency offramps (many small transactions per day) | **Yes**. Reduces bank transfer volume and banking fees |
| Treasury management with daily reconciliation | **Yes**. One settlement per day simplifies accounting |
| Real-time payouts required by end customers | **No**. Use default immediate payouts |
| Low-frequency offramps (a few transactions per week) | **No**. Batching provides little benefit |

## Sandbox Testing

In Sandbox, you can simulate the full EOD Settlement flow.

<Steps>
  <Step title="Create an offramp Autoramp with batch_payout enabled">
    Use the request above with `"batch_payout": true`.
  </Step>

  <Step title="Approve the Autoramp">
    ```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"'
    ```
  </Step>

  <Step title="Create multiple sandbox transactions">
    ```bash theme={null}
    curl -X POST "https://api.sandbox.iron.xyz/api/sandbox/transaction" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: $(uuidgen)" \
      -H "X-API-Key: $API_KEY" \
      -d '{
        "autoramp_id": "<autoramp_id>",
        "amount": "100"
      }'
    ```

    Repeat to create several transactions against the same Autoramp.
  </Step>

  <Step title="Complete the transactions">
    ```bash theme={null}
    curl -X PUT "https://api.sandbox.iron.xyz/api/sandbox/transaction/<transaction_id>/state" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: $(uuidgen)" \
      -H "X-API-Key: $API_KEY" \
      -d '{ "state": "Completed" }'
    ```
  </Step>
</Steps>

<Note>
  In Sandbox, batch settlement is simulated. Transactions complete immediately when you advance their state rather than waiting for end of day.
</Note>
