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.
Create Sales Invoice
Create a sales invoice for a sales order — as a draft, or issued straight away with `issue: true` (issuing also needs the `sales_invoices.issue` permission).
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.
List Uninvoiced Shipments
Shipped shipments of orders invoiced per shipment or manually that no invoice covers yet (and were not marked 'don't invoice'). A shipment whose units are all already billed by another invoice — for example the still-issued invoice of a shipment voided after it was invoiced — is not listed; it reappears once that invoice is voided or credited, oldest shipped first unless `sort` says otherwise. `days_waiting` is the number of days since the shipment shipped.
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).
Update Sales Invoice
Edit a draft invoice: its lines (same shape as on create — the list replaces the draft's lines), invoice date, payment term, due date, notes and printed terms. Issued invoices cannot be edited — correct them with a credit note or a supplementary invoice.
Delete Sales Invoice
Delete a draft invoice. Issued invoices are voided, never deleted.
Get Sales Invoice Activity Log
Change history of an invoice, newest first.
Preview Sales Invoice Totals
Compute what a create request would produce — lines, fee allocation, subtotal, tax, total, due date and number preview — without saving anything. Takes the same body as Create Sales Invoice, including `source: deposit` with `deposit_amount` or `deposit_percent` (`issue` is ignored); line problems are returned in `errors` instead of failing the request.
Refresh Sales Invoice from Order
Rebuild a draft invoice's lines from its sales order's current billable state and prices: quantities are clipped to what is still billable, prices and discounts are re-read from the order, and fees are re-allocated by the order's fee policy. A draft linked to shipments is rebuilt from those shipments. Use it after the order changed under a draft (a price correction, a cancelled line). No request body.
Create Supplementary Sales Invoice
Bill an extra amount on this invoice's sales order — for under-billing such as a price adjustment or a missed charge — without touching the issued invoice. Adds a one-off revenue charge of `amount` to the order and creates a new invoice for exactly that charge, as a draft or issued straight away.
Update Sales Invoice Tags
Replace the invoice's tags with the given list. Send the complete list every time — tags missing from it are removed, and an empty list clears them all. New tag names are created on the fly. Works on any invoice, issued or not.
Issue Sales Invoice
Issue a draft: assigns the invoice number, freezes lines, totals, terms and due date, posts it to the ledger (and on to the connected accounting system), applies any unallocated order payments, and sends the EDI 810 / customer email when configured. `invoice_date` (Y-m-d, optional) must be in an open accounting period — issued invoices are never redated.
Void Sales Invoice
Void an issued invoice. `reason` is required. Allowed only while nothing is paid or credited on it, its date is in an open period and the trading partner has not accepted its 810; otherwise issue a credit note. The number is kept and never reused; linked shipments become billable again.
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.
Download Sales Invoice PDF
The invoice as a PDF (application/pdf, inline), rendered from the account's Sales Invoice PDF template. For an order invoiced as a whole (kind `order_mirror`) the order's invoice PDF is returned, unchanged.
Create Credit Note for Sales Invoice
Create a draft sales credit against the invoice, prefilled with the invoice's creditable lines. Returns the new credit's ID.
Record Sales Invoice Payment
Record a payment against an issued invoice. `amount` (required, non-zero), `payment_date` (required), `payment_type_id` (required), `reference` (optional). An amount above the balance due becomes an overpayment credit for the customer, linked to the invoice (on a consolidated invoice the credit belongs to the customer rather than to one order). Returns the updated invoice.
Allocate Payment to Sales Invoice
Apply part of an existing payment of the invoice's sales order (e.g. an on-account deposit) to this invoice. `payment_id` and `amount` (> 0) are required. Over-allocating the payment or the invoice is refused.
Delete Sales Invoice Payment Allocation
Take an allocation back: the amount returns to the order's on-account balance. Refused once the allocation has been pushed to the accounting system and locked there.
Bulk Issue Sales Invoices
Issue several invoices at once: send `ids[]` (up to 5,000), or `all: true` with `filters` (the list query, e.g. {'filter': {'status': 'draft'}}) to act on every matching invoice. Each invoice is processed on its own; failures are listed in `data.errors`. Only drafts are issued.
Bulk Email Sales Invoices
Email several invoices at once: send `ids[]` (up to 5,000), or `all: true` with `filters` (the list query, e.g. {'filter': {'status': 'draft'}}) to act on every matching invoice. Each invoice is processed on its own; failures are listed in `data.errors`. Each invoice goes to its customer's invoice email (else billing email) unless `to[]` is given; `cc[]` and `message` are optional.
Bulk Archive Sales Invoices
Archive several invoices at once: send `ids[]` (up to 5,000), or `all: true` with `filters` (the list query, e.g. {'filter': {'status': 'draft'}}) to act on every matching invoice. Each invoice is processed on its own; failures are listed in `data.errors`.
Bulk Unarchive Sales Invoices
Unarchive several invoices at once: send `ids[]` (up to 5,000), or `all: true` with `filters` (the list query, e.g. {'filter': {'status': 'draft'}}) to act on every matching invoice. Each invoice is processed on its own; failures are listed in `data.errors`.
Bulk Void Sales Invoices
Void several invoices at once: send `ids[]` (up to 5,000), or `all: true` with `filters` (the list query, e.g. {'filter': {'status': 'draft'}}) to act on every matching invoice. Each invoice is processed on its own; failures are listed in `data.errors`. `reason` is required.
Bulk Download Sales Invoice PDFs
Download the PDFs of several invoices at once: send `ids[]` (up to 5,000), or `all: true` with `filters` (the list query, e.g. {'filter': {'status': 'draft'}}) to act on every matching invoice.
Export Sales Invoices
Export invoices to XLSX or CSV — one row per invoice (`content_mode=summary`) or one row per invoice line (`line_items`). Up to 1,000 rows download directly; larger exports run in the background and return a `tracked_job_log_id` to poll, then download with Download Sales Invoice Export.
Download Sales Invoice Export
Download a finished background export by its file name (from the job result).
Get AR Aging Report
Open sales-invoice balances per customer, bucketed by days past due — current, 1–30, 31–60, 61–90, 90+ — as of a date, with totals.
List Sales Invoice Notes
Internal notes on an invoice, pinned first.
Create Sales Invoice Note
Add an internal note (`note`, required, up to 10,000 characters).
Toggle Sales Invoice Note Pin
Pin or unpin a note.
Delete Sales Invoice Note
Delete a note.
List Sales Invoice Documents
Every file attached to the invoice, newest first, with who uploaded it. `file_url` streams the file.
Upload Sales Invoice Document
Attach a file to the invoice. Send as `multipart/form-data`.
Update Sales Invoice Document Description
Change an attached file's description — the only editable field; upload a new file to replace the file itself. `description` is required in the body and may be null to clear it (up to 2,000 characters).
Delete Sales Invoice Document
Remove an attached file from the invoice and delete it.
Download Sales Invoice Document File
Stream an attached file. The response is the raw file, not JSON — `Content-Type` is the stored file's own type (e.g. `application/pdf`, `image/jpeg`).
Get Sales Order Billing Summary
How a sales order is invoiced: its invoicing policy and where it came from, invoice status and a one-line verdict, ordered / invoiced / paid / credited totals, one lane per shipment (invoiced, ready to invoice, skipped, or voided after invoicing), per-line reconciliation (ordered, shipped, invoiced, credited, billable), fee remainders and the order's invoices.
Get Sales Order Invoice Preview
What can be invoiced on an order right now: billable quantities per line (shipped and ordered; `bundle_id` / `bundle_name` name the bundle a component line belongs to), fee remainders with the default allocation, shippable shipments and their quantities, the default invoice date, payment term, due date and number preview, and the order's on-account payments.
Bulk Create Sales Invoices from Shipments
Create one invoice per selected uninvoiced shipment of the order (`fulfillment_ids[]`, 1–200). The invoices are issued when per-shipment invoices auto-issue and the user may issue invoices; otherwise they are left as drafts.
Settle Sales Order Billing
Mark the order's billing as settled — no more invoices are expected (e.g. the rest will never ship). Returns the billing summary.
Unsettle Sales Order Billing
Clear the 'billing settled' mark. Returns the billing summary.
Update Sales Order Invoicing Policy
Change how one order is invoiced: `invoicing_policy` = per_order, per_shipment, manual or consolidated. Allowed only before anything has been issued or posted for the order. Returns the billing summary.
Skip Shipment Invoice
Mark a shipment 'don't invoice' (e.g. a free replacement). `reason` is required and logged on the order.
Undo Skip Shipment Invoice
Make a skipped shipment invoiceable again.
Get Sales Invoice Settings
Invoicing settings: default invoicing policy, invoice number format and series, per-shipment auto-issue, fee allocation, invoice date basis, email on issue, overdue reminder days, and each sales channel's overrides (channels whose policy is forced to per-order say why).
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.