invoices

Update Invoice

Update an existing invoice. Supports partial updates.

Updatable fields:

  • lineItems: Array of line items if calculationMethod is "LINE_ITEMS"
  • sections: Grouped line items if calculationMethod is "LINE_ITEMS"
  • percentage: Percentage if calculationMethod is "PERCENTAGE"
  • issueDate: ISO 8601 datetime string
  • dueDate: ISO 8601 datetime string
  • description: Invoice description
  • status: Invoice status — one of DRAFT, SENT, DECLINED, PAID, PARTIALLY_PAID, OVERDUE. Only valid transitions from the invoice's current status are accepted (e.g. DECLINED is reachable from DRAFT, SENT, OVERDUE, or PARTIALLY_PAID); an invalid transition is rejected with a 400.
  • isActive: Set to false to archive the invoice, or true to unarchive it. Applied independently of any other fields present in the same request.

calculationMethod cannot be changed after creation and is rejected if included.

patch/invoices/{invoice_id}

Request

  • Base URL: https://api.coperniq.io/v1
  • URL: https://api.coperniq.io/v1/invoices/{invoice_id}
  • Auth: API key in header x-api-key

Path parameters

invoice_idinteger required

Invoice identifier

Request body

status'DRAFT' | 'SENT' | 'DECLINED' | 'PAID' | 'PARTIALLY_PAID' | 'OVERDUE'

Invoice status

percentagenumber double

Percentage (PERCENTAGE invoices only). Cannot be combined with lineItems or sections.

issueDatestring date-time

Issue date (ISO 8601 datetime string)

dueDatestring date-time

Due date (ISO 8601 datetime string)

descriptionstring nullable

Invoice description

isActiveboolean

Set to false to archive the invoice, or true to unarchive it. Applied independently of any other fields present in the same request.

Response

Invoice updated successfully

idinteger required

Invoice identifier

invoiceNumberinteger required

Unique invoice number

descriptionstring nullable

Invoice description

status'DRAFT' | 'SENT' | 'DECLINED' | 'PAID' | 'PARTIALLY_PAID' | 'OVERDUE' required

Invoice status

basedOnIdinteger nullable

ID of the record this invoice is based on

basedOnUidinteger nullable

UID of the record this invoice is based on

dueDatestring date-time

Due date

issueDatestring date-time nullable

Issue date when the invoice has been issued

amountnumber double required

Total invoice amount

amountPaidnumber double required

Amount paid

isArchivedboolean

Whether the invoice is archived

sharedWithPortalboolean

Whether the invoice is shared with portal

calculationMethodstring required

Calculation method (e.g., LINE_ITEMS)

percentagenumber double nullable

Percentage if applicable

baseAmountnumber double nullable

Base amount if applicable

createdAtstring date-time required

Creation timestamp

updatedAtstring date-time required

Last update timestamp

Changes

No recorded changes to this operation across all 1 revision of this API.