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

# Accept Quote

> Accept a market maker quote and execute the RFQ

Accepts a specific quote on an open RFQ and executes the trade through the custody contract. Only the original `requesterAddress` may accept. Once accepted, the RFQ transitions to `FILLED` and remaining quotes are discarded.

The RFQ and the selected quote must both still be within their expiry windows at acceptance time.

## Authentication

Requires an instance API key with the `trading` service enabled.

## Idempotency

The `Idempotency-Key` header is **required** for this endpoint. It guarantees that a retried acceptance does not execute the trade twice. Reusing a key with a different body returns `IDEMPOTENCY_MISMATCH`; omitting it returns `IDEMPOTENCY_KEY_REQUIRED`.

## Path Parameters

<ParamField path="id" type="string" required>
  The RFQ identifier. Max 100 characters.
</ParamField>

## Request Body

<ParamField body="requesterAddress" type="string" required>
  EVM address of the requester. Must match the RFQ's original `requesterAddress`. Format `0x[a-fA-F0-9]{40}`.
</ParamField>

<ParamField body="quoteId" type="string" required>
  The identifier of the quote to accept. Max 100 characters.
</ParamField>

<RequestExample>
  ```json theme={null}
  {
    "requesterAddress": "0x1111111111111111111111111111111111111111",
    "quoteId": "qt_001"
  }
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "success": true,
    "data": {
      "id": "rfq_abc123",
      "status": "FILLED",
      "acceptedQuoteId": "qt_001",
      "price": "100000000000000000000",
      "baseAmount": "5000000000000000000",
      "quoteAmount": "500000000000000000000",
      "settlementId": "stl_rfq_001",
      "filledAt": "2025-01-15T10:30:08.000Z"
    },
    "metadata": {
      "requestId": "550e8400-e29b-41d4-a716-446655440000",
      "timestamp": "2025-01-15T10:30:08.000Z",
      "instanceId": "inst_abc"
    }
  }
  ```
</ResponseExample>

## Error Codes

| Code                           | Status | Description                                          |
| ------------------------------ | ------ | ---------------------------------------------------- |
| `NOT_FOUND`                    | 404    | No RFQ or quote found with this ID                   |
| `FORBIDDEN`                    | 403    | The caller is not the RFQ requester                  |
| `RFQ_EXPIRED`                  | 410    | The RFQ has expired                                  |
| `QUOTE_EXPIRED`                | 410    | The selected quote has expired                       |
| `QUOTE_PRICE_OUT_OF_BOUNDS`    | 400    | The quote price is outside the permitted bounds      |
| `INSUFFICIENT_CUSTODY_BALANCE` | 400    | Insufficient custody balance to settle the trade     |
| `IDEMPOTENCY_KEY_REQUIRED`     | 400    | The `Idempotency-Key` header is missing              |
| `IDEMPOTENCY_MISMATCH`         | 409    | Idempotency key reused with a different request body |
