Checkout Process Overview
The checkout process is a critical part of any e-commerce application, transforming a shopper's cart into a confirmed order. This guide explains the concepts, components, and lifecycle of the Elastic Path checkout process.
Checkout Workflow
When a shopper initiates the checkout process, an order is created from the cart. The order is incomplete until after a successful payment is made. Typically, a complete order can be shipped and the product deducted from inventory counts.
Summary of the Checkout Workflow
- A shopper adds a product to a cart - a cart with an ID is created automatically.
- Manage the cart items. For example, a shopper might add items, remove items, and change quantities.
- Check out the cart. An incomplete order is created.
- Pay for an order: by providing billing and shipping details, the order is now in the processing status.
- If using a manual gateway, after you authorize and capture it, Elastic Path considers the order complete. If you use a third-party integration supported by Elastic Path (such as Stripe), after the third-party gateway authorizes and captures the payment, the order becomes complete.
- After the order is shipped, you can manually flag it as fulfilled.
Cart to Order Conversion
When converting a cart to an order through the checkout process, it's important to understand:
- The cart remains intact during checkout and is still available afterward
- The cart can be modified and checked out again if needed
- A new, incomplete order is created from the cart contents: i.e. an order is a 'snapshot' of a cart
- The order initially has an "incomplete" status until payment is processed
- If shipping groups are associated with the cart, they're transferred to the order during checkout
Order Lifecycle
After checkout, the order moves through several states:
- Incomplete: Initial state after checkout, before payment
- Processing: After payment is initiated but not fully complete
- Complete: After successful payment processing
- Fulfilled/Unfulfilled: Shipping status, managed separately from the order status
The checkout process only creates the order in the "incomplete" state. Payment processing is required to advance the order to "complete" status.
Cart and Inventory Considerations
Cart Persistence
By default, carts are automatically deleted 7 days after the last update. This can be modified in your store settings.
Inventory Management
If inventory tracking is enabled, product stock levels are adjusted during the checkout and payment process.
Currency Requirements
All items in the cart must share the same currency. The cart currency is set when the first item is added.
Checkout Methods
In Elastic Path there are two types of checkout:
Guest Checkout
For new customers or those who prefer to shop as guests, you can checkout using a customer object with name and email. This is ideal for first-time visitors or customers who don't want to create an account.
Why implement guest checkout?
Guest checkout allows shoppers to complete a purchase without creating an account or logging in. This approach can be beneficial for both shoppers and merchants, since it reduces friction in the checkout process. Requiring users to register or log in can be a barrier to completing a purchase, especially for new or infrequent shoppers.
Customer Checkout
For returning or known shoppers, you can use the Customer Checkout method. This approach requires the shopper to have an existing account and to authenticate (log in) before proceeding with checkout.
Why implement customer checkout?
Customer checkout enables you to offer a more personalized shopping experience. With customer accounts, you can provide order history, saved addresses, targeted promotions, and more.
You may choose to implement one or both checkout methods, depending on your specific needs.
Understanding Customer Checkout Options
Elastic Path Commerce provides two main approaches for authenticated customer checkout:
Account Checkout
Can be used for D2C storefronts, but is ideal for B2B scenarios with organizational structures. Benefits include:
- Account and Account Member relationship management
- Account-specific pricing and catalogs
- Account-level billing and purchasing controls
Customer ID Checkout
Best for B2C scenarios where you have individual customer records.
Customer ID checkout relies on the Customers service. Accounts represent the next generation of the Customers service. We recommend using Accounts for new implementations.
- Uses an existing customer ID from your store
- Streamlines checkout for returning customers
- Associates orders with customer records for history tracking
Shipping Options
Elastic Path provides flexible approaches for managing shipping during checkout, allowing you to implement everything from simple flat-rate shipping to complex split-delivery scenarios:
Custom Cart Items for Shipping
The most common approach uses custom cart items to add shipping fees and delivery options directly to the cart. Custom cart items integrate relatively seamlessly with the existing cart and checkout flow.
Shipping Groups for Complex Scenarios
For advanced split-shipping requirements, shipping groups provide structured support for more complex use cases. Shipping groups are transferred from cart to order during checkout, maintaining the split-shipping configuration throughout the order lifecycle.
When to Use Shipping Groups vs Custom Cart Items
Below is a guide to common shipping scenarios and the recommended approach:
Scenario | Custom Cart Items | Shipping Groups |
---|---|---|
Single shipping fee for entire cart | ✅ | ❌ |
Simple shipping options (standard/express/overnight) | ✅ | ❌ |
Dynamic costs (location, weight, or cart-based) | ✅ | ❌ |
Additional services (insurance, handling fees) | ✅ | ❌ |
Multiple delivery addresses | ❌ | ✅ |
Split shipping with individual tracking | ❌ | ✅ |
Bundle items that ship together | ❌ | ✅ |
Third-party shipping API integration | ✅ | ✅ |
Optional Fields
The Checkout API allows you to include optional fields:
- order_number: A user-managed field that can be used as an alternative to the system-generated
order_id
. When processing transactions through certain payment gateways like Authorize.net, theorder_number
may be used in the invoice section. - external_ref: An optional external reference for integrating with other systems.
Best Practices
Address Validation
Consider implementing address validation to ensure shipping addresses are correct, reducing failed deliveries and improving customer satisfaction.
Error Handling
Implement robust error handling during checkout to provide clear feedback to customers when issues occur.
Progress Indicators
Use clear progress indicators to show customers where they are in the checkout process and how many steps remain.
Persistent Cart
Implement cart persistence for returning customers, allowing them to continue shopping where they left off.
Next Steps
Now that you understand the checkout process, you can:
- Implement a basic checkout flow with our quickstart guide
- Understand payment gateway integration options
For a complete example, check out the SPA Checkout Example in the Elastic Path Composable Frontend repository.