Get an invoice
AI agents: read /llms.txt; add .md to any page URL. This page as Markdown: /reference/invoices/v2-invoice-show.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/
An invoice bills some or all of a sales order (or quote). One order can have many invoices; each line of an invoice points at a line of the order, or is a shipping fee, a discount or the tax. Invoices have no status: they are paid or unpaid (is_paid) as payments recorded on the order are allocated to them.
Returns the invoice with its lines (items), its sales order (order), and its billing and shipping addresses. Money comes in two encodings:
- Decimal pairs (
total,cart_item_subtotal,shipment_subtotal,shipment_tax_subtotal,discount_subtotal,tax_subtotal,credit_card_surcharge): the amount isvalue÷ 10^dp({ "value": 3397500, "dp": 4 }is 339.75). Readdpevery time: invoice totals usually usedp4 and line prices usedp6. - Thousandths, an older encoding (
paid_amount,calc_deposit_total):10000is 10.00. Usually a whole number; an amount finer than a thousandth comes back as a number with a fraction (1234.5is 1.2345), or as a string ("1234.5") when you sendX-Yoprint-Decimal-Format: exact-v1. See Money and quantities. Thecalc_*totals are deprecated copies of the pairs: use the pairs.
is_valid is false when the invoice needs fixing (no lines, lines but no tax line, or a customer that differs from the order's). pdf_url holds PDF links that carry their own long-lived access token: don't publish them.
The path takes the invoice id (a hash id).
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.
An invoice. Amounts are decimal pairs at the stored scale (4 decimal places for invoice totals), except
paid_amountandcalc_deposit_total(thousandths). Thecalc_*totals are deprecated copies of the decimal-pair ones.Child fields (43)
auto_invoice_managedbooleanYoPrint keeps this invoice in step with the order (Auto Invoice).
bill_to_statusstringHow Bill To compares with the order's.
- One of:
"okay","empty","diff_from_order","diff_from_customer"
- One of:
billing_addressobject | nullAn address.
Child fields (10)
address1string | nulladdress2string | nullcitystring | nullcountrystring | nullcountry_codestring | nullidstringThe address.
labelstring | nullpostcodestring | nullstatestring | nullstate_codestring | null
billing_address_idstring | nullBill To.
calc_deposit_totalinteger | number | string | nullThe order's deposit amount. Thousandths, an older encoding:
12500is 12.50. Usually a whole number; an amount finer than a thousandth comes back as a number with a fraction (1234.5is 1.2345), or as a string ("1234.5") when you sendX-Yoprint-Decimal-Format: exact-v1. See Money and quantities.cart_item_subtotaldecimal pairBilled sales order lines and shipping fees (price × quantity);
shipment_subtotalis the shipping part of it.total=cart_item_subtotal−discount_subtotal+tax_subtotal(+credit_card_surcharge). At the stored scale (4 decimal places). A decimal pair: the amount isvalue÷ 10^dp({ "value": 1250, "dp": 2 }is 12.50). Readdpevery time: it can differ between fields and records.- See Money and quantities.
created_atstring (date-time)credit_card_surchargedecimal pairA card surcharge added by a card payment; zero when there is none. Always sent. 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.
customerobject | nullThe customer (the full customer record).
deposit_duestring (date-time) | nullFrom the order. ISO 8601 with offset, or null.
deposit_requiredboolean | integer | nullFrom the order.
discount_subtotaldecimal pairDiscounts. 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.
external_typestring | nullfrom_legacybooleanfull_amount_duestring (date-time) | nullFrom the order. ISO 8601 with offset, or null.
idstringThe invoice.
is_externalbooleanis_paidbooleanPaid amount covers the total (also true for a zero total).
is_validbooleanFalse when the invoice needs fixing: no lines, lines without a tax line, or a customer that differs from the order's.
issue_datestring (date-time) | nullIssue date. ISO 8601 with offset, or null.
itemsarray of objectsThe lines. Sort by
position.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.
lock_versionintegerorderobjectThe sales order or quote in the v2 order shape: its header fields, with
statusandassigned_users, but noitems.order_idstringThe sales order or quote it bills.
order_object_typestring | nullsales_orderorquote.order_quotebooleanThe order is a quote.
order_scoped_idstring | nullThe order number.
paid_amountinteger | number | string | nullAllocated payments. Thousandths, an older encoding:
12500is 12.50. Usually a whole number; an amount finer than a thousandth comes back as a number with a fraction (1234.5is 1.2345), or as a string ("1234.5") when you sendX-Yoprint-Decimal-Format: exact-v1. See Money and quantities.pdf_urlarray of objectsPDF links.
Fields of each item (3)
labelstringobject_typestringurlstringA download link with its own long-lived access token: don't publish it.
scoped_idstring | nullThe invoice number.
ship_to_statusstring- One of:
"okay","empty","diff_from_order","diff_from_customer"
- One of:
shipment_subtotaldecimal pairShipping fees (already in
cart_item_subtotal). A decimal pair: the amount isvalue÷ 10^dp({ "value": 1250, "dp": 2 }is 12.50). Readdpevery time: it can differ between fields and records.- See Money and quantities.
shipment_tax_subtotaldecimal pairThe tax on shipping (included in
tax_subtotal). A decimal pair: the amount isvalue÷ 10^dp({ "value": 1250, "dp": 2 }is 12.50). Readdpevery time: it can differ between fields and records.- See Money and quantities.
shipping_addressobject | nullAn address.
- Same fields as
data.billing_address.
- Same fields as
shipping_address_idstring | nullShip To.
tax_subtotaldecimal pairTax. 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.
totaldecimal pairThe invoice total. 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.
versionintegerDeprecated: use
shipment_subtotal, the same amount. Thousandths, an older encoding:12500is 12.50. Usually a whole number; an amount finer than a thousandth comes back as a number with a fraction (1234.5is 1.2345), or as a string ("1234.5") when you sendX-Yoprint-Decimal-Format: exact-v1. See Money and quantities.Deprecated: use
discount_subtotal, the same amount. Thousandths, an older encoding:12500is 12.50. Usually a whole number; an amount finer than a thousandth comes back as a number with a fraction (1234.5is 1.2345), or as a string ("1234.5") when you sendX-Yoprint-Decimal-Format: exact-v1. See Money and quantities.Deprecated: use
cart_item_subtotal, the same amount. Thousandths, an older encoding:12500is 12.50. Usually a whole number; an amount finer than a thousandth comes back as a number with a fraction (1234.5is 1.2345), or as a string ("1234.5") when you sendX-Yoprint-Decimal-Format: exact-v1. See Money and quantities.Deprecated: use
tax_subtotal, the same amount. Thousandths, an older encoding:12500is 12.50. Usually a whole number; an amount finer than a thousandth comes back as a number with a fraction (1234.5is 1.2345), or as a string ("1234.5") when you sendX-Yoprint-Decimal-Format: exact-v1. See Money and quantities.Deprecated: use
total, the same amount. Thousandths, an older encoding:12500is 12.50. Usually a whole number; an amount finer than a thousandth comes back as a number with a fraction (1234.5is 1.2345), or as a string ("1234.5") when you sendX-Yoprint-Decimal-Format: exact-v1. See Money and quantities.
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, or was deleted.
- Fix
- Use an id from Filter invoices or the order's invoice list.
Notes
- Send the header
X-Yoprint-Decimal-Format: exact-v1so large amounts come back exactly (as digit strings when needed).
Related
- PUTUpdate an invoice
/v2/ api/ store/ {team_slug}/ v2/ invoice/ {unique_key} - GETList the lines of an invoice
/v2/ api/ store/ {team_slug}/ v2/ invoice/ {unique_key}/ item - GETList the invoices of a sales order
/v2/ api/ store/ {team_slug}/ v2/ sales_order/ {unique_key}/ invoice - POSTFilter invoices
/v2/ api/ store/ {team_slug}/ v2/ invoice/ filter
