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

Authentication

x-api-keystring
API Key authentication via header

Request

This endpoint expects an object.
recordIdintegerRequired>=1
Project ID the bill belongs to
calculationMethodenumRequired

Calculation method. Cannot be changed after creation.

  • LINE_ITEMS: requires lineItems array; allows issueDate and status
  • PERCENTAGE: requires percentage; issueDate and status are not allowed
Allowed values:
lineItemslist of objectsOptional

Required when calculationMethod is LINE_ITEMS. unitCost must be greater than 0. unitPrice may be negative for discounts.

percentagedoubleOptional0-100

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

dueDatestringOptionalformat: "date-time"

Due date (ISO 8601 datetime string)

issueDatestringOptionalformat: "date-time"

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

statusenumOptional

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

Allowed values:
descriptionstring or nullOptional
Bill description

Response

Bill created successfully
idinteger
Bill identifier
statusenum
Bill status
amountdouble
Total bill amount
amountPaiddouble
Amount paid
calculationMethodstring

Calculation method (LINE_ITEMS or PERCENTAGE)

createdAtstringformat: "date-time"
Creation timestamp
updatedAtstringformat: "date-time"
Last update timestamp
billNumberinteger
Unique bill number
descriptionstring or null
Bill description
typeenum or null
Document type
Allowed values:
basedOnIdinteger or null
ID of the record this bill is based on
basedOnUidinteger or null
UID of the record this bill is based on
dueDatestringformat: "date-time"
Due date
issueDatestring or nullformat: "date-time"
Issue date
isArchivedboolean
Whether the bill is archived
percentagedouble or null
Percentage if calculationMethod is PERCENTAGE
baseAmountdouble or null
Base amount if calculationMethod is PERCENTAGE
accountobject or null
recordobject or null
lineItemslist of objects

Errors

400
Bad Request Error
401
Unauthorized Error