Configure receipt templates to include and format data for locations, customers, cart contents, payments, and other transaction details. You can also inject external data (for example, manufacturing, assembly, delivery, or fulfillment attributes) through a receipt callback.
Receipt processing flow
The InStore Receipt Print Server compiles data, applies templates, and generates output in these stages:
- Collect required data and transform it into JSON.
- Apply the retailer-defined template that uses both Handlebars and ReceiptLine markup.
- Conform to the Open Foodservice System Consortium standard.
- Merge JSON with the template using the Handlebars engine (replace Handlebars tags with values).
- Render the merged markup with the ReceiptLine engine to produce the following:
- An on-screen scalable vector graphic (SVG) preview.
- Printer instructions for supported receipt printers. Printer readability is accomplished with an environment variable that is required in every local environment
- Output that you can forward through SMS or email channels.
Receipt types
The following receipt types are generated by InStore transactions:
Templates
Updates from commercetools apply only to the base template set. Custom sets are not updated automatically. To adopt improvements, manually merge changes into your customized templates or revert to the base set.
InStore-specific helpers
Include the Location ID
Branch: {{location.location_ID}}
Display a Reprinted Receipt label
{{#if reprint}}***Reprinted Receipt***{{/if}}
Translate only the visible text. Asterisks are optional.
Display Cash Rounding label and amount
When cash rounding is enabled, show the rounded remainder for cash tenders only.
{{#if type.cash}}
{{indent 2}}cash rounding: {{#rightjustify}}{{cash.roundedRemainder}}{{/rightjustify}}
{{/if}}
Translate only the phrase "cash rounding".
Make conditional statements based on numeric values
Use comparison helpers to branch logic:
if_gt
(greater than)if_gte
(greater than or equal)if_lt
(less than)if_lte
(less than or equal)if_eq
(equal)if_ne
(not equal)
{{#if_gte amount 10000}}
{{!-- Action A: e.g., print coupon --}}
{{else}}
{{!-- Action B: e.g., print promotion --}}
{{/if_gte}}
Replace the commented placeholders (Action A and Action B) with the receipt fragments or partials you want to output. For instance, this pattern can drive simple offer logic: if the customer spends at least 100.00, print a coupon worth 5.00 (Action A); otherwise, print an advertisement for an upcoming promotion (Action B). This keeps business rules declarative inside the template while the actual reusable content lives in partials.
Example using partials:
{{#if_gte amount 10000}}
{{> couponFiveOff}}
{{else}}
{{> promoUpcoming}}
{{/if_gte}}
couponFiveOff
and promoUpcoming
are Handlebars partials you define elsewhere in the template set.Currency formatting
formatcurrency
prefix to format a number as a localized currency value. Add symbols such as $
or £
manually if required.Include all data provided by Payment Provider
receiptData
attribute contains the raw data fields supplied by the payment provider (for example, Adyen). Display or post-process these fields as needed.Non-customer-facing receipts
InStore also produces printed receipts for these Cash Management activities:
- Bank deposit
- Cash count
- Pay in
- Pay out
- Safe deposit
- Transfer in
- Transfer out