Ga naar hoofdinhoud
Versie: 1.x

Receipt Data Reference

WCPOS logicless HTML templates and thermal XML templates render from the same canonical receipt payload. Use Mustache dot paths such as {{order.number}}, {{store.name}}, and {{totals.total_display}}. Arrays are rendered with sections:

{{#lines}}
{{name}} x {{qty}} — {{line_total_display}}
{{/lines}}

The canonical contract is produced by the WCPOS receipt data builder on the server and mirrored by the offline receipt renderer in the app. Receipts open immediately from local data, then upgrade to the server response when it is available, so custom templates should use the fields below rather than PHP order methods.

Rendering rules

Currency fields

Numeric money fields are preserved as numbers and the renderer adds locale-aware _display fields for template output:

Numeric fieldDisplay field
totals.totaltotals.total_display
lines[].line_totallines[].line_total_display
payments[].amountpayments[].amount_display
tax_summary[].tax_amounttax_summary[].tax_amount_display

Prefer _display fields when printing receipts. Use numeric fields only for conditional sections or machine-readable output.

Tax display-aware fields

Several fields have inclusive and exclusive variants plus a display-side convenience value. The convenience value follows the store's cart tax display setting.

Convenience fieldInclusive fieldExclusive field
lines[].unit_pricelines[].unit_price_incllines[].unit_price_excl
lines[].unit_subtotallines[].unit_subtotal_incllines[].unit_subtotal_excl
lines[].line_subtotallines[].line_subtotal_incllines[].line_subtotal_excl
lines[].discountslines[].discounts_incllines[].discounts_excl
lines[].line_totallines[].line_total_incllines[].line_total_excl
fees[].totalfees[].total_inclfees[].total_excl
shipping[].totalshipping[].total_inclshipping[].total_excl
discounts[].totaldiscounts[].total_incldiscounts[].total_excl
totals.subtotaltotals.subtotal_incltotals.subtotal_excl
totals.discount_totaltotals.discount_total_incltotals.discount_total_excl
totals.totaltotals.total_incltotals.total_excl

Date objects

Date fields are objects with multiple preformatted variants. This avoids doing date formatting inside Mustache.

FieldDescription
datetime, date, timeDefault date/time strings
datetime_short, datetime_long, datetime_fullLocale-aware combined formats
date_short, date_long, date_fullLocale-aware date-only formats
date_ymd, date_dmy, date_mdyFixed-order date formats
weekday_short, weekday_longDay names
day, month, month_short, month_long, yearIndividual date parts

Available date objects: order.created, order.paid, order.completed, order.printed, and refunds[].date. order.printed is refreshed at render time, which is useful for reprints.

Top-level sections

SectionTypeDescription
orderobjectOrder identity, status, dates, note, and payment URL information
storeobjectStore identity, address, contact details, tax IDs, logo, hours, and footer text
cashierobjectUser who processed the order
customerobjectCustomer display name, addresses, and tax IDs
linesarrayProduct line items
feesarrayFee rows
shippingarrayShipping rows
discountsarrayCoupon/discount rows
totalsobjectOrder totals, payment totals, refund summary, and item counts
taxobjectTax display mode flags for section guards
tax_summaryarrayPer-rate tax summary rows
has_tax_summarybooleanConvenience guard for tax_summary
paymentsarrayPayment rows
refundsarrayRefund records applied to the order
fiscalobjectFiscal snapshot fields populated by fiscal integrations
presentation_hintsobjectFormatting and renderer hints
i18nobjectTranslated labels for bundled and custom templates

order

FieldTypeExample / description
order.idnumber1234
order.numberstringHuman-facing order number, e.g. "10045"
order.currencystringISO currency code, e.g. "USD"
order.customer_notestringCustomer/order note
order.wc_statusstringRaw WooCommerce status slug, e.g. "processing"
order.status_labelstringLocalised status label, including custom statuses
order.created_viastringSource/channel, e.g. "woocommerce-pos"
order.needs_paymentbooleanWhether a payment section should be shown
order.payment_urlstringOrder payment URL when available
order.createddate objectOrder creation date
order.paiddate objectPaid date, empty strings when not paid
order.completeddate objectCompleted date, empty strings when incomplete
order.printeddate objectRender-time print/reprint timestamp

store

FieldTypeExample / description
store.idnumberStore ID, or historical ID for deleted stores
store.namestringStore display name
store.address.address_1stringStreet address line 1
store.address.address_2stringSuite/unit line
store.address.citystringCity/locality
store.address.statestringState/region
store.address.postcodestringPostal code
store.address.countrystringISO country code
store.address_linesarrayPreformatted address lines; recommended for most templates
store.tax_idsarrayStructured business tax IDs; loop this instead of using a single tax ID
store.phonestringStore phone
store.emailstringStore email
store.logostring/nullStore logo URL or data URI
store.opening_hoursstring/nullCompact opening-hours text
store.opening_hours_verticalstring/nullMulti-line opening-hours block
store.opening_hours_inlinestring/nullComma-separated opening-hours text
store.opening_hours_notesstring/nullFree-text opening-hours notes
store.personal_notesstring/nullReceipt footer/personal note
store.policies_and_conditionsstring/nullRefund, returns, or terms text
store.footer_imprintstring/nullLegal footer imprint

Tax ID objects

store.tax_ids and customer.tax_ids contain objects with the same shape:

FieldTypeDescription
typestringIdentifier such as eu_vat, de_steuernummer, au_abn, br_cpf, us_ein, or other
valuestringTax ID value to print
countrystring/nullISO country code when known
labelstring/nullLocalised display label, resolved before rendering

Example:

{{#store.tax_ids}}
{{label}}: {{value}}
{{/store.tax_ids}}

cashier

FieldTypeExample / description
cashier.idnumberWordPress user ID, 0 when unknown
cashier.namestringCashier display name

customer

FieldTypeExample / description
customer.idnumber/nullCustomer ID, or null for guests
customer.namestringCustomer display name, or guest label
customer.billing_address.*objectWooCommerce billing address fields
customer.shipping_address.*objectWooCommerce shipping address fields
customer.tax_idsarrayStructured customer tax IDs snapshotted from the order

Common address keys include first_name, last_name, company, address_1, address_2, city, state, postcode, country, email, and phone.

lines

Loop with {{#lines}}...{{/lines}}.

FieldTypeDescription
keystringStable line key/order item ID
skustringProduct SKU
namestringProduct or line display name
qtynumberQuantity sold
qty_refundednumberQuantity refunded for this line
unit_subtotal / _incl / _exclnumberPre-discount unit price
unit_price / _incl / _exclnumberPost-discount unit price
line_subtotal / _incl / _exclnumberPre-discount line subtotal
discounts / _incl / _exclnumberDiscount amount as a positive value
line_total / _incl / _exclnumberFinal line total
total_refundednumberTotal refunded for this line as a positive value
taxesarrayPer-rate tax rows for this line
metaarrayOrder item meta as {key, value} pairs
attributesarrayProduct/variation attributes as {key, value} pairs

Formatted variants include unit_subtotal_display, unit_price_display, line_subtotal_display, discounts_display, line_total_display, and inclusive/exclusive _display variants.

fees and shipping

Loop with {{#fees}}...{{/fees}} and {{#shipping}}...{{/shipping}}.

FieldTypeDescription
labelstringFee label or shipping method name
method_idstringShipping method ID (shipping only)
total / _incl / _exclnumberDisplay-side, inclusive, and exclusive totals
taxesarrayPer-rate tax rows
metaarray{key, value} meta pairs

Formatted variants: total_display, total_incl_display, and total_excl_display.

discounts

Loop with {{#discounts}}...{{/discounts}}.

FieldTypeDescription
labelstringCoupon description or code fallback
codestringCoupon code
codesstringLegacy/display fallback for joined codes
total / _incl / _exclnumberDiscount amount as a positive value

Formatted variants: total_display, total_incl_display, and total_excl_display. Add your own minus sign in the template if you want discounts shown as negative rows.

totals

FieldTypeDescription
totals.subtotal / _incl / _exclnumberOrder subtotal before discounts
totals.discount_total / _incl / _exclnumberOrder discount total as a positive value
totals.tax_totalnumberTotal tax amount
totals.total / _incl / _exclnumberOrder grand total
totals.paid_totalnumberAmount paid/applied
totals.change_totalnumberChange returned to the customer
totals.refund_totalnumberTotal refunded as a positive value
totals.net_totalnumbertotal - refund_total, clamped to zero
totals.total_qtynumberSum of line item quantities
totals.line_countnumberCount of product line rows

Formatted variants include subtotal_display, discount_total_display, tax_total_display, total_display, paid_total_display, change_total_display, refund_total_display, and net_total_display, plus inclusive/exclusive variants where applicable.

tax and tax_summary

Use tax for display-mode guards and tax_summary for itemized rate rows.

Tax fieldTypeDescription
tax.displaystringincl or excl
tax.display_inclbooleanTrue when prices display inclusive of tax
tax.display_exclbooleanTrue when prices display exclusive of tax
tax.breakdownstringhidden, single, or itemized
tax.breakdown_hiddenbooleanTrue when tax rows should be hidden
tax.breakdown_singlebooleanTrue when a single tax total is preferred
tax.breakdown_itemizedbooleanTrue when per-rate rows are preferred
has_tax_summarybooleanTrue when tax_summary contains rows

Loop tax_summary with {{#tax_summary}}...{{/tax_summary}}.

FieldTypeDescription
codestringTax rate ID/code
ratenumber/nullRate percentage when resolved
labelstringTax rate label
compoundbooleanWhether the rate is compounded
taxable_amount_exclnumber/nullTaxable base excluding tax
tax_amountnumberTax collected
taxable_amount_inclnumber/nullTaxable base including tax

Formatted variants: taxable_amount_excl_display, tax_amount_display, and taxable_amount_incl_display.

payments

Loop with {{#payments}}...{{/payments}}.

FieldTypeDescription
method_idstringPayment method identifier
method_titlestringPayment method display title
amountnumberAmount applied to the order
transaction_idstringGateway transaction ID
tenderednumberCash amount tendered when present
changenumberCash change returned when present

Formatted variants: amount_display, tendered_display, and change_display.

refunds

Loop with {{#refunds}}...{{/refunds}}. Refund amounts are positive magnitudes; templates decide whether to prepend a minus sign or render a separate returned-items block.

FieldTypeDescription
idnumberRefund record ID
datedate objectRefund creation date
amountnumberRefund total
subtotalnumberRefunded line subtotal
tax_totalnumberTax refunded
shipping_totalnumberShipping amount refunded
shipping_taxnumberShipping tax refunded
reasonstringRefund reason
refunded_by_idnumber/nullUser ID that issued the refund
refunded_by_namestringUser display name that issued the refund
refunded_paymentbooleanWhether the payment was refunded through the gateway
destinationstringoriginal_method, cash, or manual
gateway_idstringGateway ID used for the refund
gateway_titlestringGateway display title
processing_modestringProvider/manual processing mode
linesarrayRefunded product rows
feesarrayRefunded fee rows
shippingarrayRefunded shipping rows

Refund line fields include name, sku, qty, total, total_incl, total_excl, line_total, unit_total, and taxes. Refund fee and shipping rows use label, total, total_incl, total_excl, and taxes. Display variants are added for totals and tax amounts.

fiscal

Fiscal fields are empty by default and populated by fiscal integrations or WCPOS Pro snapshot enrichment.

FieldTypeDescription
fiscal.immutable_idstringImmutable fiscal identifier
fiscal.receipt_numberstringFiscal receipt number
fiscal.sequencenumber/nullSequence counter
fiscal.hashstringHash/signature value
fiscal.qr_payloadstringQR payload for fiscal verification
fiscal.tax_agency_codestringTax authority code
fiscal.signed_atstringFiscal signing timestamp
fiscal.signature_excerptstringTruncated signature for display
fiscal.document_labelstringDocument label, e.g. Tax Invoice
fiscal.is_reprintbooleanWhether this render is a reprint
fiscal.reprint_countnumberReprint count
fiscal.extra_fieldsarray/objectJurisdiction-specific values

presentation_hints

These fields are mainly consumed by the renderer and formatter. They are available to templates when needed.

FieldTypeDescription
presentation_hints.display_taxstringincl, excl, hidden, itemized, or single
presentation_hints.prices_entered_with_taxbooleanWhether catalogue prices include tax
presentation_hints.rounding_modestringWooCommerce tax rounding setting
presentation_hints.localestringLocale used for formatting
presentation_hints.timezonestringReceipt timezone
presentation_hints.currency_positionstringCurrency symbol position
presentation_hints.currency_symbolstringCurrency symbol
presentation_hints.price_thousand_separatorstringThousands separator
presentation_hints.price_decimal_separatorstringDecimal separator
presentation_hints.price_num_decimalsnumberDecimal places
presentation_hints.price_display_suffixstringWooCommerce price display suffix
presentation_hints.order_barcode_typestringBarcode type used by gallery templates

i18n

Use i18n labels instead of hardcoding text where possible:

{{i18n.order}} #{{order.number}}
{{i18n.cashier}}: {{cashier.name}}
{{i18n.total}}: {{totals.total_display}}

Common keys include order, date, cashier, customer, item, sku, qty, unit_price, discount, subtotal, total, tax, paid, tendered, change, tax_summary, refunded, net_total, customer_note, thank_you_purchase, opening_hours, and the tax-ID label keys such as store_tax_id_label_eu_vat and customer_tax_id_label_other. Extra keys may be added by extensions.