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
, andprecision
. - Fields can be
null
when data is optional or undefined. locale
controls formatting (dates, numbers, time) in the rendered receipt.
Field reference
Transaction metadata
Field | Type | Description |
---|---|---|
timestamp | Number | Unix timestamp in milliseconds. |
timestamp_formatted | String | Localized date and time derived from the locale. |
order_number | String | Unique transaction reference. |
workstation_id | String | Identifier of the workstation where the transaction occurred. |
user_id | String | Identifier of the user (associate) who processed the transaction. |
sequence_number | String | Sequential transaction counter. |
locale | String | Locale code (for example, en-US ). |
reprint | Boolean | Indicates a reprinted (duplicate) 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 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.{
"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_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.{
"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
Field | Type | Description |
---|---|---|
subtotal | Money | Sum of line item net amounts 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 object:
{
"amount": number,
"currency": string,
"precision": number
}
Tax summary
tax_summary
groups tax calculations by tax code.{
"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:
{
"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
{
"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": {
"number": string,
"last4": string,
"type": string,
"balance": Money
}
}
carts
carts
lists nested transactions (for example, returns or exchanges) processed within the main transaction flow.{
"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.{
"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.{
"description": string,
"amount": Money
}