# Order Status

> Customer order confirmation, package tracking and returns. Handles split shipments, delayed or failed deliveries, final-sale items and pending payments.

Canonical: https://hextaui.com/blocks/order-status
Last updated: 2026-10-29

## Overview

Order Status is the page a customer lands on after checkout and comes back to while they wait. OrderConfirmation says thanks by name, shows the order number, the email the receipt went to, the expected delivery dates, what they bought and where it’s going. A check mark draws in and the details rise into place in about 800 ms, and content is readable well before that.

OrderTracking follows Baymard’s six tracking essentials. Each package gets a card with a large delivery date, a progress bar that shows before anything ships, the carrier and a linked tracking number you can copy, what’s inside with thumbnails, and the full shipping history newest first. Split orders read Package 1 of 2, and items that haven’t shipped sit in their own Preparing to ship card.

Problems are spelled out rather than hidden. A delayed shipment turns its step amber and says the new date, a missed delivery says when the next attempt is, a cancelled order says whether the payment was released or refunded, and a pending payment says nothing ships until it clears.

ReturnRequest is a two-step return: pick items and quantities, then a reason and where the refund goes. Final-sale items, items still in transit and items past the return window stay visible but disabled, each with the reason. The refund estimate updates as you choose, including the discount and tax share and any return shipping fee, and the confirmation shows a drop-off code and the refund timeline.

## Installation

### Step 1: Get HextaUI Pro

