Your First Order
Understanding the Order Flow
This guide explains how orders work in Cartly ā from the moment a customer adds a product to their cart through to order completion.
How Checkout Works
When a customer clicks "Checkout", Cartly initiates a Temporal workflow that orchestrates the entire process:
- Cart validation ā Verifies all items are still in stock and prices are current.
- Inventory reservation ā Temporarily holds the requested quantities so other customers cannot purchase the same items.
- Shipping calculation ā Computes shipping rates based on the customer's address and your configured shipping zones.
- Discount application ā Applies any discount codes and validates their conditions (minimum amount, usage limits, etc.).
- Payment processing ā Creates a Stripe PaymentIntent and captures the payment.
- Order creation ā Creates the order record with all line items, shipping details, and payment confirmation.
- Inventory commit ā Converts the temporary reservation into a permanent stock deduction.
- Confirmation ā Sends the order confirmation email and redirects the customer to the success page.
Zero Lost Orders Guarantee
The Saga pattern ensures that if any step fails after payment is captured, the system automatically retries or compensates. If payment succeeds but order creation fails due to a transient database error, Temporal retries the activity until it succeeds. This means you never lose a paid order.
Viewing Your First Order
Navigate to Orders in the admin panel. You will see a list of all orders with their status, customer name, total, and date. Click any order to view its full details.
Order Detail Page
The order detail page shows:
- Timeline ā A chronological log of every event: creation, payment, fulfillment, and any notes.
- Line items ā Each product, variant, quantity, and price.
- Customer info ā Name, email, shipping address, and billing address.
- Payment status ā Whether the payment was captured, refunded, or partially refunded.
- Fulfillment status ā Unfulfilled, partially fulfilled, or fulfilled, with tracking numbers if added.
Fulfilling the Order
Click Fulfill to mark items as shipped. Enter the tracking number and carrier if applicable. The customer receives a shipping confirmation email automatically. You can fulfill all items at once or partially fulfill specific line items.
Test Mode
When your Stripe account is in test mode, use the card number 4242 4242 4242 4242 with any future expiry date and any CVC to simulate a successful payment. This lets you walk through the entire order flow without processing real charges.