Skip to main content
API · Webhooks · Permissions · Self-Hosting

RamaSites Developer Ecosystem

Technical reference covering Next.js platform routes, FastAPI v1 REST services, HMAC-SHA256 webhook verification, RBAC permissions, and self-hosted Docker deployment.

API Reference (Verified Production Routes)

Storefront, multi-tenant control hub, and backend services communicate via `/api/platform/*` (Next.js App Router) and `/api/v1/*` (FastAPI Python service). FastAPI also serves a live OpenAPI schema at `/api/v1/openapi.json` when running in development mode.

Next.js Platform API (`/api/platform/*`)

/api/platform/sitesGET / POST
Auth: Session (role-scoped)

Read tenant websites, save builder snapshots, create or publish workspaces.

/api/platform/productsGET / POST
Auth: Public catalog / Session write

Query active site SKUs by siteSlug or update catalogue & sortPriority.

/api/platform/businessGET / POST
Auth: Role & tenant scoped

Storefront checkout orders, CRM leads/deals, GST Rule-46 invoices, tables/KDS.

/api/platform/paymentsGET / POST
Auth: Public Gateway Safe Meta / Session write

Resolve enabled domain Razorpay/Cashfree/UPI config or save credentials (secrets masked).

/api/platform/feed/[slug]GET
Auth: Public feed

Machine-readable Google/Meta Commerce product feed JSON for a published siteSlug.

/site/[siteSlug]/llms.txtGET
Auth: Public AI feed

Live Markdown /llms.txt index of business offerings, contact details, and catalogue items.

/api/platform/statusGET
Auth: Public probe

Active readiness probe returning PostgreSQL /ready status and storefront store health.

Core FastAPI Service (`/api/v1/*`)

/api/v1/auth/register · /login · /refreshPOST

JWT Bearer authentication and token renewal (strict Nginx rate limits applied).

/api/v1/projects · /files/{project_id}/*GET / PATCH

Multi-file generated project workspace CRUD and preview tree management.

/api/v1/wallet · /wallet/rechargeGET / POST

Prepaid platform wallet credits and transaction ledger tracking.

/api/v1/reseller/branding · /pricingGET / PUT

Agency portal domain white-label config, wholesale tiers, and APK build triggers.

/api/v1/webhooks/razorpay/{domain}POST

HMAC-SHA256 verified webhook handler validating `X-Razorpay-Signature`.

/api/v1/webhooks/cashfree/{domain}POST

HMAC-SHA256 verified webhook handler checking `x-webhook-signature` + timestamp.

/api/v1/webhooks/stripePOST

Official `Stripe-Signature` payload validation for subscriptions and invoice events.

Authentication & Permissions

Session Cookies, JWT Bearer Tokens & 61 Feature Keys

  • Dashboard & Platform Sessions: Signed `ramasites_session` HttpOnly cookies protect `/api/platform/*` mutations, scoped automatically to `super_admin`, `reseller`, or `merchant` (`ownerId` / `siteSlug`).
  • Granular Client Locking: Resellers govern client workspaces through 61 capability keys (`reseller.featurePackages`) covering Commerce, CRM, Delivery, Marketing, Setup, and Books.
  • SDK Status: No external third-party npm or PyPI SDK wrapper is published separately today; applications integrate directly over standard HTTPS JSON `fetch` or `httpx` requests.
Webhook Verification

Cryptographic Signature Verification (Unthrottled Route)

`/api/v1/webhooks/*` routes are excluded from Nginx burst rate limits so payment providers never get dropped during high order volume. Every webhook verifies signatures against raw request bytes using `hmac.compare_digest`:

# Verify Razorpay webhook payload (Node.js)
import crypto from 'node:crypto';
const expected = crypto
  .createHmac('sha256', domainWebhookSecret)
  .update(rawBody)
  .digest('hex');
const valid = crypto.timingSafeEqual(
  Buffer.from(expected),
  Buffer.from(req.headers['x-razorpay-signature'])
);

Integration Directory

  • Razorpay (Direct Settlement + Webhook HMAC)
  • Cashfree Payments (Direct Settlement + Timestamp HMAC)
  • PhonePe & Custom UPI Merchant IDs
  • Stripe (International Card Billing)
  • Meta WhatsApp Cloud API (Official WABA Templates)
  • Google Analytics 4 & Microsoft Clarity (Opt-In)
  • Custom CNAME DNS & Let’s Encrypt SSL
  • PostgreSQL 16 + Redis 7 + Docker Compose

Quick Start Examples (`curl`)

# 1. Inspect machine-readable storefront feed
curl -s https://ramasites.in/api/platform/feed/amrit | jq .

# 2. Fetch AI-readable /llms.txt business summary
curl -s https://ramasites.in/site/amrit/llms.txt

# 3. Check live platform & PostgreSQL readiness
curl -s https://ramasites.in/api/platform/status
Deployment Guides

Community Docker & BYOI

Launch a single-store Community instance with `docker-compose.community.yml` (Next.js 16 + FastAPI + PostgreSQL 16 + Redis 7), or license Enterprise BYOI for 250+ sub-sites.

View Docker Deployment Guide →
Contributions & Releases

Clean PRs & Type Safety

Contributions must pass `npm run type-check`, `npm run lint`, preserve tenant `siteSlug` isolation boundaries, and avoid introducing unsanitized client secrets.

Browse Product Changelog →
Security Reporting

Vulnerability Disclosure

Do not test exploits against live merchant sites. Send proof-of-concept reports to security@ramasites.in. CSP telemetry posts automatically to `/api/platform/csp-report`.

Read Trust & Security Policy →