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, Buy Now (isolated single-item 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)
Back in stockback-in-stock.md"Notify me" on a sold-out variant — subscribe (guest or customer), check, list, withdraw (optional plugin)
Global scriptsglobal-script.mdEnabled head/body script snippets by slot
Serviceabilityserviceability.md"Do you deliver to my pincode?" — warn or block verdict + the operator's message (optional plugin)
Guest checkoutguest-checkout.mdAnonymous contact capture, account-exists hint, public order tracking (optional plugin)
Invoiceinvoice.mdDownload my order's GST invoice — merged PDF or one vendor's (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
Payment — Razorpay Magicpayment-razorpay-magic.mdOne-click hosted checkout: start + status poll (optional plugin)
Payment — PhonePepayment-phonepe.mdPost-checkout verify for web + mobile SDK (optional plugin)
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)
Auditaudit.mdUnified audit log — every mutating HTTP request + domain event, enriched (geo/device) into ClickHouse; filterable read API (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 management portal (list/detail, ban/unban, set-role, delete, set-password, session revocation, storefront impersonation) + picker + lifetime-stats recompute
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)
Invoiceinvoice.mdPer-vendor GST invoice download (merged or single) + force regenerate (invoice:view / invoice:regenerate, 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
Stock notificationsback-in-stock.mdWho is waiting on which sold-out variant + withdraw on their behalf (stockNotification:read / :delete, optional plugin)
Orderorder.mdOrder admin (cancel/mark-paid/refund/events/stale sweep), returns override, payout ledger/draft/promote
Payment gatewayspayment-gateways.mdOption feeds: registered gateways with per-platform enablement + configured state, and the selectable checkout options
Payment — PhonePepayment-phonepe.mdOperator guide: configuration keys, enabling at checkout, gateway refunds (no PhonePe-specific endpoints — optional plugin)
Product attributeproduct-attribute.mdAttribute + attribute-group CRUD
Reviewsreviews.mdModeration: approve/reject/spam/admin-create/soft-delete
Serviceabilityserviceability.mdDelivery deny-list — bulk add/edit/remove pincodes that warn or block at checkout (serviceability:*, optional plugin)
Rewardsrewards.mdCustomer search + balance/ledger + master ledger log + manual credit/debit (optional plugin)
Searchsearch.mdAsync reindex backfill
Search Analyticssearch-analytics.mdCustomer search activity: KPIs, top/zero-result terms, trend, raw events (optional plugin)
Settingssettings.mdAdmin + store scope CRUD + platform-vendor overrides
Shippingshipping.mdPlatform override of per-vendor shipping config
Shipping — Clickpostshipping-clickpost.mdPlatform (central warehouse) ClickPost account — credentials, pickup, courier map, active-courier lookup
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
Invoiceinvoice.mdDownload + regenerate my sub-order's GST invoice (optional plugin)
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.mdRegistration wizard (single submit) + slug availability + 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
Razorpay Magic → uspayment-razorpay-magic.mdCompletion webhook + the three modal callbacks (coupons, shipping), HMAC-SHA256 (optional plugin)
PhonePe → uspayment-phonepe.mdOrder + refund lifecycle, SHA256(username:password), dedup on a composed event id (optional plugin)
Clickpost → usshipping-clickpost.mdShipment status updates, per-vendor + platform 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