JSON data fields for receipt templates

Use this reference to map the receipt context JSON object to your receipt templates.

The receipt context is generated by the buildReceiptContext function. It contains all transaction data required to render a printable or digital receipt. You access fields in templates using their property paths (for example, {{order_number}}).

Overview

Key concepts:

  • Monetary values are represented by the Money type, including: amount (minor units), currency, and precision.
  • Fields can be null when data is optional or undefined.
  • locale controls formatting (dates, numbers, time) in the rendered receipt.

Field reference

Transaction metadata

FieldTypeDescription
timestampNumberUnix timestamp in milliseconds.
timestamp_formattedStringLocalized date and time derived from the locale.
order_numberStringUnique transaction reference.
workstation_idStringIdentifier of the workstation where the transaction occurred.
user_idStringIdentifier of the user (associate) who processed the transaction.
sequence_numberStringSequential transaction counter.
localeStringLocale code (for example, en-US).
reprintBooleanIndicates a reprinted (duplicate) receipt.
customObjectCustom receipt-level attributes.

When referencing these fields in your receipt template, use the exact path to the desired value, for example:

  • {{order_number}}: transaction reference
  • {{location.location_name}}: store name
  • {{line_items[0].description}}: first line item description
  • {{payments[0].charge_card.last4}}: last 4 digits of the first payment card

Customer information

The customer object holds customer identification and personalization fields.
Customer objectjson
{
   "account_number": string | null,
  "salutation": string | null,
  "first_name": string | null,
  "middle_name": string | null,
  "last_name": string | null,
  "company": string | null,
  "paymentAccounts": string[],
  "custom": object
}

Template examples:

  • {{customer.first_name}}
  • {{customer.account_number}}
  • {{customer.company}}

Location information

The location object contains details about the store.
Location objectjson
{
  "location_id": string,
  "location_name": string,
  "description": string | null,
  "country": string | null,
  "address_line_1": string | null,
  "address_line_2": string | null,
  "city": string | null,
  "state": string | null,
  "postal_code": string | null,
  "telephone_number": string | null,
  "tax_id": string | null
}

Line items

Each entry in line_items represents a purchased (or returned) item.
Line item examplejson
{
  "item_id": string,
  "description": string,
  "quantity": number,
  "price": {
    "amount": number,
    "currency": string,
    "precision": number
  },
  "extended_price": {
    "amount": number,
    "currency": string,
    "precision": number
  },
  "tax_code": string,
  "price_modifiers": [
    {
      "description": string,
      "amount": {
        "amount": number,
        "currency": string,
        "precision": number
      }
    }
  ],
  "attributes": [
    {
      "label": string,
      "value": string
    }
  ],
  "facets": [
    {
      "name": string,
      "value": string | null
    }
  ],
  "custom": object
}

Totals

FieldTypeDescription
subtotalMoneySum of line item net amounts before tax.
taxMoneyTotal tax amount.
totalMoneyTransaction total including tax.
subtotal_grossMoneySubtotal including cart-level discounts.
tax_idStringTax identification number.

Money object:

Attributes of a Money objectjson
{
  "amount": number,
  "currency": string,
  "precision": number
}

Tax summary

tax_summary groups tax calculations by tax code.
Tax summary entryjson
{
  "code": string,
  "total_net": Money,
  "total_gross": Money,
  "tax_rate": string,
  "total_tax": Money
}

Payments and refunds

Use payments and refunds to list tender objects used to settle or refund the transaction.

Tender base

Every tender includes the following base fields:

Tender basejson
{
  "type": string,
  "amount": Money,
  "custom": object | null
}

These can contain the following additional fields based on tender type:

These can contain the following additional fields based on tender type:

Credit card fields

Credit card tender fieldsjson
{
  "charge_card": {
    "processor": string,
    "processor_id": string,
    "last4": string,
    "brand": string,
    "account_type": string,
    "application_preferred_name": string | null,
    "dedicated_file_name": string | null,
    "authorization_response_code": string,
    "application_cryptogram": string | null,
    "terminal_verification_results": string | null,
    "transaction_status_information": string | null
  }
}

Voucher or return card tender fields

Voucher tender extensionjson
{
  "voucher": {
    "number": string,
    "last4": string,
    "type": string,
    "balance": Money
  }
}

carts

carts lists nested transactions (for example, returns or exchanges) processed within the main transaction flow.
carts arrayjson
{
  "type": string,
  "id": string,
  "line_items": Array<LineItem>,
  "total": Money,
  "gift_receipt": boolean,
  "custom": object | null
}

Gift receipt items

giftable_items lists items eligible for dedicated gift receipts.
giftable_items arrayjson
{
  "item_id": string,
  "description": string,
  "brand": string | null,
  "color": string | null,
  "gift_receipt": boolean,
  "custom": object | null
}

Cart-level discounts

cart_discounts includes discounts applied at the transaction level.
cart_discounts arrayjson
{
  "description": string,
  "amount": Money
}