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

# Create Quote

> Creates a new quote for a client. The quote number is auto-generated and expiry defaults to 30 days.

### Headers

<ParamField header="Authorization" type="string" required>
  `Bearer YOUR_API_KEY`
</ParamField>

### Body

<ParamField body="client_id" type="string" required>
  UUID of the client. Must belong to your account.
</ParamField>

<ParamField body="amount" type="number" required>
  Total quote amount (must be ≥ 0).
</ParamField>

<ParamField body="project_id" type="string">
  Optional UUID of an associated project.
</ParamField>

<ParamField body="expires_at" type="string">
  Valid until date in `YYYY-MM-DD` format. Defaults to 30 days from creation.
</ParamField>

<ParamField body="description" type="string">
  A short description or scope of work.
</ParamField>

<ParamField body="currency" type="string">
  3-letter currency code. Defaults to `USD`.
</ParamField>

<ParamField body="tax_rate" type="number">
  Tax rate as a percentage (0–100). Defaults to `0`.
</ParamField>

<ParamField body="status" type="string">
  Initial status. Either `Draft` (default) or `Sent`.
</ParamField>

<ParamField body="line_items" type="array">
  Optional array of line items.

  <Expandable title="Line item object">
    <ParamField body="description" type="string" required>Line item label</ParamField>
    <ParamField body="quantity" type="number" required>Quantity</ParamField>
    <ParamField body="rate" type="number" required>Unit price</ParamField>
    <ParamField body="discount" type="number">Discount percentage (0–100). Defaults to `0`.</ParamField>
  </Expandable>
</ParamField>

### Response

<ResponseField name="success" type="boolean">`true` on creation.</ResponseField>
<ResponseField name="data" type="object">The newly created quote, including an embedded `client` object.</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://kliio.app/api/v1/quotes \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "client_id": "c1d2e3f4-...",
      "amount": 3500,
      "currency": "USD",
      "tax_rate": 10,
      "expires_at": "2025-04-30",
      "description": "E-commerce site build",
      "line_items": [
        { "description": "Design", "quantity": 1, "rate": 1500 },
        { "description": "Development", "quantity": 20, "rate": 100 }
      ]
    }'
  ```

  ```js JavaScript theme={null}
  const res = await fetch('https://kliio.app/api/v1/quotes', {
    method: 'POST',
    headers: {
      Authorization: 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      client_id: 'c1d2e3f4-...',
      amount: 3500,
      currency: 'USD',
      tax_rate: 10,
      expires_at: '2025-04-30',
      description: 'E-commerce site build'
    })
  })
  const { data } = await res.json()
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "success": true,
    "data": {
      "id": "quo-uuid-...",
      "quote_number": "QUO-0013",
      "amount": 3500,
      "currency": "USD",
      "status": "Draft",
      "expires_at": "2025-04-30",
      "tax_rate": 10,
      "description": "E-commerce site build",
      "client": {
        "id": "c1d2e3f4-...",
        "name": "Alice Johnson",
        "email": "alice@example.com",
        "company_name": "Acme Corp"
      },
      "created_at": "2025-03-15T10:30:00.000Z"
    }
  }
  ```

  ```json 400 theme={null}
  {
    "error": "Validation failed",
    "details": ["client_id is required"]
  }
  ```
</ResponseExample>
