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

# Deadlines

> The two deadlines on every payment request, what they cover, and what to do when one causes a failure.

## Overview

Every payment request has two deadlines. You set both. The gateway never changes them and never fills them in. The SDK and CLI fill them in only when you leave them out.

Payment timeline (conceptual)

Request\
submittedQuote window\
endsDelivery\
deadlinePayment\
completed

Quote windowDeliveryFinalizing

Not to scale.

<ul>
  <li>
    **Quote window:** settlement operators send quotes, each with an expiry they set when they
    quote. A quote can be selected only before it expires.
  </li>

  <li>
    **Delivery:** the selected operator pulls your funds into the settlement vault on the source
    chain using the authorization you signed (Permit2 on EVM and Tron), waits for that deposit to be
    confirmed (longer for a large payment), then pays your recipient on the destination chain. The payout
    transaction must be mined by the delivery deadline.
  </li>

  <li>
    **Finalizing:** as soon as the payout is mined you get its transaction hash, and the payment is
    `completed` once the payout is final on the destination chain. This step does not count
    against the delivery deadline.
  </li>
</ul>

| Field | What it means | SDK and CLI default |
| - | - | - |
| `quote_deadline` | End of the **quote window**: the time settlement operators have to send a quote for your payment. | 3 seconds |
| `fulfillment_deadline` | The **delivery deadline**: the payout to your recipient must be mined on the destination chain by this time. | 5 minutes |

## Quote expiry

Every quote carries its own expiry, `award_deadline`. The settlement operator that makes the quote chooses it, based on its own risk, capital and delivery speed. You cannot set it. Once it passes, the quote can no longer be selected.

## How a payment uses them

```mermaid theme={"theme":"github-dark"}
sequenceDiagram
    participant Originator
    participant Gateway as Payment Gateway
    participant Operator as Settlement operator
    participant Destination
    Originator->>Gateway: Submit payment<br/>(with quote_deadline)
    Gateway->>Operator: Request quotes
    Operator-->>Gateway: Return quote<br/>(with expiry)
    Note over Gateway: Select the best valid quote when the window closes,<br/>or the first valid quote with auto accept
    Note over Operator: Deposit funds to settlement vault<br/>and wait for confirmation
    Operator->>Destination: Delivery before<br/>fulfillment_deadline
    Note over Gateway: Set status as finalizing<br/>until destination confirms payout
```

