E-commerce Module
The Aerostack E-commerce module is a high-performance, edge-native commerce engine built directly on top of the Unified SDK. It handles the heavy lifting of product modeling, inventory management, and secure checkout flows so you can focus on building your brand.
Why use our E-commerce Module?
- Global Performance: Products and carts are cached at the edge, ensuring sub-100ms TTB (Time To Basket).
- Stripe Native: Built-in orchestration for Stripe checkout and webhooks.
- Extensible Schema: Add custom attributes to any product type via the Admin Panel or CLI.
- Zero Lock-in: All commerce data remains in your project’s SQL database (D1 or Postgres).
🚀 One-Command Setup
Initialize a new project with the commerce module pre-configured:
aerostack init --module ecommerceThis command provisions your orders, products, and baskets tables automatically and sets up the necessary edge routing.
The Developer Track
1. Fetching Products
You can use either the standard REST API or the unified SDK.
import { sdk } from '@aerostack/sdk';
export default async function(event) {
// Access commerce data directly via the SDK
const products = await sdk.db.query('SELECT * FROM products WHERE featured = true');
return { products };
}2. Managing Carts
Aerostack handles session-based cart management at the edge. No database round-trips are required for basic cart operations.
POST /api/v1/ecommerce/cart/add
Content-Type: application/json
{
"product_id": "prod_123",
"quantity": 2
}3. Integrated Checkout
When a user is ready to buy, generate a secure checkout session:
https://api.aerocall.app/api/v1/public/projects/your-project/ecommerce/checkoutAdvanced Customization
Looking to add custom logic to the checkout process? Use Logic Lab Hooks to intercept the order creation event and apply custom business rules, like dynamic discounts or inventory checks.