Commerce App
The Commerce app provides cart and promotion management for Hantera. To integrate with e-commerce Storefronts, check out Hantera Storefront SDK. It uses ticket actors as the underlying data model — each cart is a ticket with type cart.
What It Provides
HTTP Ingresses
Public HTTP endpoints for storefront integration:
| Category | Endpoints |
|---|---|
| Cart | Create cart, get cart, SSE events |
| Items | Add item, remove item, set quantity |
| Details | Set address, email, phone |
| Fields | Set/remove custom fields |
| Coupons | Add/remove coupons |
| Configuration | List cart profiles |
See API Reference for full endpoint documentation.
Cart Rendering Pipeline
Every cart mutation returns a rendered cart — a normalized representation with computed prices, totals, shipping, and tax. The rendering pipeline:
- Previews the cart with a
completemessage (triggers order creation rules) - Queries the resulting order for totals and line items
- Maps the data into a flat, storefront-friendly structure
Custom Hooks
The Commerce app fires the OnCartMutation custom hook after every successful render, enabling other apps to react to cart state changes.
Cart Profiles
Cart profiles configure currency, default country, and allowed countries per storefront channel. Configured via the Commerce app settings in the portal.
Architecture
Getting Started
- Install the Commerce app on your Hantera instance
- Configure a cart profile (currency, country settings)
- Use the API or Storefront SDK from your storefront