REST · Version 1

API reference

Base path /v1. Auth via session or bearer as implemented with Better Auth. IDs are UUIDs unless noted. All request/response bodies are JSON.

Health

Method Path Body Response
GET /v1/health { "ok": true, "version": "1.0.0" }

Auth & profile

Method Path Body Response
POST /v1/auth/register email?, phone, name, password? user (+ session per auth design)
POST /v1/auth/login phone? / email? + password? user + session
POST /v1/auth/otp/send { "phone": string } { "sent": true, "cooldownSec": number }
POST /v1/auth/otp/verify { "phone", "code" } user + session
POST /v1/auth/logout { "ok": true }
GET /v1/me { "user": User }
PATCH /v1/me partial profile { "user": User }

Packages & calendar

Method Path Notes
GET /v1/packages Query: type, q, price range, cursor pagination
GET /v1/packages/:slug Full detail for PDP
GET /v1/puja-dates Filter by date range / kind
GET /v1/shahi-snan-dates Fixed five dates (Jan 14 – Feb 26, 2027)

Stalls

Method Path Notes
GET /v1/stalls Optional bbox filter
GET /v1/stalls/nearby lat, lng, radiusMeters?
GET /v1/stalls/:id Detail

Bookings & pilgrims

Method Path Notes
POST /v1/bookings Create draft/pending booking
GET /v1/bookings/:id Includes pilgrims, ancestors, payment summary
PATCH /v1/bookings/:id service_date, slot, notes
POST /v1/bookings/:id/pilgrims Replace or append per API contract
DELETE /v1/bookings/:id/pilgrims/:pilgrimId
POST /v1/bookings/:id/ancestors Pind Pradanam
POST /v1/bookings/:id/confirm-details Validate pilgrim/ancestor rules before pay
POST /v1/bookings/:id/cancel Reason optional
GET /v1/me/bookings Cursor + status filter

Payments (Stripe)

Method Path Notes
POST /v1/payments/intent Creates Checkout Session or PaymentIntent + returns client secret / URL per chosen flow
GET /v1/bookings/:id/payments History for dashboard
POST /v1/webhooks/stripe Raw body; signature verification; idempotent

Reviews, water, devices

Method Path Notes
GET /v1/reviews Filter by packageId
POST /v1/reviews Authenticated user
DELETE /v1/reviews/:id Owner or admin
POST /v1/water-orders Veda orders
GET /v1/me/water-orders
GET /v1/water-orders/:id
POST /v1/devices Push token registration (Expo FCM/APNs pipeline)
DELETE /v1/devices/:id

Admin (recommended)

Protected routes for operations staff: list bookings, change status, refunds via Stripe dashboard or API. Scope and RBAC TBD.

Representative JSON shapes

// PackageSummary
{ "id": "uuid", "slug": "string", "title": "string",
  "type": "ganga_aarti", "priceFrom": 49900, "currency": "INR",
  "heroImageUrl": "https://…", "tags": ["…"] }

// BookingDetail
{ "id": "uuid", "status": "pending", "packageId": "uuid",
  "serviceDate": "2027-01-14T00:00:00.000Z",
  "pilgrims": […], "ancestors": […], "payments": […] }