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.
recordId
Project ID the bill belongs to
calculationMethod
Calculation method. Cannot be changed after creation.
LINE_ITEMS: requireslineItemsarray; allowsissueDateandstatusPERCENTAGE: requirespercentage;issueDateandstatusare not allowed
Allowed values:
lineItems
Required when calculationMethod is LINE_ITEMS.
unitCost must be greater than 0. unitPrice may be negative for discounts.
percentage
Required when calculationMethod is PERCENTAGE. Must be between 0 and 100.
dueDate
Due date (ISO 8601 datetime string)
issueDate
Issue date (ISO 8601 datetime string). LINE_ITEMS bills only.
When provided, status must also be provided and must not be DRAFT.
status
Bill status. LINE_ITEMS bills only, and only when issueDate is also provided.
Omit to default to DRAFT.
Allowed values:
description
Bill description
Response
Bill created successfully
id
Bill identifier
status
Bill status
amount
Total bill amount
amountPaid
Amount paid
calculationMethod
Calculation method (LINE_ITEMS or PERCENTAGE)
createdAt
Creation timestamp
updatedAt
Last update timestamp
billNumber
Unique bill number
description
Bill description
type
Document type
Allowed values:
basedOnId
ID of the record this bill is based on
basedOnUid
UID of the record this bill is based on
dueDate
Due date
issueDate
Issue date
isArchived
Whether the bill is archived
percentage
Percentage if calculationMethod is PERCENTAGE
baseAmount
Base amount if calculationMethod is PERCENTAGE
account
record
lineItems
Errors
400
Bad Request Error
401
Unauthorized Error
