API Reference
This page is a compact reference for the live route groups mounted by apps/api/src/app.ts.
Route Groups
/api/v1/auth/api/v1/consumer/api/v1/pos/api/v1/client/api/v1/marketing/api/v1/admin/api/v1/webhooks/api/v1/oauth/api/v1/internal/cron
What the API Owns
- session profile resolution
- tenant membership enforcement
- reward rule management
- merchant onboarding and POS connection setup
- webhook ingest and transaction normalization
- wallet credit and redemption code generation
- campaign creation and campaign sending sweeps
- admin actions and audit logging
Authentication Model
Most routes require a Bearer token from Supabase. The API uses that token to resolve the current users row, role, and tenant memberships before any tenant-scoped query runs.
Important Contracts
- tenant IDs always come from the URL path
- reward and wallet updates are transactional
- webhook receivers return fast and process asynchronously
- admin actions must write audit logs
Best Next Reads
Written byDhruv Doshi