Create Invoice

Create a new invoice. Required fields: - `recordId`: Project or account ID (the record must exist first) - `calculationMethod`: Must be "LINE_ITEMS" or "PERCENTAGE" Conditionally required: - `lineItems`: Required when `calculationMethod` is "LINE_ITEMS" (at least one item) - `percentage`: Required when `calculationMethod` is "PERCENTAGE" Optional fields: - `issueDate`: ISO 8601 datetime string - `dueDate`: ISO 8601 datetime string - `status`: Initial invoice status (defaults to DRAFT) - `description`: Invoice description

Authentication

x-api-keystring
API Key authentication via header

Request

This endpoint expects an object.
recordIdintegerRequired>=1
Project or account ID
calculationMethodenumRequired
Calculation method
Allowed values:
lineItemslist of objectsOptional

Required when calculationMethod is LINE_ITEMS. Array of line items (at least one required).

percentagedoubleOptional>=0

Required when calculationMethod is PERCENTAGE.

statusenumOptional

Initial invoice status (defaults to DRAFT)

issueDatestringOptionalformat: "date-time"

Issue date (ISO 8601 datetime string)

dueDatestringOptionalformat: "date-time"

Due date (ISO 8601 datetime string)

descriptionstring or nullOptional
Invoice description

Response

Invoice created successfully
idinteger
Invoice identifier
uidinteger
Unique invoice number
statusenum
Invoice status
amountdouble
Total invoice amount
amountPaiddouble
Amount paid
calculationMethodstring

Calculation method (e.g., LINE_ITEMS)

createdAtstringformat: "date-time"
Creation timestamp
updatedAtstringformat: "date-time"
Last update timestamp
descriptionstring or null
Invoice description
typeenum or null
Invoice type
Allowed values:
basedOnIdinteger or null
ID of the record this invoice is based on
basedOnUidinteger or null
UID of the record this invoice is based on
dueDatestringformat: "date-time"
Due date
isArchivedboolean
Whether the invoice is archived
sharedWithPortalboolean
Whether the invoice is shared with portal
percentagedouble or null
Percentage if applicable
baseAmountdouble or null
Base amount if applicable
accountobject or null
recordobject or null
lineItemslist of objects

Errors

400
Bad Request Error
401
Unauthorized Error