commercetools: 8 Decisions for Composable Ecommerce Development
Commercetools is an API-first commerce platform for businesses that want to build distinct shopping experiences around shared commerce capabilities. It can support websites, mobile apps, and other sales channels. However, a composable architecture also means the organization must take responsibility for important connections among product information, customers, carts, payments, and fulfillment.
This article explains eight design decisions for commercetools headless ecommerce APIs, then outlines a practical rollout, architectural tradeoffs, and common mistakes. The running example is a retailer offering localized catalogs through both a website and a mobile shopping app.
What commercetools does and where it fits
Commercetools exposes commerce functions through APIs rather than requiring every customer-facing experience to use one fixed frontend. That separation gives development teams flexibility, but it also creates decisions about identity, inventory, search, content, and integrations. A custom interface can look polished while producing incorrect prices or lost carts if the underlying design is weak.
The official commercetools Carts API documentation describes how carts represent intended purchases, including anonymous carts and cart merging. The Product Projections API reference explains how a storefront can retrieve customer-facing product information in a particular locale, store, and pricing context. Read both before designing the product-to-checkout journey.
8 architecture decisions for a commercetools implementation
1. Decide which services own each part of the journey
An API-first platform does not eliminate the need for a complete commerce system. Product enrichment may live in a PIM. Content can live in a CMS. Payments, customer communications, and warehouse operations may use separate tools. Assigning ownership makes updates traceable and avoids conflicting records.
For example, a retailer may use a PIM to approve descriptions and technical attributes, commercetools to represent shopping carts and orders, and an ERP to handle purchasing. The applications need explicit contracts. Decide which one owns a product identifier, stock count, customer address, and shipment status.
Test: Change one product attribute, then follow it through the approved system to both customer-facing experiences. Ensure the destination shows the correct value and an outdated response does not overwrite a newer one.
2. Design store context, language, and pricing together
The same product can have different available variants, localized text, prices, and stock by store or market. Product Projections help expose product details in a relevant context. However, the frontend must supply appropriate parameters and explain limitations to customers.
Build a written rule for selecting a customer’s market. Consider delivery region, currency, language, and account type. An unsupported combination should produce a clear alternative rather than silently showing a price from another country.
Test: View the same product as a customer from two different regions. Check its visible price, currency, language, available size, and shipping eligibility. Repeat after switching regions during a session.
3. Plan anonymous and authenticated cart behavior
Many customers add items before creating an account. When they sign in, their anonymous cart may need to merge with a customer cart. That can produce difficult decisions about line quantities, discounts, and unavailable items. Define the intended behavior rather than accepting any result without testing it.
Protect cart identifiers where appropriate, show errors for unavailable merchandise, and keep users informed when a merge changes their selection. A cart is a statement of intent; it should not promise that a price or inventory reservation remains unchanged indefinitely.
Test: Add two items as a guest, sign in to an existing account with another cart, and check whether quantities, discounts, and the cart summary match your business rules.
4. Treat inventory and prices as changing information
A customer can leave a product page open while another shopper purchases the remaining stock. Similarly, promotional pricing may expire. The application should not depend on a cached listing as the final source of truth during checkout.
Choose how to communicate stock uncertainty. Review inventory modes and their effects on carts, especially for scarce products. When a change prevents purchase, explain the issue and offer a meaningful next action.
Test: Open a product page, change inventory or price in the relevant source, then attempt checkout. Verify that the customer receives an accurate final summary rather than an unexplained failure.
5. Restrict OAuth scopes and application credentials
A storefront needs different permissions from an order-management integration. Commercetools uses OAuth scopes for API access. Grant the smallest practical set of rights to each service and avoid placing powerful credentials in a browser or mobile package.
Design separate credentials for development, staging, and production. Make rotation and revocation part of the support plan. Also check the backend’s authorization to prevent one customer from seeing another person’s orders or profile details.
Test: Attempt an administrative order change through a catalog-only integration credential. Then try retrieving another account’s order from a customer session. Both should fail safely.
6. Build event-driven workflows that tolerate retries
Order creation can lead to payment checks, fulfillment requests, accounting entries, and email notifications. These downstream steps do not always finish in one uninterrupted transaction. Network failures and repeated events can produce duplicate side effects unless the workflow accounts for them.
Assign stable order identifiers and keep processing repeat-safe. Log a clear business state for pending, successful, and failed actions. Give staff a way to inspect and safely replay a failed fulfillment integration without creating another order.
Test: Send an order event twice to a simulated warehouse. Ensure it creates one shipping request and that a temporary failure can recover without a duplicate shipment.
7. Make frontend performance and reliability measurable
Headless systems split a shopping journey across several services. A slow response may originate in the product API, content service, search layer, payment gateway, or the frontend itself. Browser performance alone cannot reveal every bottleneck.
Track customer actions with correlation IDs where appropriate. Measure catalog load, cart update time, checkout errors, and order success. Avoid exposing personal information in diagnostic logs and ensure monitoring does not introduce unnecessary tracking.
Test: Slow down a product service in staging. Check whether product pages show a useful error, whether the cart remains usable, and whether support can identify which service caused the problem.
8. Compare composable flexibility with total operating cost
Custom frontends can differentiate a business, but each integration adds support and upgrade work. Consider whether an existing platform theme or a smaller extension could meet the same goal. A composable system makes more sense when distinct experiences or complex integration needs justify the extra responsibility.
Estimate engineering time, hosting, testing, monitoring, security, API usage, and future releases. Include staff training and incident response. Decide who owns changes to the product catalog, cart behavior, and customer identity when several teams are involved.
Test: Prepare a two-year operating comparison for a standard storefront and a composable implementation. Include realistic staffing and failure recovery costs, not just the initial build quotation.
A composable storefront needs a clear owner for each business record and a verified customer journey. API flexibility is useful only when customers can browse, buy, and receive the correct result.
A five-stage rollout for a composable commerce project
Stage 1: Map the current shopping process
Follow a real order from discovery to delivery. Identify which system provides product descriptions, stock, price, tax information, customer details, payments, and fulfillment updates. Note any manual spreadsheets or repeated data entry.
Set a baseline for checkout completion, incorrect catalog values, support requests, and order reconciliation. Also define what differentiates the proposed experience. A better mobile product finder is a clear reason to build, while general enthusiasm for APIs is not.
Stage 2: Design the data and integration contracts
Choose stable identifiers for products, variants, customers, carts, and orders. Define the authoritative source of each field and the timing of updates. Decide how every integration handles incomplete, delayed, or duplicate data.
Document which prices and inventory figures are final at checkout. Also agree on retention, access rights, export procedures, and the way customer consent is handled across connected systems.
Stage 3: Build one end-to-end purchase path
Start with one market and a manageable product range. Implement a working catalog, variant selection, cart, checkout handoff, and order confirmation. Use a real test catalog and representative customer scenarios.
Protect privileged API credentials, verify permissions, and capture operational errors. Test the entire journey before investing heavily in animations, personalization, or sophisticated merchandising rules.
Stage 4: Test complex customer scenarios
Try anonymous shopping, sign-in, expired discounts, unavailable stock, changing addresses, interrupted payment, and a returning customer. Evaluate what the shopper sees and what the order system records.
Include accessibility and mobile-device tests. A clear error message should tell the customer whether to retry, select another option, or contact support. A green confirmation banner is meaningless if the order did not reach the correct downstream system.
Stage 5: Release with monitoring and ownership
Launch in stages and track completed orders, errors, cart abandonment, integration failures, and slow pages. Assign a support owner to the storefront and each critical backend system. Keep rollback instructions for major frontend or integration changes.
Review the metrics alongside customer feedback. If a new checkout design looks faster but produces more abandoned orders, investigate the actual customer journey. Improve critical flows before expanding to more markets.
Commercetools versus a traditional storefront
A traditional ecommerce setup often bundles content, frontend design, cart, and order management. This can reduce initial integration work. A composable design gives teams more control over distinct interfaces and services but requires them to maintain the connections.
Neither approach wins in every situation. The right choice depends on product complexity, supported markets, customer experience, engineering capacity, and the business’s willingness to operate integrations over time.
For a broader discussion of development and design tradeoffs, review our guide to ecommerce website development. It helps put custom frontend choices into a wider business context.
Five mistakes to avoid
- Building custom code without a defined need. Compare a simpler alternative first.
- Duplicating product and inventory ownership. Agree on the authoritative source for each field.
- Ignoring cart and checkout edge cases. Test sign-in, expired offers, and stock changes.
- Using overly broad API scopes. Protect privileged commerce operations behind appropriate services.
- Launching without recovery procedures. Make duplicate events, failed orders, and integration outages manageable for support.
Frequently Asked Questions
Is commercetools a headless ecommerce platform?
Yes. Commercetools provides API-based commerce capabilities that businesses can connect to their own customer-facing applications and other services.
Does commercetools provide a complete custom storefront?
A business using a headless architecture must still design and maintain the frontend and relevant integrations. The exact responsibility depends on the chosen implementation and partners.
How does a guest cart work?
An anonymous cart can hold intended purchases before login. The business needs tested rules for keeping that cart and merging it with an authenticated customer’s cart.
When is composable commerce worth the effort?
It may be justified when a brand needs specialized journeys across channels or substantial control over integrations. Compare the benefit against ongoing development and support costs.
Conclusion
Commercetools can support differentiated digital commerce when teams define the surrounding architecture carefully. Start with a single purchase journey, establish field ownership, protect credentials, and validate changing prices, carts, and orders. Expand only when the measured customer and operational outcomes justify the complexity.
Build software around how your business works
Oxen Softwares can help assess custom ecommerce applications and system integrations.