bills

Create Bill

Create a new bill.

Required fields:

  • recordId: Project ID (the project must exist first)
  • calculationMethod: Must be "LINE_ITEMS" or "PERCENTAGE"
  • lineItems: Array of at least one line item if calculationMethod is "LINE_ITEMS"
  • percentage: Percentage if calculationMethod is "PERCENTAGE"

Line item rules for bills:

  • unitCost must be greater than 0 (strictly positive — bills represent vendor costs)
  • unitPrice may be negative (negative values represent discounts)

Optional fields:

  • dueDate: ISO 8601 datetime string
  • description: Bill description
  • issueDate: ISO 8601 datetime string
post/bills

Request

  • Base URL: https://api.coperniq.io/v1
  • URL: https://api.coperniq.io/v1/bills
  • Auth: API key in header x-api-key

Request body

recordIdinteger required

Project ID the bill belongs to

calculationMethod'LINE_ITEMS' | 'PERCENTAGE' required

Calculation method. Cannot be changed after creation.

  • LINE_ITEMS: requires lineItems or sections; allows issueDate and status
  • PERCENTAGE: requires percentage; issueDate, status, lineItems, and sections are not allowed
percentagenumber double

Required when calculationMethod is PERCENTAGE. Must be between 0 and 100.

dueDatestring date-time

Due date (ISO 8601 datetime string)

issueDatestring date-time

Issue date (ISO 8601 datetime string). LINE_ITEMS bills only. When provided, status must also be provided and must not be DRAFT.

status'SENT' | 'PARTIALLY_PAID' | 'PAID'

Bill status. LINE_ITEMS bills only, and only when issueDate is also provided. Omit to default to DRAFT.

descriptionstring nullable

Bill description

Response

Bill created successfully

idinteger required

Bill identifier

billNumberinteger required

Unique bill number

descriptionstring nullable

Bill description

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

Bill status

basedOnIdinteger nullable

ID of the record this bill is based on

basedOnUidinteger nullable

UID of the record this bill is based on

dueDatestring date-time

Due date

issueDatestring date-time nullable

Issue date

amountnumber double required

Total bill amount

amountPaidnumber double required

Amount paid

isArchivedboolean

Whether the bill is archived

calculationMethodstring required

Calculation method (LINE_ITEMS or PERCENTAGE)

percentagenumber double nullable

Percentage if calculationMethod is PERCENTAGE

baseAmountnumber double nullable

Base amount if calculationMethod is PERCENTAGE

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.