Skip to main content

Recipes

Practical, copy-paste-ready code examples for the most common commerce workflows. Every recipe uses the TypeScript SDK.
All examples assume you have already installed and configured the SDK. See the Introduction if you haven’t.

Recipe 1: Customer Authentication

Register a new customer, log in, and use the customer token to access protected routes like order history.

Recipe 2: Cart Merging After Login

When an anonymous visitor adds items to a cart and then logs in, merge the guest cart into their existing customer cart.

Recipe 3: Discount Code Workflow

Admin creates a discount code, the storefront applies it to a cart, and the customer checks out with the discount.

Recipe 4: Inventory Management

List products with low stock, adjust inventory quantities, and configure safety stock thresholds.

Recipe 5: Return & Refund Flow

A customer requests a return, the admin reviews and processes it through approval, receiving, completion, and finally issues a refund.

Recipe 6: Fulfillment Lifecycle

Create a fulfillment for an order, add tracking info, mark as shipped, and then mark as delivered.

Recipe 7: Multi-Region Pricing

Create regions with different currencies and set region-specific prices for products.

Recipe 8: CSV Bulk Import

Import products from a CSV spreadsheet, handling validation errors gracefully.
Expected CSV format:

Next Steps

Webhooks

Webhook setup, signature verification, and production-grade processing patterns.

API Reference

Explore all 100+ REST endpoints.

SDKs

TypeScript and Python SDK reference with every resource and method.

Stripe Integration

Set up Stripe payments for your storefront.