Supercommerce API Docs

API Reference

Per-role HTTP surface for the Supercommerce backend — store, admin, vendor, and webhooks.

Per-role split of the API documentation. Each module's HTTP surface is documented separately for the storefront (customer-facing), admin (platform operator), vendor (seller self-service), and webhooks (inbound from external providers) audiences.

Canonical, full-module docs still live in ../*.md (cart.md, order.md, etc.). The files here are role-scoped slices of those docs — useful for client teams that only build against one surface.


Conventions (shared)

  • Response envelope{ data, message, statusCode, metadata? } via ResponseInterceptor. Paginated lists use ApiWrappedPaginatedResponse with metadata.total/limit/offset/hasMore (the ResponseInterceptor only forwards a metadata field — a handler that returns any other key, e.g. pagination, has it dropped).
  • Money — integer subunits (paise / cents). Single currency per tenant.
  • Dates — ISO 8601 strings (z.iso.datetime() at the DTO layer; dayjs().toDate() in services).
  • Auth — better-auth sessions. Storefront uses customer sessions, admin uses admin sessions with RBAC permission checks, vendor uses vendor sessions scoped to req.vendor.id.
  • Multi-tenant — vendor endpoints scope every read/write to the session's vendor. Cross-vendor ids return 404, never 403, so existence of other tenants' data can't be inferred.

Store — /store/** and public reads

Customer-facing surface. Auth = customer session (or public for catalog/banner/dynamic-link reads).

ModuleFileSurface
Affiliateaffiliate.mdApply / dashboard / link generation / /r/:code redirect / balance + payouts (optional plugin)
Bannerbanner.mdPublic banner read by entity slug
Cartcart.mdCart resolve, lines, address, coupons, gifts, sync, prepare-checkout
Catalogcatalog.mdPublic categories (incl. tree), brands, tags, ingredients + product detail (PDP) by slug
Customercustomer.mdAddress book CRUD + default management
Dynamic linkdynamic-link.mdCMS link-group by slug
Frequently Bought Togetherfbt.mdPDP single-anchor + cart multi-anchor co-purchase recommendations (public)
Global scriptsglobal-script.mdEnabled head/body script snippets by slot
Guest checkoutguest-checkout.mdAnonymous contact capture, account-exists hint, public order tracking (optional plugin)
Notificationsnotifications.mdCustomer FCM device register/unregister
Orderorder.mdProvider discovery, place-order, list/detail/cancel, full returns flow
Payment — Razorpaypayment-razorpay.mdSDK callback verify
Reviewsreviews.mdAnonymous list + aggregate, authenticated submit
Rewardsrewards.mdBalance + history + cart redemption set/clear (optional plugin)
Searchsearch.mdFaceted product search + autocomplete
Settingssettings.mdPublic registry-flagged setting reads
Shippingshipping.mdCustomer-scoped sub-order tracking timeline
Wishlistwishlist.mdSingle "My Wishlist" — list, add, remove, clear, add-to-cart, contains

Admin — /admin/**

Platform operator surface. Auth = admin session + RBAC permission strings (e.g. user: list, product: create). Permission codes are documented per-endpoint and indexed in admin-rbac.md.

ModuleFileSurface
RBACadmin-rbac.mdRoles + permissions catalog
Affiliateaffiliate.mdApplications, affiliates (suspend / overrides / audit), per-entity overrides, payouts (optional plugin)
Bannerbanner.mdBanner CRUD + soft-delete/restore
Cartcart.mdCart browse/detail/discard + analytics (funnel, abandonment, cohort)
Catalogcatalog.mdProducts, variants, brands, categories, tags, ingredients (incl. vendor-request approval)
Customercustomer.mdCustomer picker
Discountdiscount.mdRule CRUD + archive/unarchive
Dynamic linkdynamic-link.mdGroup + nested-link CRUD, duplicate, reorder
Free giftfree-gift.mdAUTOMATIC / BUYXGETY / COUPON_BASED rules
Frequently Bought Togetherfbt.mdOn-demand rebuild trigger + paginated rebuild audit log
Global scriptsglobal-script.mdHead/body script-snippet CRUD + soft-delete/restore
Google Merchantgoogle-merchant.mdOAuth lifecycle, data sources, bootstrap, items list/detail/resync/delete + live Merchant API probe (optional plugin)
Klaviyoklaviyo.mdConnect/disconnect + profile/event/catalog/category/coupon sync triage, resync, bootstrap (optional plugin)
Meta Catalogmeta.mdOAuth lifecycle, business/catalog selection with System User token mint, bootstrap, items list/detail/resync/delete-from-meta + live Graph probe; async items_batch + handle poller (optional plugin)
Notificationsnotifications.mdBroadcast send/list/detail/cancel + log audit
Orderorder.mdOrder admin (cancel/mark-paid/refund/events/stale sweep), returns override, payout ledger/draft/promote
Product attributeproduct-attribute.mdAttribute + attribute-group CRUD
Reviewsreviews.mdModeration: approve/reject/spam/admin-create/soft-delete
Rewardsrewards.mdCustomer search + balance/ledger + manual credit/debit (optional plugin)
Searchsearch.mdAsync reindex backfill
Settingssettings.mdAdmin + store scope CRUD + platform-vendor overrides
Shippingshipping.mdPlatform override of per-vendor shipping config
Taxtax.mdPlatform override of per-vendor flat-tax lines
Vendorvendor.mdApplication list/approve/reject + vendor directory

Vendor — /vendor/**

Seller self-service surface. Auth = vendor session; every endpoint scopes to req.vendor.id.

ModuleFileSurface
Cartcart.mdVendor-scoped cart browse + analytics (read-only)
Catalogcatalog.mdProducts, variants, tabs, catalog-requests (full CRUD within vendor scope)
Inventoryinventory.mdPer-variant snapshot/policy/adjustments/movements, listing, CSV import
Notificationsnotifications.mdVendor FCM device register/unregister
Orderorder.mdSub-order fulfill/cancel/deliver, returns lifecycle, payouts read
Product attributeproduct-attribute.mdRead-only attribute + group browse
Reviewsreviews.mdModeration gated by admin allow-flags
Settingssettings.mdAdmin + store scope read/group/bulk-update with gating
Shippingshipping.mdProviders list, config, per-sub-order tracking
Shipping — Clickpostshipping-clickpost.mdCredentials + pincode + courier allow-list + webhookUrl
Taxtax.mdFlat tax row replace
Vendorvendor.mdApplication submit + my-applications history

Webhooks — inbound from external providers

Signed inbound surface. Each provider has its own signature scheme; secrets live in admin or per-vendor settings (not env vars).

SourceFileSurface
Razorpay → uspayment-razorpay.mdpayment.captured / payment.failed reconcile, HMAC-SHA256
Clickpost → usshipping-clickpost.mdShipment status updates, per-vendor HMAC, dedup on (provider_id, external_event_id)
Klaviyo → usklaviyo.mdMarketing-consent mirror (profile.suppressed / profile.unsuppressed), HMAC-SHA256, dedup on event id (optional plugin)
Storage (cross-role)storage.mdPOST /storage/presigned — presigned S3 PUT for any authenticated session

On this page