List the lines of an invoice
AI agents: read /llms.txt; add .md to any page URL. This page as Markdown: /reference/invoice-line-items/v2-invoice-item-index.md. Index of every page and the rules for every call: /llms.txt. Guides and concepts in one file: /llms-full.txt. OpenAPI: /openapi.json.
GET/
Returns every line of an invoice: billed sales order lines, shipping fees, discounts and the tax line. Not paged, and in no set order: sort by position.
product.type |
What it is |
|---|---|
order_item |
Bills a line of the sales order (any kind of product line). Name and unit price come from that line. |
shipment_fee |
A shipping charge with its own price. |
invoice_discount |
A discount, as a percentage or a fixed amount. |
user_tax |
Tax from one of your tax presets. |
override_tax |
A tax you set by hand: a fixed amount, a percentage, or tax exempt. |
auto_tax |
US Auto Tax, calculated by YoPrint's tax provider. |
The sales order line kinds (db_catalog, user_simple, db_variant, custom, fee) are not invoice kinds: to bill one, add an order_item line that points at it.
Path parameters
Your team slug, shown as Team ID next to your API key in Profile.
- Example
your-team
- Example
The invoice's
id(a hash id), as its answers show it. Its unique key (ordinv_...) also works, but API answers don't include it.- Example
cBRpSf5nw6upt5
- Example
Request body
This operation takes no request body.
Response
200Successful response.
Fields of each item (15)
_metaobjectRead-only:
id,type,invoice_id,lock_version,from_legacy,position_hash.auto_invoice_managedbooleanYoPrint manages this line (Auto Invoice).
external_idsarray of objectsLinks to external systems; empty for lines made in YoPrint.
external_typestring | nullfrom_legacybooleanidstringThe invoice line.
invoice_idstringThe invoice.
is_externalbooleanlock_versionintegerSend it back on Update an invoice line to detect a concurrent change.
positionintegerpricingobjectAbsent on tax and discount lines.
system(sales order lines):_meta.unit_priceis the price copied from the sales order line and_meta.subtotalis that price × this line's quantity.fee(shipping fees):product.totalis the fee. Prices come at the stored scale (6 decimal places);_meta.subtotalat the combined scale of price × quantity (compacted when large). Always readdp.Child fields (1)
typestring- One of:
"system","fee"
- One of:
productobjectChild fields (3)
_metaobjectRead-only details, always an object (with
editable_fields_on_update); fororder_item,parentdescribes the sales order line.propertiesobjectThe kind's fields; for
order_item,idis the sales order line. A discount's percentage or amount comes back astotal(you send it asrate).typestring- One of:
"order_item","shipment_fee","invoice_discount","user_tax","override_tax","auto_tax","invoice_surcharge"
- One of:
quantityobjectAbsent on tax and discount lines.
Child fields (2)
typestring- Always
"unit"
- Always
totaldecimal pairThe quantity. A decimal pair: the amount is
value÷ 10^dp({ "value": 1250, "dp": 2 }is 12.50). Readdpevery time: it can differ between fields and records.- See Money and quantities.
taxobjectAbsent on tax and discount lines. YoPrint adds it by default only to sales order lines (
taxable); other lines have it only when it was sent.Child fields (1)
typestring- One of:
"taxable","non_taxable"
- One of:
typestringSame as
product.type.
Errors
401The API key is missing or wrong (
unauthenticated).403You are not allowed to do this.
api_access_not_in_plan: your team's plan doesn't include API access (Pro and above, with an active subscription or trial), so every request answers this until the team upgrades. When your role lacks the permission the operation needs, the body is only{"message": "Insufficient Permission"}. Other refusals use the error envelope, withunauthorizedoruser_is_not_authorized.404Not found.
page_not_found: the team slug is unknown, you are not a member of the team, or an id in the path is not one of this team's.code: null, with a message that starts "No query results for": there is no record with that id.- When
- The invoice isn't your team's.
- Fix
- Check the invoice id.
Related
- POSTAdd a line to an invoice
/v2/ api/ store/ {team_slug}/ v2/ invoice/ {unique_key}/ item - POSTAdd, change and remove invoice lines at once
/v2/ api/ store/ {team_slug}/ v2/ invoice/ {unique_key}/ item/ bulk - GETGet an invoice
/v2/ api/ store/ {team_slug}/ v2/ invoice/ {unique_key}
