> ## 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.

# Update Invoice

> Updates one or more fields on an existing invoice.

### Headers

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

### Path Parameters

<ParamField path="id" type="string" required>
  UUID of the invoice to update.
</ParamField>

### Body

Send only the fields you want to change. At least one field is required.

<ParamField body="status" type="string">
  New status. One of: `Draft`, `Sent`, `Paid`, `Overdue`, `Cancelled`.
</ParamField>

<ParamField body="description" type="string">
  Updated invoice description.
</ParamField>

<ParamField body="due_date" type="string">
  Updated due date in `YYYY-MM-DD` format.
</ParamField>

<ParamField body="amount" type="number">
  Updated total amount.
</ParamField>

<ParamField body="currency" type="string">
  Updated 3-letter currency code.
</ParamField>

<ParamField body="tax_rate" type="number">
  Updated tax rate as a percentage (0–100).
</ParamField>

### Response

<ResponseField name="success" type="boolean">`true` on update.</ResponseField>
<ResponseField name="data" type="object">The updated invoice object.</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X PATCH https://kliio.app/api/v1/invoices/inv-uuid-... \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{ "status": "Paid" }'
  ```

  ```js JavaScript theme={null}
  const res = await fetch('https://kliio.app/api/v1/invoices/inv-uuid-...', {
    method: 'PATCH',
    headers: {
      Authorization: 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({ status: 'Paid' })
  })
  const { data } = await res.json()
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "data": {
      "id": "inv-uuid-...",
      "invoice_number": "INV-0042",
      "status": "Paid",
      "amount": 1500.00,
      "currency": "USD",
      "due_date": "2025-04-30",
      "created_at": "2025-03-15T10:30:00.000Z"
    }
  }
  ```

  ```json 400 theme={null}
  {
    "error": "No valid fields to update"
  }
  ```

  ```json 404 theme={null}
  {
    "error": "Invoice not found or access denied"
  }
  ```
</ResponseExample>
