REST API Documentation¶
Versioned REST contract documentation for dichit-backend. Routes are served under versioned prefixes — v1, v2 (web app), v3 (mobile app), plus platform and webhooks.
Versions¶
| Prefix | Purpose |
|---|---|
v1 | legacy routes |
v2 | web application |
v3 | mobile application |
platform | /health, /meta, /sentry |
webhooks | pg/zwitch, sentry, whatsapp receivers |
Endpoint docs¶
| Document | Covers |
|---|---|
| company-tenancy.md | Companies, branches, branch banking, employees, invitations, scoped roles, and program ownership |
| enrollment.md | Enrollment API (v3) |
| public-marketplace.md | Public marketplace API |
| auction-and-prebid.md | Auction & pre-bid system |
| subscriber-prebid.md | Subscriber prebid lifecycle (place / edit / cancel, v2) |
| auction-list.md | Company and admin auction listing |
| auction-lifecycle-config.md | Auction policies, presets, snapshots, and automated triggers |
| auction-start.md | Live auction start and approval flow |
| challenges.md | Challenges feature |
| Company provisioning frontend integration | Superadmin company creation, direct S3 uploads, OTP login, and MOU acceptance |
New endpoint docs should follow templates/rest-api.md and be listed here when added.
Conventions (all endpoints)¶
- Schema validation on every route (Fastify JSON schema + shared Zod schemas) — see development/validation.md.
- Auth via
Authorization: Bearer <access-token>and role prevalidation — see development/authentication.md. - Errors use the shared typed error → HTTP mapping — see development/error-handling.md.
- BigInt (and
Decimal) values serialize as JSON strings. - Pagination for lists uses deterministic ordering — see database/optimization.md.
- Response shapes are stable; avoid breaking changes without an ADR and a version bump.