OrderData

interface OrderData extends Pick<Order, 'ref_id' | 'number' | 'currency' | 'total_incl_tax' | 'order_status_url' | 'is_test'> { ref_id: string; number: string; currency: string; total_incl_tax: string; order_status_url: string; is_test: boolean; lines?: any[]; user?: any; }

Source: global.ts:1919

The six fields you can always count on being present on a completed order — enough to identify it, show its total, and link to its receipt.

A narrow, older view of Order, kept exported because integrations import it. No event declares this payload any more: order:completed carries the full Order, so a listener gets totals excluding tax, tax, shipping, discounts, addresses, attribution and typed lines without reaching for anything else. Use Order in new code; the same object is on useOrderStore().order.

The field list is pinned to Order by the compiler (extends Pick<Order, …>), so the two declarations cannot drift apart.

Example

CODE
// `Order` is a superset, so an OrderData-typed helper still accepts the payload.
function receiptLine(order: OrderData): string {
  return `${order.number} — ${order.total_incl_tax} ${order.currency}`;
}

window.next.on('order:completed', order => console.log(receiptLine(order)));

Hierarchy

  • Pick<Order, "ref_id" | "number" | "currency" | "total_incl_tax" | "order_status_url" | "is_test">
  • OrderData

Properties

ref_id: string

Overrides ref_id

Order reference id — used to fetch the order and add upsells.

number: string

Overrides number

Human-facing order number.

currency: string

Overrides currency

ISO currency code the order was placed in.

total_incl_tax: string

Overrides total_incl_tax

Order grand total including tax, as a formatted string.

order_status_url: string

Overrides order_status_url

URL of the hosted order-status/receipt page.

is_test: boolean

Overrides is_test

true for test-mode orders (not real purchases).

lines: any[]

Order line items. Loosely typed for backwards compatibility — the runtime value is Order.lines, so read it through Order to get product_title, quantity, is_upsell and the per-line prices typed.

user: any

Customer details attached to the order. Loosely typed for backwards compatibility — the runtime value is Order.user (OrderUser).