You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HTTP API map for DreamBees Art. Routes are thin transport: they guard, parse, delegate to Core services, and adapt typed results to JSON.
Auth model: signed HTTP-only session cookie (Firebase-backed user). Admin routes require role: admin. Destructive admin ops may require elevation or step-up.
Full guard implementations: src/infrastructure/server/apiGuards.ts
Conventions
Convention
Detail
Base URL
Same origin as storefront (NEXT_PUBLIC_SITE_URL)
Mutations
POST/PATCH/DELETE — assertTrustedMutationOrigin
Idempotency
Checkout, refunds, inventory batch, many admin mutations require idempotencyKey
Errors
{ error, code, retryable? } from route adapters
Rate limits
Applied per-route (auth, checkout, concierge)
Public storefront APIs
No admin role. Session optional unless noted.
Catalog & discovery
Method
Route
Purpose
GET
/api/products
Product list
GET
/api/products/[id]
Product by id
GET
/api/products/handle/[handle]
Product by handle
GET
/api/collections/[handle]
Collection + products
GET
/api/navigation
Store navigation menu
GET
/api/taxonomy/categories
Category tree
GET
/api/shipping/rates
Quote shipping (checkout)
GET
/api/shipping/zones
Zone config (public read)
Cart
Cart is a purchase intent buffer (services.cart). Physical SKUs use inventory.checkAvailability only — stock holds happen at checkout. Proof: storefront-release.md.
Method
Route
Purpose
GET
/api/cart
Load cart (CartResult<CartView>)
DELETE
/api/cart
Clear cart
POST/PATCH/DELETE
/api/cart/items
Line items
POST
/api/cart/validate
Pre-checkout validation (used by gateCheckoutCommit)
These operations must not be exposed as raw service calls. Always go through the protocol column:
Operation
Protocol
Example route
Capture payment
services.checkout
create-payment-intent, webhook
Refund
services.refunds (via admin/concierge)
admin/orders/.../refund
Move stock
services.inventory
admin/inventory/batch
Authorize admin action
services.admin
Most /api/admin/* mutations
Client access from UI
Browser code should use src/ui/apiClientServices.ts — typed wrappers over fetch with credentials and error handling. Do not call Firestore from React components.