Skip to main content

Product Order

Product order schemas for retail and e-commerce order management. Supports complete order lifecycle from placement through fulfillment and delivery.

Schema: ProductOrderSchema Source: src/core/business-mgt/product-order.schema.ts


ProductOrderItem​

Individual items within a product order.

Schema: ProductOrderItemSchema

Attributes​

AttributeTypeRequiredDefaultDescription
idstring——Unique identifier for this order item
productOrderIdstringYes—References parent ProductOrder
productIdstringYes—References Product from catalog
itemNamestringYes—Product name captured at order time
skustringNo—Product SKU for fulfillment
quantitynumberYes—Number of units ordered
unitPricenumberYes—Price per unit at order time
totalPricenumberYes—Total price for this line item
selectedVariantstringNo—Selected variant (size, color, etc.)
warrantyInfostringNo—Warranty terms captured at purchase
statusenumNoPENDINGCurrent fulfillment status. One of PENDING, CONFIRMED, PROCESSING, SHIPPED, DELIVERED, COMPLETED, or CANCELLED.
notesstringNo—Internal notes for staff

ProductOrder​

Complete product order with items, customer, and shipping.

Attributes​

AttributeTypeRequiredDefaultDescription
idstring——Unique identifier for the order
orderNumberstringNo—Human-readable order number
statusenumNoPENDINGCurrent order status. One of PENDING, CONFIRMED, PROCESSING, SHIPPED, DELIVERED, COMPLETED, or CANCELLED.
itemsarray<ProductOrderItem>Yes—Products in this order (min 1)
customerIdstringYes—References Customer
customerOrderCustomerNo—Populated customer information
pricingOrderPricingYes—Complete pricing breakdown
paymentStatusenumNoPENDINGPayment processing status. One of PENDING, PAID, FAILED, or REFUNDED.
paymentMethodstringNo—Payment method used
paymentReferencestringNo—External payment reference
billingAddressOrderAddressNo—Billing address
orderDatenumberYes—Unix timestamp when placed
requestedDeliveryDatenumberNo—Requested delivery date
shippedDatenumberNo—Unix timestamp when shipped
shippingAddressOrderAddressNo—Delivery address
deliveredDatenumberNo—Unix timestamp when delivered
shippingMethodstringNo—Shipping service level
trackingNumberstringNo—Carrier tracking number
shippingCarrierstringNo—Shipping carrier name
externalOrderIdstringNo—External system order ID
sourcestringNodirectOrder source channel
cancelReasonstring | nullNo—Reason for cancellation
notesstring | nullNo—Internal operational notes
serviceConversationConfigIdstring | nullNo—AI service conversation config ID
createdAtnumber——Unix timestamp when created
updatedAtnumber——Unix timestamp when last updated

OrderInventoryUpdate​

Schema for inventory adjustments triggered by order fulfillment.

Attributes​

AttributeTypeRequiredDescription
orderIdstringYesReferences ProductOrder that triggered the update
inventoryAdjustmentsarrayYesArray of inventory deductions

Inventory Adjustment Object​

AttributeTypeDescription
productIdstringReferences Product to adjust
quantityUsednumberQuantity to deduct from stock
reasonliteralAlways order_fulfillment

Example​

{
"id": "order_abc123",
"orderNumber": "ORD-2024-001",
"status": "SHIPPED",
"items": [
{
"id": "item_001",
"productOrderId": "order_abc123",
"productId": "prod_headphones",
"itemName": "Wireless Bluetooth Headphones",
"sku": "WBH-001-BLK",
"quantity": 1,
"unitPrice": 149.99,
"totalPrice": 149.99,
"selectedVariant": "Black",
"status": "SHIPPED"
}
],
"customerId": "cust_abc123",
"pricing": {
"subtotal": 149.99,
"tax": 12.00,
"shippingAmount": 9.99,
"discount": 0,
"total": 171.98,
"currency": "USD"
},
"paymentStatus": "PAID",
"paymentMethod": "credit_card",
"orderDate": 1709856000000,
"shippedDate": 1709942400000,
"shippingMethod": "Standard",
"trackingNumber": "1Z999AA10123456784",
"shippingCarrier": "UPS",
"source": "web",
"createdAt": 1709856000000,
"updatedAt": 1709942400000
}

Create / Update Schemas​

SchemaDescriptionOmits
CreateProductOrderSchemaFor creating ordersid, orderNumber, createdAt, updatedAt, deliveredDate, shippedDate, customer, cancelReason, serviceConversationConfigId
UpdateProductOrderSchemaFor partial updatesAll fields optional except id
UpdateProductOrderStatusSchemaFor quick status updatesOnly id, status, shippedDate, deliveredDate, trackingNumber