Manage and display receipt data

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:

  1. Collect required data and transform it into JSON.
  2. Apply the retailer-defined template that uses both Handlebars and ReceiptLine markup.
  3. Conform to the Open Foodservice System Consortium standard.
  4. Merge JSON with the template using the Handlebars engine (replace Handlebars tags with values).
  5. 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

The base English template set ships with InStore. Translate static text for each non-English locale you support. For more information about creating and applying custom sets, see Receipt template sets.

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

For standard helpers, see Receipt helpers. The following helpers and patterns are specific to InStore.

Include the Location ID

By default, receipts display only the location name. You can display both the location name and the location ID assigned on the Location detail page of the Administrator Portal. The location ID also appears in each transaction number.
Location ID examplehandlebars
Branch: {{location.location_ID}}

Display a Reprinted Receipt label

Show a Reprinted Receipt label only on reprinted (not original) receipts. Insert the following block in the regular Sales or Refund receipt template; it will not print on original receipts, only reprints.
Reprint label blockhandlebars
{{#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.

Cash rounding blockhandlebars
{{#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)
Conditional examplehandlebars
{{#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:

Conditional example with partialshandlebars
{{#if_gte amount 10000}}
  {{> couponFiveOff}}
{{else}}
  {{> promoUpcoming}}
{{/if_gte}}
In this example, couponFiveOff and promoUpcoming are Handlebars partials you define elsewhere in the template set.

Currency formatting

Use the 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

The 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
Because most retailers decide not to customize these, details about formatting internal-only receipts are not specified in this documentation. However, the same formatting rules and methods apply to these receipts as to transaction receipts. If you have questions about customizing these, contact the InStore support team.