---
title: "Replace invoice (draft only)"
method: PUT
path: "/invoices/{id}/"
tags: ["Billing"]
---

# Replace invoice (draft only)

`PUT /invoices/{id}/`

## Request body

- Invoice
  - `id` string
  - `customer` string, required — Customer ID.
  - `document` integer, required — Document type ID (fiscal document; depends on country).
  - `number` integer — Sequence number assigned at finalize time.
  - `currency` string — Currency code from the customer's currency.
  - `date` string, date, required
  - `due_date` string, date, nullable
  - `period_start` string, date, nullable
  - `period_end` string, date, nullable
  - `collection_method` 'deferred' | 'deferred_dues' | 'automatically', required
  - `note` string, nullable
  - `amount` number, nullable — Subtotal of taxable lines (computed).
  - `exempt` number, nullable — Subtotal of tax-exempt lines (computed).
  - `tax` number, nullable — Total tax (computed).
  - `tax_percent` number, nullable
  - `subtotal` number, nullable
  - `total` number, nullable — Final amount (computed).
  - `total_adjusted` number, nullable
  - `retention` number, nullable
  - `discount` number, nullable
  - `discount_scheme` '%' | '$', nullable
  - `custom_change` number, nullable — Custom currency conversion factor.
  - `status` 'draft' | 'finalized' | 'paid' | 'cancelled' | 'uncollectible' | 'pending'
  - `biller_status` 'pending' | 'queued' | 'succeeded' | 'failed' | 'processing'
  - `tax_agency` object — Tax-agency response payload (country-specific).
  - `local_file` string, uri, nullable — Signed URL to the fiscal PDF/XML when applicable.
  - `subscription` integer, nullable — Linked subscription ID when generated by a subscription cycle.
  - `imported` boolean
  - `uncollectible` string, date-time, nullable
  - `test_mode` boolean
  - `lines` InvoiceLine[], required
    - `id` string
    - `name` string, required
    - `description` string, nullable
    - `amount` number, required — Unit price.
    - `quantity` number, required
    - `total` number
    - `exempt` boolean
    - `tax` number, nullable
    - `tax_percent` number, nullable
    - `discount` number, nullable
    - `discount_scheme` '%' | '$', nullable
    - `code` string, nullable
    - `code_scheme` string, nullable
    - `plan` integer, nullable — Linked plan ID when this line bills a subscription plan.
    - `retention` number, nullable
    - `retention_percent` number
    - `retention_scheme` 'subtotal' | 'tax'
    - `unit_label` string, nullable
  - `references` InvoiceReference[]
    - `date` string, date, required
    - `document` string, required — Document reference type (country-specific).
    - `description` string, nullable
    - `serial` string, required
  - `payments` object[]
  - `created` string, date-time
  - `updated` string, date-time

## Response `200`

Updated invoice.

- Invoice
  - `id` string
  - `customer` string, required — Customer ID.
  - `document` integer, required — Document type ID (fiscal document; depends on country).
  - `number` integer — Sequence number assigned at finalize time.
  - `currency` string — Currency code from the customer's currency.
  - `date` string, date, required
  - `due_date` string, date, nullable
  - `period_start` string, date, nullable
  - `period_end` string, date, nullable
  - `collection_method` 'deferred' | 'deferred_dues' | 'automatically', required
  - `note` string, nullable
  - `amount` number, nullable — Subtotal of taxable lines (computed).
  - `exempt` number, nullable — Subtotal of tax-exempt lines (computed).
  - `tax` number, nullable — Total tax (computed).
  - `tax_percent` number, nullable
  - `subtotal` number, nullable
  - `total` number, nullable — Final amount (computed).
  - `total_adjusted` number, nullable
  - `retention` number, nullable
  - `discount` number, nullable
  - `discount_scheme` '%' | '$', nullable
  - `custom_change` number, nullable — Custom currency conversion factor.
  - `status` 'draft' | 'finalized' | 'paid' | 'cancelled' | 'uncollectible' | 'pending'
  - `biller_status` 'pending' | 'queued' | 'succeeded' | 'failed' | 'processing'
  - `tax_agency` object — Tax-agency response payload (country-specific).
  - `local_file` string, uri, nullable — Signed URL to the fiscal PDF/XML when applicable.
  - `subscription` integer, nullable — Linked subscription ID when generated by a subscription cycle.
  - `imported` boolean
  - `uncollectible` string, date-time, nullable
  - `test_mode` boolean
  - `lines` InvoiceLine[], required
    - `id` string
    - `name` string, required
    - `description` string, nullable
    - `amount` number, required — Unit price.
    - `quantity` number, required
    - `total` number
    - `exempt` boolean
    - `tax` number, nullable
    - `tax_percent` number, nullable
    - `discount` number, nullable
    - `discount_scheme` '%' | '$', nullable
    - `code` string, nullable
    - `code_scheme` string, nullable
    - `plan` integer, nullable — Linked plan ID when this line bills a subscription plan.
    - `retention` number, nullable
    - `retention_percent` number
    - `retention_scheme` 'subtotal' | 'tax'
    - `unit_label` string, nullable
  - `references` InvoiceReference[]
    - `date` string, date, required
    - `document` string, required — Document reference type (country-specific).
    - `description` string, nullable
    - `serial` string, required
  - `payments` object[]
  - `created` string, date-time
  - `updated` string, date-time

---

[API](https://skmtc.net/piriod/apis/piriod-api.md) · [All operations](https://skmtc.net/piriod/apis/piriod-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/piriod/piriod-api/versions/70cbc827dc7b/schema)
