Create invoice

POST/api/v1/invoices

Create a new invoice for a customer. Optionally include 'recurring' config to also create a recurring template.

Operation ID: create_invoice_api_v1_invoices_post·View as markdown·OpenAPI slice

Authentication

Bearer token authentication. Pass your DayZero API token in the Authorization header and the target business UUID in x-business-id.

Request body

customer_idstringrequired

UUID of the customer to invoice.

currencystring

Currency for the invoice (USD, CAD, AUD, EUR, or GBP). Defaults to business default.

line_itemsarray · LineItemRequestrequiredLineItemRequest

Line items (at least one required). Can be variant-linked or custom.

8 fields
variant_idstring

UUID of product variant. Omit or use 'custom' for manual line items.

catalog_item_idstring

UUID of a Products & Services catalog item (Books). Mutually exclusive with a real variant_id. When set, description and unit_price default from the catalog item; provide unit_price to override the catalog price for this invoice.

quantityinteger

Quantity ordered. Defaults to 1 for custom items.

descriptionstring

Line item description (required for custom items).

unit_priceinteger

Price per unit in cents. Required for custom items. For variant-linked items this is an OPTIONAL override - if omitted, the current catalog price is used; if provided, the catalog price is ignored for this invoice. The override is snapshotted onto the invoice line item.

amountinteger

Total amount in cents. Deprecated for custom items - use unit_price instead. For backward compatibility, if unit_price is not set, amount is treated as unit_price.

location_idstring

Optional warehouse UUID to deduct this line from. Overrides the invoice's fulfillment_location_id and the business default. Ignored for custom (non-variant) lines.

notestring

Optional free-text note for this line item, shown alongside the description (e.g. internal context or a customer-facing clarification). Not used in pricing calculations.

due_datestringrequired

Payment due date in YYYY-MM-DD format.

issue_datestring

Optional 'Date of issue' in YYYY-MM-DD format — the date the invoice is dated and reported under. Backdates the invoice: it becomes the invoice's date in the app, the date its finalization journal entry posts on, and the issue date on the PDF and receipt in place of the system-generated one. Also accepted as 'invoice_date', which is what the update endpoint calls it.

invoice_numberstring

Optional invoice number to use instead of the next one from the business's auto-numbering — e.g. the number this invoice already carries in the system it is being migrated from. Must be unique within the business.

descriptionstring

Optional invoice description or notes.

fulfillment_location_idstring

Default warehouse UUID for inventory deductions when the invoice is delivered. Per-line location_id overrides this.

project_idstring

Optional UUID of a project (job) to link this invoice to. When the invoice is finalized, its revenue and COGS are attributed to this project for profitability reporting.

recurringInvoiceRecurringConfig

If provided, creates a recurring template for this invoice.

historicalboolean

Record an invoice that was already issued somewhere else, for backfilling books, rather than issuing a new one. The invoice is written locally as a draft and never reaches Stripe, so it cannot be sent to or charged to the customer, and no Stripe account is required. It also lifts the rule that a due date must be in the future — a historical invoice normally came due in the past. Pair it with issue_date and invoice_number to preserve the date and number the invoice carried in the old system.

Responses

201Successful Response

successboolean
messagestring
codestring
dataInvoiceResponse

400Bad Request - Invalid input

401Unauthorized - Authentication required

403Forbidden - Insufficient permissions

422Validation Error

detailarray · ValidationErrorValidationError
5 fields
locarray · string | integerrequired
msgstringrequired
typestringrequired
inputobject
ctxobject