> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# iCommerce Order Lifecycle

> End-to-end flow from order creation to fulfillment and returns.

# iCommerce Order Lifecycle

This guide walks through a typical order lifecycle in the embedded iCommerce engine.

## 1) Create an Order

Orders can be created through the SDKs or the CLI. Start with a minimal order payload, then enrich with payment, shipping, and customer details.

## 2) Validate and Authorize Payment

Validate totals, taxes, and discounts before authorizing payment. For agent workflows, ensure the action is explicit and auditable.

## 3) Reserve Inventory

Inventory is reserved against the order to prevent oversells. Reservations can be updated if the order changes.

## 4) Fulfill and Ship

When fulfillment begins, create a shipment record and update the order status. Tracking details flow back to the customer.

## 5) Post-Purchase Actions

Handle returns, exchanges, and refunds with deterministic actions tied to the original order and inventory adjustments.

## Related Documentation

* [Examples](/stateset-icommerce/examples)
* [Returns Quickstart](/guides/returns-quickstart)
* [Orders Quickstart](/guides/orders-quickstart)
