# Finalize a draft invoice

`POST /api/v1/invoices/{id}/finalize`

Needs the `invoices:write` scope, or a full-access key.

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | required |  |

## Headers

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | string | optional | A unique value for this operation, chosen by you. A retry with the same key and the same body returns the first response instead of running again. The same key with a different body answers 409 `idempotency_key_reused`; a key whose first request is still running answers 409 `idempotency_in_progress`. |

## Responses

### 200

Invoice finalized.

JSON Schema:

```json
{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "example": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
        },
        "sequential_number": {
          "type": "string"
        },
        "totals": {
          "type": "object",
          "properties": {
            "subtotalCents": {
              "type": "string",
              "pattern": "^\\d+$",
              "description": "Line-item subtotal before discounts/tax, in minor units, serialized as a decimal string.",
              "example": "1999"
            },
            "discountCents": {
              "type": "string",
              "pattern": "^\\d+$",
              "description": "Discount applied, in minor units, serialized as a decimal string.",
              "example": "1999"
            },
            "creditAppliedCents": {
              "type": "string",
              "pattern": "^\\d+$",
              "description": "Account credit applied, in minor units, serialized as a decimal string.",
              "example": "1999"
            },
            "taxCents": {
              "type": "string",
              "pattern": "^\\d+$",
              "description": "Tax charged, in minor units, serialized as a decimal string.",
              "example": "1999"
            },
            "totalCents": {
              "type": "string",
              "pattern": "^\\d+$",
              "description": "Grand total, in minor units, serialized as a decimal string.",
              "example": "1999"
            },
            "currency": {
              "type": "string",
              "enum": [
                "USD",
                "AUD",
                "CAD",
                "GBP",
                "EUR",
                "INR",
                "NPR"
              ],
              "example": "USD"
            }
          },
          "required": [
            "subtotalCents",
            "discountCents",
            "creditAppliedCents",
            "taxCents",
            "totalCents",
            "currency"
          ]
        }
      },
      "required": [
        "id",
        "sequential_number",
        "totals"
      ]
    },
    "_agent": {
      "type": "object",
      "properties": {
        "summary": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "ok"
          ]
        },
        "next_actions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "warnings": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "summary",
        "status",
        "next_actions",
        "warnings"
      ]
    },
    "api_version": {
      "type": "string",
      "example": "2026-07-01"
    }
  },
  "required": [
    "data",
    "_agent",
    "api_version"
  ]
}
```
