JSON data fields for receipt templates
View the structure of the receipt context JSON object for use in receipt templates.
The receipt context is generated by the buildReceiptContext function and contains all transaction-related information needed for receipt generation.
Base structure
- All monetary values are represented using the Money type which includes
amount(in minor units),currency, andprecision. - Null values indicate optional or undefined fields.
- Custom objects can contain arbitrary key-value pairs specific to the implementation.
- The
localefield determines the formatting of dates, times, and numbers in the receipt.
Transaction metadata
| Field | Type | Description |
|---|---|---|
timestamp | Number | Unix timestamp in milliseconds |
timestamp_formatted | String | Localized date/time string based on the locale |
order_number | String | Unique transaction reference number |
workstation_id | String | ID of the workstation where the transaction occurred |
user_id | String | ID of the user who processed the transaction |
sequence_number | String | Sequential transaction number |
locale | String | Locale code—for example en-US |
reprint | Boolean | Indicates if this is a reprinted receipt |
custom | Object | Custom 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 item's description{{payments[0].charge_card.last4}}: Last 4 digits of the first payment card
Customer information
The customer object contains details about the customer associated with the transaction.
{"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}
Example usage in templates:
{{customer.first_name}}: Customer's first name{{customer.account_number}}: Customer's account number{{customer.company}}: Customer's company name
Location information
The location object contains details about the store.
{"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
The line_items array contains the items in the transaction. Each line item has the following structure:
{"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}
Transaction totals
| Field | Type | Description |
|---|---|---|
subtotal | Money | Transaction subtotal before tax |
tax | Money | Total tax amount |
total | Money | Transaction total including tax |
subtotal_gross | Money | Subtotal including cart-level discounts |
tax_id | String | Tax identification number |
Money objects have the following structure:
{"amount": number,"currency": string,"precision": number}
Tax summary
The tax_summary array contains tax calculations per tax code:
{"code": string,"total_net": Money,"total_gross": Money,"tax_rate": string,"total_tax": Money}
Payments and refunds
Both payments and refunds arrays contain tender entries with the following base structure:
{"type": string,"amount": Money,"custom": object | null}
These can contain the following additional fields based on tender type:
Credit card
{"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
{"voucher": {"number": string,"last4": string,"type": string,"balance": Money}}
Cart information
The carts array contains sub-transactions, such as returns or exchanges, within the main transaction:
{"type": string,"id": string,"line_items": Array<LineItem>,"total": Money,"gift_receipt": boolean,"custom": object | null}
Gift receipt items
The giftable_items array contains items eligible for gift receipts:
{"item_id": string,"description": string,"brand": string | null,"color": string | null,"gift_receipt": boolean,"custom": object | null}
Cart-level discounts
The cart_discounts array contains transaction-level discounts:
{"description": string,"amount": Money}