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

# Accept Quote

> Accept a quote and generate a Purchase Order.

# Accept Quote

Marks the quote as accepted and generates a PO (Purchase Order) number. This represents the customer's formal acceptance of the quoted terms.

## Path Parameters

<ParamField path="id" type="integer" required>
  The quote ID.
</ParamField>

## Response

<ResponseField name="status" type="string">
  `success` on successful acceptance.
</ResponseField>

<ResponseField name="data" type="object">
  <Expandable title="Response fields">
    <ResponseField name="quote" type="object">
      The updated quote with `accepted` status.
    </ResponseField>

    <ResponseField name="po_number" type="string">
      Generated Purchase Order number (e.g., `PO-2024-0001`).
    </ResponseField>
  </Expandable>
</ResponseField>

## What Happens

1. Quote status changes to `accepted`
2. RFQ status changes to `accepted`
3. A PO number is generated and stored on the order
4. **Merchant receives** an email notification with:
   * Quote acceptance confirmation
   * PO number
   * Customer details
5. **Customer receives** an email with:
   * PO confirmation
   * Order summary
   * Next steps

## Error Codes

| Status | Error                    | Fix                                                 |
| ------ | ------------------------ | --------------------------------------------------- |
| `400`  | Quote cannot be accepted | Quote may already be accepted, rejected, or expired |
| `401`  | Invalid API key          | Verify your `X-API-Key` header                      |
| `404`  | Quote not found          | Check that the quote ID exists                      |

<RequestExample>
  ```bash Accept quote theme={null}
  curl -X POST https://api.khaime.com/api/v1/partner/quote/101/accept \
    -H "X-API-Key: pk_sandbox_your_key"
  ```
</RequestExample>

<ResponseExample>
  ```json Success theme={null}
  {
    "status": "success",
    "message": "Quote accepted successfully",
    "data": {
      "quote": {
        "id": 101,
        "quote_number": "Q-2024-0001",
        "status": "accepted",
        "total_amount": 510000,
        "currency": "USD",
        "accepted_at": "2024-01-20T09:15:00Z"
      },
      "po_number": "PO-2024-0001"
    }
  }
  ```
</ResponseExample>