1. **Quote window.** Settlement operators send quotes until `quote_deadline`. By default the gateway waits for the whole window, even if a quote arrives early, then selects the best valid quote: the best one that has not expired. With [auto accept](#auto-accept), it selects the first valid quote instead.
2. **Delivery.** The selected operator moves your funds into the [settlement vault](https://docs.atum.xyz/get-started/concepts/settlement-vault.md), waits until that deposit is confirmed on the source chain, then pays your recipient. The payout must be mined on the destination chain before `fulfillment_deadline`.
3. **Finality.** Once the payout is mined the status is `finalizing`. It becomes `completed` when the payout is final on the destination chain. This step does not count against `fulfillment_deadline`. See [Finality](https://docs.atum.xyz/get-started/concepts/finality.md).

## Choosing values

### Quote window

The quote window is the time between the request submission and `quote_deadline` (set by the payment originator). Widening this window will only result in a slower payment. Keep the default.

Make it longer only when you sign now, and submit later. For example, with `send-payment --prepare-only`: a signed request can only be submitted while its quote window is open. Add seconds, not minutes. A settlement operator declines a window that ends after its quote would expire (`QUOTE_WINDOW_TOO_LONG`).

If you lengthen the quote window, lengthen the delivery deadline by the same amount. Both count from when you build the request, so a longer quote window leaves less time for delivery. The SDK refuses a quote window of 5 minutes or more unless you also pass a `fulfillmentDeadlineSeconds` that ends after it.

### Accept the first valid quote

To start delivery sooner, add the query parameter `auto_accept=true` to [`POST /v1/payments`](https://docs.atum.xyz/api-reference/payment-gateway/submit-payment): `POST /v1/payments?auto_accept=true`. It is not a field of the request body. The gateway then selects the first valid quote at or under your `max_source_amount` as soon as it arrives, instead of waiting for the quote window to close.

* You give up comparing quotes, so set `max_source_amount` to the price you accept. A request with `auto_accept` and no `max_source_amount` is refused.
* `quote_deadline` still applies. If no valid quote arrives by then, the payment fails as usual.
* `auto_accept` is not part of the signed request. Sending the same request again returns the original payment, with the setting it was first sent with.

### Delivery deadline

`fulfillment_deadline` is the latest time the payout to your recipient can be mined on the destination chain. If no payout is mined by then, your funds are refunded. The payout does not have to be final by then. See [Finality](https://docs.atum.xyz/get-started/concepts/finality.md).

It is set when you build the request, the same way as `quote_deadline`, so the time left for delivery is what remains after the quote window.

The deadline is a limit, not the time a payment takes. Most payments are delivered within seconds, long before it.

What its length changes:

* **A longer deadline never slows a successful payment.** Settlement operators deliver as soon as they can.
* **A longer deadline delays a refund.** If a payment is not delivered after your funds reach the settlement vault, the refund waits for the deadline. See [When a refund can start](https://docs.atum.xyz/get-started/support/refunds.md#when-a-refund-can-start).
* **A deadline that is too short gets no quote.** Settlement operators decline with `DEADLINE_TOO_SHORT`, and the payment fails before your funds move.

### Choosing a delivery deadline

| Your payment | Delivery deadline |
| - | - |
| Everyday amounts | Keep the SDK default (5 minutes). This covers most payments: they are usually delivered within seconds, and 5 minutes leaves room for the deposit wait on every supported source chain. |
| Large amounts | At least the source chain's [time to finality](https://docs.atum.xyz/get-started/concepts/finality.md#time-to-finality), plus a few minutes. An hour fits every chain. See [Large payments](#large-payments). |
| Signed now, submitted later | Add the extra quote window time to the delivery deadline too. |

If you accept payments with x402 or MPP, you set `fulfillmentDeadlineSeconds` for your corridors yourself. Choose it the same way.

### Large payments

Before it pays your recipient, the settlement operator waits for your deposit to be confirmed on the source chain. For a large payment, an operator may wait until the source chain has finalized your deposit. On Ethereum and its rollups that takes tens of minutes. What counts as large is each operator's choice. See [Finality](https://docs.atum.xyz/get-started/concepts/finality.md#source-chain).

If your delivery deadline cannot cover that wait, operators decline with `DEADLINE_TOO_SHORT` and the payment fails with `NO_QUOTES_RECEIVED`. Your funds do not move. Send the payment again with a longer deadline and a new `request_id`.

For a large payment, set the delivery deadline yourself:

```typescript SDK theme={"theme":"github-dark"}
const paymentRequest = await client.preparePaymentRequest({
  // ...your payment fields
  fulfillmentDeadlineSeconds: 3600, // 1 hour: fits every source chain
});
```

```bash CLI theme={"theme":"github-dark"}
send-payment <sender> <amount> <source asset> <receiver> <destination asset> \
  --fulfillment-deadline-seconds 3600
```

## Waiting for the result

How long `POST /v1/payments` waits for the result, and how to follow the payment after that: [Track a payment](https://docs.atum.xyz/get-started/after-submission.md#track-a-payment).

A quote request answers straight away with a `quote_request_id`, which you poll with `GET /v1/payments/quote-requests/{quote_request_id}`. Pass `wait=true` to keep the connection open until the quote window ends, for up to 5 seconds. See [Get a price quote](https://docs.atum.xyz/get-started/get-a-price-first.md).

## Deadline errors

| `error.code` | What happened | What to do |
| - | - | - |
| [`NO_QUOTES_RECEIVED`](https://docs.atum.xyz/errors#no-quotes-received) | The quote window closed without a usable quote. Nothing was delivered. | Read `decline_summary` [below](#no-quotes-received). |
| [`QUOTES_EXPIRED`](https://docs.atum.xyz/errors#quotes-expired) | Quotes arrived, but none could be selected when the window closed, usually because they had expired. | Use a shorter quote window. |
| [`NO_SETTLER_FOR_CORRIDOR`](https://docs.atum.xyz/errors#no-settler-for-corridor) | No settlement operator serves this source and destination pair. | Choose another pair. |
| [`QUOTE_DEADLINE_NOT_FUTURE`](https://docs.atum.xyz/errors#quote-deadline-not-future), [`FULFILLMENT_DEADLINE_NOT_FUTURE`](https://docs.atum.xyz/errors#fulfillment-deadline-not-future) | The deadline had already passed when the gateway received a new payment, often a prepared request sent too late. | Build and sign a new request. |
| [`FULFILLMENT_DEADLINE_ORDER`](https://docs.atum.xyz/errors#fulfillment-deadline-order) | `fulfillment_deadline` is not later than `quote_deadline`. | Fix the order. The SDK and CLI check this before sending. |
| [`SETTLEMENT_FAILED`](https://docs.atum.xyz/errors#settlement-failed) | Delivery started but did not finish. Your funds may be in the settlement vault: see [A failed payment with a deposit](https://docs.atum.xyz/get-started/support/refunds.md#failed-with-a-deposit). | Reconcile by `payment_id` before you retry. |

After a payment has failed, its `request_id` is used up: sending it again returns the same failure. Use a new `request_id` for the next attempt. See [Idempotency](https://docs.atum.xyz/payment-protocols/idempotency.md).

### Why nobody quoted

When a payment fails with `NO_QUOTES_RECEIVED`, the status response tells you why:

* `requested_count`: how many settlement operators were asked.
* `decline_summary`: how many declined, grouped by [decline reason](https://docs.atum.xyz/decline-reasons.md).

| `decline_summary` | Meaning | Change on the next payment |
| - | - | - |
| `QUOTE_WINDOW_TOO_LONG` | Your quote window ends after their quote would expire. | Shorter quote window. |
| `DEADLINE_TOO_SHORT` | Not enough time left to deliver before `fulfillment_deadline`. | Later delivery deadline. See [Choosing a delivery deadline](#choosing-a-delivery-deadline). |
| `MAX_SOURCE_AMOUNT_TOO_LOW` | Your `max_source_amount` is below their price. | Higher `max_source_amount`. See [Get a price quote](https://docs.atum.xyz/get-started/get-a-price-first.md). |
| `INTERNAL` | The operator hit an unexpected error. Some operators also send it for a `max_source_amount` below their price. | Check `max_source_amount` covers the price, then retry. |
| Any other reason | See that reason on [Decline reasons](https://docs.atum.xyz/decline-reasons.md). | Follow that page. |
| Empty | Nobody declined. Operators were asked and did not quote before the window closed. | Retry with the default quote window. |
| Missing | The breakdown could not be read. This is not the same as empty. | Retry. |

## Next steps

| Topic | Guide |
| - | - |
| Check a corridor's prices without moving funds | [Get a price quote](https://docs.atum.xyz/get-started/get-a-price-first.md) |
| Build and sign a payment | [Prepare a payment](https://docs.atum.xyz/get-started/prepare-a-payment.md) |
| How long each chain takes to finalize | [Finality](https://docs.atum.xyz/get-started/concepts/finality.md) |
| Track a payment and read its status | [After submission](https://docs.atum.xyz/get-started/after-submission.md) |
| Every error code | [Error codes](https://docs.atum.xyz/errors.md) |


## Related topics

- [Glossary](https://docs.atum.xyz/get-started/reference/glossary.md)
- [Destination finality](https://docs.atum.xyz/settle-payments/destination-finality.md)
- [Error codes](https://docs.atum.xyz/errors.md)
- [Decline reasons](https://docs.atum.xyz/decline-reasons.md)
- [Refunds](https://docs.atum.xyz/get-started/support/refunds.md)


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