Appearance
Products
GET /api/v1/merchant/products requires products:read. PUT /api/v1/merchant/products requires products:write.
Use GET to discover or validate SKUs before creating orders. Use PUT to create or update a NON_STOCK ACTIVE product by normalized SKU. The response is a small public catalog: id, sku, name, unit, status, inventoryTracking.
sku is the external product identity. It is unique per merchant after normalization (trim + uppercase). Do not persist Chuchu product UUIDs in Eco. Recreating a product with a new UUID and the same SKU is the same external product.
Inactive products still appear in this list (status). Creating an order with an inactive SKU returns 422 PRODUCT_SKU_INACTIVE. Unknown SKUs return 422 PRODUCT_SKU_NOT_FOUND. Tracked vs NON_STOCK does not change the SKU contract; inventory rules apply after the order is confirmed.
Query parameters:
sku— exact SKU after Chuchu normalizationsearch— name or SKU containspage,pageSize
bash
curl "https://api.chuchu.mn/api/v1/merchant/products?sku=PAPER-A4" \
-H "Authorization: Bearer $CHUCHU_API_KEY"
curl -X PUT "https://api.chuchu.mn/api/v1/merchant/products" \
-H "Authorization: Bearer $CHUCHU_API_KEY" \
-H "Content-Type: application/json" \
-d '{"sku":"PAPER-A4","name":"A4 Paper","unit":"pcs"}'Packing strategies (internal)
Packing is a physical handling rule, not an inventory unit. The merchant catalog above does not expose it.
Admin product detail (GET /api/v1/products/:id) returns packingStrategies. Nested writes:
POST /api/v1/products/:productId/packing-strategiesPATCH /api/v1/products/:productId/packing-strategies/:strategyId
Delivery items snapshot the chosen strategy. Historical deliveries must not be re-rendered from the live product config.
Production backfill
Do not guess product UUIDs. Seed by canonical SKU:
bash
pnpm --filter @chuchu/api packing:backfill -- --merchant-slug=YOUR_SLUG| Product | Default SKU env | Strategies |
|---|---|---|
| A4 | PACKING_A4_SKU (default PAPER-A4) | BOX × 5, default |
| EZPay | PACKING_EZPAY_SKU (default EZPAY) | PACK × 20 default; BOX × 100 recommended from 100 |
Missing SKUs are skipped. The upsert is idempotent on (productId, code). Set the env vars to the live catalog SKUs before running in production.