Next Commerce
Data AttributesOrder DataReference

Attributes

Every data- attribute and order.* path consumed by the order data system.


Activation

The order is loaded automatically when the page URL contains ?ref_id=ORDER_ID. There is no opt-in attribute to set.

For analytics tracking, mark the page as a receipt:

<meta name="next-page-type" content="receipt">

Display Bindings

Use data-next-display="order.<path>" to bind any element to live order data.

See Properties for the full path list, grouped by category. Quick reference:

GroupExamples
Identificationorder.id, order.number, order.refId, order.status, order.createdAt
Totalsorder.total, order.subtotal, order.shipping, order.tax, order.discounts
Customerorder.customer.name, order.customer.email, order.customer.firstName
Addressorder.shippingAddress.full, order.billingAddress.line1
Lines (aggregate)order.lines.count, order.lines.totalQuantity, order.lines.upsellCount
Lines (by index)order.lines[0].title, order.lines[0].price, order.lines[0].quantity
Attributionorder.attribution.utm_source, order.attribution.gclid

Append .raw for numeric values: order.total.raw, order.subtotal.raw, order.shipping.raw.


Order Items Renderer

AttributeDescription
data-next-order-itemsActivates the order items renderer on the container
data-item-template-idID of a <template> element to use as the item template
data-item-template-selectorCSS selector pointing at the template element
data-item-templateInline template string
data-empty-templateInline template string for the empty state

See Order Items Template for the full variable list.


Conditional Display Properties

Boolean properties usable inside data-next-show and data-next-hide.

PropertyDescription
order.existsOrder loaded successfully
order.isLoadingOrder fetch in flight
order.hasErrorOrder failed to load
order.hasItemsOrder has line items
order.hasShippingShipping was charged
order.hasTaxTax was charged
order.hasDiscountsDiscounts applied
order.hasUpsellsOrder has upsell line items
order.supportsUpsellsCan accept post-purchase upsells
order.isTestTest order
order.isExpiredStored order is older than 15 minutes

CSS Classes

ClassApplied toWhen
next-loading<html>Order is being fetched
next-loaded<html>Order loaded successfully
next-error<html>Order failed to load

Snake Case vs Camel Case

Most order properties have both forms. Use whichever you prefer:

Snake caseCamel case
order.ref_idorder.refId
order.created_atorder.createdAt
order.is_testorder.isTest
order.order_status_urlorder.statusUrl
order.total_incl_taxorder.total
order.total_excl_taxorder.totalExclTax
order.payment_methodorder.paymentMethod
order.shipping_methodorder.shippingMethod
order.supports_upsellsorder.supportsUpsells

Notes

  • Order data lives in orderStore with a 15-minute expiry. After 15 minutes the data is cleared on the next page load.
  • For long-lived receipt pages, the URL ref_id is the source of truth — the SDK refetches when needed.
  • The order.user.* namespace is an alias for order.customer.* and provides identical fields.

On this page