For AI agents: a documentation index is available at the root level at /llms.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
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 or sections; allows issueDate and status
PERCENTAGE: requires percentage; issueDate, status, lineItems, and sections are not allowed
Allowed values:
lineItemslist of objectsOptional
Required when calculationMethod is LINE_ITEMS and sections is not provided.
unitCost must be greater than 0. unitPrice may be negative for discounts.
May be combined with sections (a catalogItemId may appear only once across both).
sectionslist of objectsOptional
Required when calculationMethod is LINE_ITEMS and lineItems is not provided.
Grouped line items with named sections. May be combined with lineItems (ungrouped items).
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
billNumberinteger
Unique bill number
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
descriptionstring or nullOptional
Bill description
basedOnIdinteger or nullOptional
ID of the record this bill is based on
basedOnUidinteger or nullOptional
UID of the record this bill is based on
dueDatestringOptionalformat: "date-time"
Due date
issueDatestring or nullOptionalformat: "date-time"
Issue date
isArchivedbooleanOptional
Whether the bill is archived
percentagedouble or nullOptional
Percentage if calculationMethod is PERCENTAGE
baseAmountdouble or nullOptional
Base amount if calculationMethod is PERCENTAGE
accountobject or nullOptional
recordobject or nullOptional
lineItemslist of objectsOptional
Errors
400
Bad Request Error
401
Unauthorized Error
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)