Prood
ApplicationsDashboard

Orders

Order management in the dashboard — listing, detail, fulfillment, and refunds.

The dashboard provides order visibility and management actions for the active organization's store.

Order list

Route: /orders

Paginated table of orders:

ColumnDescription
Order #Order ID (short format)
CustomerEmail and name
Statusplaced, approved, fulfilled, cancelled
Paymentunpaid, paid, refunded, voided
Fulfillmentunfulfilled, in_progress, fulfilled
TotalGrand total (formatted with currency)
DateOrder creation date

Filters: status, payment status, date range.

Order detail

Route: /orders/[id]

Displays full order information:

Order summary

  • Order ID, status, creation date
  • Customer info (email, name, phone)
  • Payment status and provider
  • Fulfillment status
  • Order totals (subtotal, tax, shipping, discount, grand total)

Line items

Each item shows product name, variant, quantity, unit price, and line total.

Addresses

Shipping and billing addresses as provided during checkout.

Actions

ActionAPI endpointDescription
FulfillPOST /v1/admin/orders/{id}/fulfillMark as shipped with tracking info
CancelPOST /v1/admin/orders/{id}/cancelCancel the order with optional reason
RefundPOST /v1/admin/orders/{id}/refundFull refund via payment provider

Actions are conditionally shown based on current status:

ActionVisible when
Fulfillstatus is placed or approved AND paymentStatus is paid
Cancelstatus is placed or approved
Refundstatus is approved or fulfilled AND paymentStatus is paid

Server actions in app/(dashboard)/orders/actions.ts:

'use server'
export async function fulfillOrderAction(id: string, input: FulfillOrderInput) { ... }
export async function cancelOrderAction(id: string, note?: string) { ... }
export async function refundOrderAction(id: string, note?: string) { ... }

Order timeline

The detail page includes a timeline card showing the full history of status changes, with timestamps and notes. Data is fetched from GET /v1/admin/orders/{id}/history.

Customer card

Displays the customer's name, email (contactEmail captured at checkout), and phone number from the shipping address.

Order status model

Orders use a three-dimensional status model inspired by Commerce Layer, separating order lifecycle, payment, and fulfillment into independent fields.

Order status (lifecycle)

StatusMeaningTriggered by
placedOrder submitted, awaiting paymentCustomer completes checkout
approvedPayment confirmed, ready to fulfillStripe webhook (payment.captured)
fulfilledAll items shippedAdmin fulfills order
cancelledOrder voidedPayment failure or admin cancellation

Payment status

StatusMeaningTriggered by
unpaidNo payment received yetDefault at placement
authorizedFunds held, capture pendingAuth-only gateways
paidPayment captured successfullyStripe webhook
partially_refundedPartial refund issuedAdmin partial refund
refundedFully refundedAdmin full refund
voidedAuthorization cancelledPayment failure or cancellation
freeZero-amount orderCoupons/gift cards cover full total

Fulfillment status

StatusMeaningTriggered by
unfulfilledNo items shipped yetDefault at placement
in_progressSome items shippedPartial fulfillment (future)
fulfilledAll items shippedAdmin fulfills order
not_requiredDigital-only orderAuto-set for non-physical items

Lifecycle timestamps

FieldSet when
placedAtOrder is created
approvedAtPayment is confirmed
cancelledAtOrder is cancelled
fulfilledAtOrder is fully shipped

Typical flow

Customer places order
  → status: placed, paymentStatus: unpaid, fulfillmentStatus: unfulfilled

Stripe webhook confirms payment
  → status: approved, paymentStatus: paid

Admin ships the order
  → status: fulfilled, fulfillmentStatus: fulfilled

--- OR ---

Payment fails
  → status: cancelled, paymentStatus: voided

Refund flow

  1. Merchant clicks Refund on order detail page
  2. Dashboard sends POST /v1/admin/orders/{id}/refund with amount and reason
  3. API calls payment provider's refund() method with tenant credentials
  4. Order status updated to cancelled, payment status to refunded
  5. Webhook from provider confirms refund completion

API endpoints used

ActionMethodEndpoint
List ordersGET/v1/admin/orders
Get orderGET/v1/admin/orders/{id}
Get order historyGET/v1/admin/orders/{id}/history
Fulfill orderPOST/v1/admin/orders/{id}/fulfill
Cancel orderPOST/v1/admin/orders/{id}/cancel
Refund orderPOST/v1/admin/orders/{id}/refund

On this page