Skip to main content

Orders & Fulfillment

Order

An Order represents a sales transaction. Orders can be created manually in Nexus, imported from Shopify, or generated from email/PDF import flows.

Key fields

FieldTypeDescription
idUUIDPrimary key
organization_idUUIDOwning tenant
customer_idUUIDLinked contact
order_numbertextHuman-readable order identifier
statustextOrder lifecycle state
total_amountnumericOrder total
currencytextCurrency code (e.g., EGP, SAR, AED)
sourcetextWhere the order originated (manual, shopify, import)
shipping_addressjsonbDelivery address
notestextInternal notes
shopify_order_idtextShopify order ID (if synced)
created_attimestamptzWhen the order was placed

Order lifecycle

pending → confirmed → processing → pick_started → picked → packed → shipped → delivered
↘ returned

Each transition may trigger automation (e.g., sending a WhatsApp shipping notification).

Order Item

An Order Item is a line item within an order, referencing a product/SKU, quantity, and price.

Key fields

FieldTypeDescription
idUUIDPrimary key
order_idUUIDParent order
product_nametextProduct description
skutextStock-keeping unit
quantityintegerOrdered quantity
unit_pricenumericPrice per unit
total_pricenumericLine total

Pick List

A Pick List is generated from one or more orders to guide warehouse staff through the picking process. Pick lists group items by warehouse location for efficient picking routes.

Lifecycle

  1. start-picking Edge Function creates the pick list and assigns a picker.
  2. Warehouse staff uses the mobile UI to scan items (scan-item).
  3. complete-pick marks the pick list as complete.
  4. Items move to the packing stage.

Shipment (AWB)

An AWB (Airway Bill) represents a shipment created with a courier. The awbs table tracks tracking numbers, courier info, status, and label URLs.

Key fields

FieldTypeDescription
idUUIDPrimary key
order_idUUIDLinked order
tracking_numbertextCourier tracking number
couriertextCourier name (e.g., bosta)
statustextShipment status
label_urltextURL to printable shipping label
created_attimestamptzWhen the AWB was created

Status tracking

Courier status updates flow in via tracking-webhook and update the awb_status_logs table with a timestamped history.

Returns

Returns are handled by updating order and shipment status. The return-confirmation-webhook Edge Function processes return confirmations from couriers.

TablePurpose
ordersOrder records
order_itemsLine items
awbsShipment / AWB records
awb_status_logsShipment status history
pick_listsPick list records
pick_list_itemsItems within a pick list