Skip to main content

Sales Invoices

📄️List Sales Invoices

Paginated sales invoices with filters and sorts. Orders invoiced as a whole (per-order policy) appear as one invoice of kind `order_mirror` whose figures are the order's. Each row carries `warnings` — `[{code, message}]` review notes on a draft explaining why it was not issued automatically (`locked_period`: the shipment date falls in a locked accounting period; `edi_price_mismatch`: a price differs from the EDI purchase order); empty otherwise. Money values are 2-decimal strings; dates Y-m-d; timestamps ISO-8601 UTC.

📄️Get Sales Invoice Summary

KPI figures for the invoices matching the same filters as List Sales Invoices: outstanding, overdue and due-within-7-days balances and counts, the number of shipped-but-uninvoiced shipments (the same shipments List Uninvoiced Shipments returns), and column totals (`filtered_totals`, null when the filter matches more than 20,000 invoices). `matching_count` is how many invoices match the filters; `amount_sort_available` is false above 20,000 matches, when List Sales Invoices refuses a `total` / `balance_due` sort or filter.

📄️Get Sales Invoice

One invoice with its lines, linked shipments, payment allocations, applied credit notes, totals, addresses, terms, accounting and EDI state, and `permissions` — what the current user may do next, with the plain-language reason when voiding is not possible (`void_blocked_reason`). Also returns `tags` (string[]), `documents_count` (attached files; always 0 on an order invoice, whose files live on the sales order) and `warnings` (`[{code, message}]` review notes on a draft that was not issued automatically).

📄️Email Sales Invoice

Email the invoice PDF to the customer. `to[]` (1–20 email addresses, required), `cc[]` (optional), `subject` and `message` (optional — replace the template's), `template_id` (optional sales-invoice email template; defaults to the 'Invoice Issued' template). Placeholders such as {invoice_number}, {amount_due}, {due_date}, {days_overdue} and {customer_name} are filled in. The send is logged on the customer's AR communications. Drafts and void invoices cannot be emailed.

📄️Update Sales Invoice Settings

Save the invoicing settings. Fields: `default_policy` (per_order, per_shipment, manual), `number_format` (tokens {order}, {seq}, {seq:3}, {series}, {series:6}, {series:numeric15}; must include {seq} or {series}), `number_series_next` (≥ 1), `auto_issue_shipment_invoices`, `fee_allocation` (prorate, first_invoice, last_invoice, separate_invoice), `invoice_date_basis` (ship_date, issue_date), `email_on_issue`, `overdue_reminders[]` (days after due, 1–365), `invoice_awaiting_info_shipments`, `auto_void_on_shipment_void`, and `channels[] {id, invoicing_policy, fee_allocation, number_format}` (null clears an override). Formats are checked against QuickBooks' 21-character and Walmart's 15-digit limits; a bad channel format is reported on `channels.N.number_format`. Changing a default never changes existing orders.