Next Commerce
Data AttributesOrder Data

Order Data

Order data attributes display post-purchase order information on confirmation, upsell, and receipt pages. The order is loaded automatically when the URL contains ?ref_id=ORDER_ID.

How It Works

  1. The page loads with ?ref_id=ORD-1234 in the URL.
  2. The SDK detects the parameter, fetches the order from the API, and stores it in orderStore.
  3. Every data-next-display="order.<property>" element on the page populates with the live data.
  4. CSS classes (next-loading, next-loaded, next-error) reflect the load state.

Quick Example

<div data-next-show="order.exists">
  <h1>Thank you, <span data-next-display="order.customer.firstName">Friend</span>!</h1>

  <p>Order #<span data-next-display="order.number">-</span></p>
  <p>Total: <span data-next-display="order.total">$0.00</span></p>

  <address data-next-display="order.shippingAddress.full">-</address>
</div>

On this page