One payment unlocks every block, including future ones. [See pricing](https://hextaui.com/pricing).

### Step 2: Add the Pro registry to components.json

```json title="components.json"
{
  "registries": {
    "@hextaui-pro": {
      "url": "https://hextaui.com/r/pro/{name}.json",
      "headers": {
        "Authorization": "Bearer ${HEXTAUI_PRO_TOKEN}"
      }
    }
  }
}
```

### Step 3: Add your token

Create a token on your [account page](https://hextaui.com/account) and put it in `.env.local` as `HEXTAUI_PRO_TOKEN`.

### Step 4: Add the block

```bash
npx shadcn@latest add @hextaui-pro/order-status
```

## Usage

### From the Shopify Customer Account API

Map a Customer Account API order to Order once. Line items, fulfillments with their tracking information and shipment events, and the latest shipment status come across as they are, so the status page reads straight from Shopify.

```tsx
import type { Order, ShipmentStatus } from "@/components/blocks/order-status/order"
import { OrderTracking } from "@/components/blocks/order-status/order-tracking"

type ShopifyMoney = { amount: string; currencyCode: string }

type CustomerAccountOrder = {
  id: string
  name: string
  processedAt: string
  email: string | null
  financialStatus: "PAID" | "PENDING" | "PARTIALLY_REFUNDED" | "REFUNDED" | "VOIDED" | "AUTHORIZED"
  fulfillmentStatus: "FULFILLED" | "UNFULFILLED" | "PARTIALLY_FULFILLED" | "ON_HOLD"
  cancelledAt: string | null
  subtotal: ShopifyMoney
  totalShipping: ShopifyMoney
  totalTax: ShopifyMoney
  totalPrice: ShopifyMoney
  lineItems: {
    nodes: {
      id: string
      title: string
      variantTitle: string | null
      quantity: number
      price: ShopifyMoney
      image: { url: string; altText: string | null } | null
    }[]
  }
  fulfillments: {
    nodes: {
      id: string
      createdAt: string
      latestShipmentStatus: string | null
      estimatedDeliveryAt: string | null
      trackingInformation: { company: string | null; number: string | null; url: string | null }[]
      events: { nodes: { status: string; happenedAt: string }[] }
      fulfillmentLineItems: { nodes: { lineItem: { id: string }; quantity: number }[] }
    }[]
  }
}

const shipmentStatus: Record<string, ShipmentStatus> = {
  LABEL_PRINTED: "label_created",
  IN_TRANSIT: "in_transit",
  OUT_FOR_DELIVERY: "out_for_delivery",
  DELIVERED: "delivered",
  ATTEMPTED_DELIVERY: "attempted",
  DELAYED: "exception",
  FAILURE: "exception",
}

const status = (value: string | null): ShipmentStatus =>
  shipmentStatus[value ?? ""] ?? "in_transit"

export function fromCustomerAccount(order: CustomerAccountOrder): Order {
  return {
    id: order.id,
    name: order.name,
    createdAt: order.processedAt,
    currencyCode: order.totalPrice.currencyCode,
    email: order.email ?? undefined,
    lines: order.lineItems.nodes.map((line) => ({
      id: line.id,
      title: line.title,
      variantTitle: line.variantTitle ?? undefined,
      quantity: line.quantity,
      price: line.price,
      image: line.image
        ? { id: line.image.url, src: line.image.url, alt: line.image.altText ?? line.title }
        : undefined,
      fulfilledQuantity: 0,
      refundedQuantity: 0,
    })),
    subtotal: order.subtotal,
    shipping: order.totalShipping,
    tax: order.totalTax,
    total: order.totalPrice,
    discounts: [],
    paymentStatus: order.financialStatus.toLowerCase() as Order["paymentStatus"],
    fulfillmentStatus: order.fulfillmentStatus.toLowerCase() as Order["fulfillmentStatus"],
    cancelledAt: order.cancelledAt ?? undefined,
    fulfillments: order.fulfillments.nodes.map((fulfillment) => {
      const tracking = fulfillment.trackingInformation[0]
      return {
        id: fulfillment.id,
        createdAt: fulfillment.createdAt,
        status: status(fulfillment.latestShipmentStatus),
        carrier: tracking?.company ?? undefined,
        trackingNumber: tracking?.number ?? undefined,
        trackingUrl: tracking?.url ?? undefined,
        estimatedDelivery: fulfillment.estimatedDeliveryAt
          ? { from: fulfillment.estimatedDeliveryAt.slice(0, 10) }
          : undefined,
        lines: fulfillment.fulfillmentLineItems.nodes.map((item) => ({
          lineId: item.lineItem.id,
          quantity: item.quantity,
        })),
        events: fulfillment.events.nodes.map((event) => ({
          status: status(event.status),
          at: event.happenedAt,
          message: event.status.charAt(0) + event.status.slice(1).toLowerCase().replace(/_/g, " "),
        })),
      }
    }),
    refunds: [],
    events: [],
  }
}

export function OrderStatusPage({ order }: { order: CustomerAccountOrder }) {
  return <OrderTracking order={fromCustomerAccount(order)} />
}
```

### Tracking from EasyPost or AfterShip webhooks

Turn a tracker.updated webhook into fulfillment events and a shipment status. The same mapping works for AfterShip checkpoints. Store the result and OrderTracking shows the new date, step and history on the next render.

```tsx
import type { Fulfillment, ShipmentEvent, ShipmentStatus } from "@/components/blocks/order-status/order"

type EasyPostTracker = {
  tracking_code: string
  carrier: string
  public_url: string
  status: string
  est_delivery_date: string | null
  tracking_details: {
    status: string
    message: string
    datetime: string
    tracking_location: { city: string | null; state: string | null }
  }[]
}

const statuses: Record<string, ShipmentStatus> = {
  pre_transit: "label_created",
  in_transit: "in_transit",
  out_for_delivery: "out_for_delivery",
  delivered: "delivered",
  available_for_pickup: "attempted",
  return_to_sender: "exception",
  failure: "exception",
  cancelled: "cancelled",
}

const toStatus = (value: string): ShipmentStatus => statuses[value] ?? "in_transit"

export function applyTrackerUpdate(fulfillment: Fulfillment, tracker: EasyPostTracker): Fulfillment {
  const events: ShipmentEvent[] = tracker.tracking_details.map((detail) => ({
    status: toStatus(detail.status),
    at: detail.datetime,
    message: detail.message,
    location: [detail.tracking_location.city, detail.tracking_location.state]
      .filter(Boolean)
      .join(", ") || undefined,
  }))
  const status = toStatus(tracker.status)
  return {
    ...fulfillment,
    status,
    carrier: tracker.carrier,
    trackingNumber: tracker.tracking_code,
    trackingUrl: tracker.public_url,
    events,
    estimatedDelivery: tracker.est_delivery_date
      ? { from: tracker.est_delivery_date.slice(0, 10) }
      : fulfillment.estimatedDelivery,
    deliveredAt:
      status === "delivered"
        ? events.findLast((event) => event.status === "delivered")?.at
        : undefined,
  }
}

export async function POST(request: Request) {
  const body = (await request.json()) as { description: string; result: EasyPostTracker }
  if (body.description !== "tracker.updated") return new Response(null, { status: 204 })
  const fulfillment = await loadFulfillmentByTracking(body.result.tracking_code)
  await saveFulfillment(applyTrackerUpdate(fulfillment, body.result))
  return new Response(null, { status: 200 })
}

declare function loadFulfillmentByTracking(code: string): Promise<Fulfillment>
declare function saveFulfillment(fulfillment: Fulfillment): Promise<void>
```

### Returns through your API

ReturnRequest posts the chosen lines, reason and refund method to your endpoint and shows the label it returns. Throw with a message and it appears next to the submit button, with everything the customer picked still in place.

```tsx
"use client"

import { money } from "../price/money"
import type { Order } from "@/components/blocks/order-status/order"
import { ReturnRequest, type ReturnRequestResult } from "@/components/blocks/order-status/return-request"

export function StartReturn({ order, onClose }: { order: Order; onClose: () => void }) {
  return (
    <ReturnRequest
      order={order}
      windowDays={30}
      returnShippingFee={money("5.95", order.currencyCode)}
      supportHref="/contact"
      onCancel={onClose}
      onDone={onClose}
      onSubmit={async (request) => {
        const response = await fetch(`/api/orders/${order.id}/returns`, {
          method: "POST",
          headers: { "Content-Type": "application/json" },
          body: JSON.stringify(request),
        })
        if (!response.ok) {
          const { message } = (await response.json()) as { message?: string }
          throw new Error(message ?? "We couldn’t start your return. Try again in a minute.")
        }
        return (await response.json()) as ReturnRequestResult
      }}
    />
  )
}
```

## Anatomy

The parts you compose, from the outside in.

| Part | Description |
| --- | --- |
| `OrderConfirmation` | The thank-you page: greeting, delivery estimate, summary, addresses, payment and an optional account prompt. |
| `OrderTracking` | One card per package with the delivery date, progress, carrier, contents and history. |
| `ReturnRequest` | A compact return wizard that ends with a drop-off code and refund timeline. |
| `Order` | The shared order model, also used by the dashboard blocks. |
| `orderPackages, returnEligibility, estimateRefund` | Group lines into packages, decide what can be returned and why, and work out a refund. |

## API reference

### OrderConfirmation

Also takes div props.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `order` | `Order` | – | The order to confirm. paymentStatus pending or failed switches the heading and message. |
| `deliveryEstimate` | `{ from: string; to?: string } \| null` | `order.estimatedDelivery` | ISO dates for the delivery window. null hides it. |
| `celebrate` | `boolean` | `false` | A single, quiet confetti burst, once per session. Never fires with reduced motion. |
| `autoFocus` | `boolean` | `true` | Move focus to the heading on mount. |
| `onCreateAccount` | `(password: string) => void \| Promise<void>` | – | Shows the guest account prompt. Throw to show the message under the field. |
| `actions` | `ReactNode` | – | Buttons at the end, such as Track your order. |
| `locale` | `Intl.LocalesArgument` | `"en-US"` | Locale for dates and money. |
| `timeZone` | `string` | – | Time zone for dates. Defaults to the viewer’s. |
| `labels` | `Partial<OrderConfirmationLabels>` | – | Every user-facing string. |

### OrderTracking

Also takes div props.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `order` | `Order` | – | Fulfillments become package cards; unshipped quantities become a Preparing to ship card. |
| `now` | `string \| Date` | `Date.now()` | Used for today and tomorrow in delivery dates. |
| `defaultExpanded` | `boolean` | `false` | Open every shipping history instead of the latest two updates. |
| `actions` | `ReactNode` | – | Buttons beside the heading, such as Start a return. |
| `locale` | `Intl.LocalesArgument` | `"en-US"` | Locale for dates and money. |
| `timeZone` | `string` | – | Time zone for event times. |
| `labels` | `Partial<OrderTrackingLabels>` | – | Step names, statuses and messages. |

### ReturnRequest

Also takes div props.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `order` | `Order` | – | The order to return items from. |
| `onSubmit` | `(request: ReturnRequestInput) => Promise<ReturnRequestResult \| void>` | – | Create the return. Resolve with an id, code, carrier, dropOffBy, labelUrl or qrCodeUrl. Throw to show the message. |
| `windowDays` | `number` | `30` | Days after delivery that an item can be returned. |
| `eligibility` | `(line, order) => ReturnEligibility \| undefined` | – | Override the built-in rules for a line. |
| `reasons` | `{ value: string; label: string; note?: boolean }[]` | – | Reason options. note shows a text box for details. |
| `refundMethods` | `("original" \| "store_credit")[]` | `["original", "store_credit"]` | Where the refund can go. |
| `returnShippingFee` | `Money \| null` | `null` | Taken off refunds to the original payment. Store credit returns are free. |
| `onCancel` | `() => void` | – | Shows a Cancel button. |
| `onDone` | `() => void` | – | Shows a Done button after the return starts. |
| `supportHref` | `string` | – | Link shown when nothing can be returned. |
| `now` | `string \| Date` | `Date.now()` | Used for the return window. |
| `labels` | `Partial<ReturnRequestLabels>` | – | Every user-facing string. |

### Order

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `lines` | `OrderLine[]` | – | Each with quantity, price, fulfilledQuantity, refundedQuantity and returnable. |
| `fulfillments` | `Fulfillment[]` | – | Packages with status, carrier, trackingNumber, trackingUrl, estimatedDelivery, deliveredAt, lines and events. |
| `refunds` | `Refund[]` | – | Amounts, lines and restock flags. |
| `paymentStatus` | `PaymentStatus` | – | pending, authorized, paid, partially_refunded, refunded, voided or failed. |
| `estimatedDelivery` | `{ from: string; to?: string }` | – | The window shown before anything ships. |
| `cancelledAt` | `string` | – | Set for cancelled orders. |

## Keyboard

| Key | Action |
| --- | --- |
| `Tab` | Moves through tracking links, copy buttons, history toggles and return choices. |
| `Space` | Toggles an item in a return, opens a history, or picks a refund method. |
| `ArrowUp` `ArrowDown` | Moves between reasons in the reason menu and between refund methods. |
| `Enter` | Activates links and buttons and submits the account form. |

## Accessibility

- The confirmation heading takes focus on load, and each return step moves focus to its heading, so screen reader users hear where they are.
- Each progress bar is an ordered list. The current step has aria-current="step", and every step says whether it’s completed, current or upcoming, with its date.
- Status is never shown by color alone: delays and failed deliveries have an icon and words, and disabled return items say why. Tracking links say they open the carrier in a new tab.
- Copying a tracking or order number and changing the return selection are announced in a polite live region. Errors use role="alert". Every animation, including the check draw and confetti, is skipped with reduced motion.

## Built with

The free HextaUI components Order Status is made from. Each one installs on its own.

- [Badge](https://hextaui.com/docs/badge) - Status labels with colored dots, removable tags that slide closed and counts that roll to their new value.
- [Button](https://hextaui.com/docs/button) - Buttons in every variant and size, with a built-in loading, success and error flow that skips the spinner for fast requests.
- [Card](https://hextaui.com/docs/card) - A surface for grouping content, with three variants, edge-to-edge media, concentric radii and whole-card links.
- [Checkbox](https://hextaui.com/docs/checkbox) - A checkbox whose check draws in, with indeterminate parents, groups and labels that share its hover.
- [Collapsible](https://hextaui.com/docs/collapsible) - A panel that shows and hides with height motion you can reverse mid-way, without jumping the layout.
- [Field](https://hextaui.com/docs/field) - Labels, descriptions and errors wired to their control, with validation states and layouts for forms.
- [Input](https://hextaui.com/docs/input) - A text input with three sizes, invalid and read-only states, native validation styling and a 16px touch font so phones never zoom in.
- [Radio group](https://hextaui.com/docs/radio-group) - Pick one option from a set, with a dot that hands off between choices and cards whose selection ring slides to the new pick.
- [Select](https://hextaui.com/docs/select) - Pick one or more options from a list that opens on the current value, with typeahead, groups and form support.
- [Separator](https://hextaui.com/docs/separator) - A hairline that divides content horizontally or vertically, with an optional label and a decorative mode for purely visual lines.
- [Textarea](https://hextaui.com/docs/textarea) - Multi-line text that grows smoothly with what you write between a minimum and maximum number of rows, with counters, validation and a submit shortcut.

## Code

9 files, added to components/blocks/order-status.
