Skip to content

Invoices

Open .md

API reference Invoices and payments

Invoices bill some or all of a sales order or quote. One order can have many; with Auto Invoice on, YoPrint automatically keeps one invoice updated to match the order's lines and shipping fees. Payments recorded on the order are allocated to its invoices.

Learn more: Invoices and payments · Invoice an order

11 operations

  • POSTCreate an invoice for a sales order/v2/api/store/{team_slug}/v2/sales_order/{unique_key}/invoiceCreates an invoice for an order, optionally with its lines in the same call.
  • POSTFilter invoices/v2/api/store/{team_slug}/v2/invoice/filterReturns one page of your team's invoices that match the filters, newest first unless you sort.
  • GETList the invoices of a sales order/v2/api/store/{team_slug}/v2/sales_order/{unique_key}/invoiceReturns the invoices of an order with their lines.
  • POSTList invoice lines for export/v1/api/store/{team_slug}/sales_order/invoices/export_all_sales_order_invoice_itemReturns the invoice lines that come from order lines, one row per line, as JSON in data, for a date range.
  • POSTList invoices for export/v1/api/store/{team_slug}/sales_order/invoices/export_listReturns invoice rows as JSON in data, one per invoice, for a date range: the invoice CSV export's columns plus a few more.
  • GETGet an invoice/v2/api/store/{team_slug}/v2/invoice/{unique_key}An invoice bills some or all of a sales order (or quote).
  • PUTUpdate an invoice/v2/api/store/{team_slug}/v2/invoice/{unique_key}Changes an invoice's header (number, issue date, addresses) and, in the same save, its lines, its tax and the order of its lines.
  • PUTChange the tax on an invoice/v2/api/store/{team_slug}/v2/invoice/{unique_key}/tax-selectionSets, changes or removes an invoice's tax line.
  • DELETEDelete an invoice/v2/api/store/{team_slug}/v2/invoice/{unique_key}Deletes an invoice and its lines.
  • POSTDownload invoices as one PDF/v1/api/store/{team_slug}/invoice/export_pdfReturns one PDF with up to 100 invoices, made while you wait (<date and time> - invoices.pdf, shown inline).
  • POSTExport invoices as CSV/v1/api/store/{team_slug}/sales_order/invoices/exportDownloads a CSV file of invoices.

Legacy and internal (4)

Prefer the operations above. Legacy operations name their replacement; internal ones are built for YoPrint's own apps.

  • GETList invoices (v1)Legacy · deprecated/v1/api/store/{team_slug}/invoiceReturns one page of your team's invoices of saved, non-draft sales orders and quotes (invoices of deleted, draft or autosaved orders, and deleted invoices, are left out).
  • GETGet an invoice (v1)Legacy · deprecated/v1/api/store/{team_slug}/invoice/{hash_id}Returns one invoice by its hash id.
  • PUTChange an invoice number (v1)Legacy · deprecated/v1/api/store/{team_slug}/invoice/{hash_id}Sets only the invoice number (scoped_id); nothing else on the invoice can change here.
  • PATCHChange an invoice number (v1) (same as PUT)Legacy · deprecated/v1/api/store/{team_slug}/invoice/{hash_id}Sets only the invoice number (scoped_id); nothing else on the invoice can change here.