Skip to content

Environments ​

Playbooks show full URLs you can paste. Paths without a host are the same resource.

Dev (default in these docs) ​

LayerBase URLExplorer
Core Backendhttps://backend-dev.bookdirect.live/public/api/v1/nellalinkCore Backend docs
Middleware Backendhttps://middleware-dev.bookdirect.live/api/v1Middleware Backend docs

Core Backend is served from Laravel public/, so the browser path includes /public. Middleware Backend does not use /public.

Examples:

POST https://backend-dev.bookdirect.live/public/api/v1/nellalink/user/login
POST https://middleware-dev.bookdirect.live/api/v1/nellalink/properties
POST https://middleware-dev.bookdirect.live/api/v1/bookdirect/payments/initialize
POST https://middleware-dev.bookdirect.live/api/v1/nellalink/file-manager/aws/upload-url

Headers every Core Backend call needs ​

HeaderRequiredValue
x-api-keyYesPublic browse key in the Next.js app (NEXT_PUBLIC_API_KEY) for listing active properties. Write key (JWT required) for creates/updates — prefer Middleware Backend for those writes. See Security and IDOR.
AuthorizationWrites and private readsBearer {access_token} from login
Content-TypePOST / PUTapplication/json

The browse key is assumed public. IDOR is Core Backend path settings + Middleware Backend, not frontend.

Headers every Middleware Backend call needs ​

HeaderRequiredValue
AuthorizationYes (except PSP webhooks)Same Core Backend JWT (iss must be nellalink)
x-api-keyWhen the route declares itSame site key unless the Middleware Backend folder uses its own
Content-TypePOST / PUTapplication/json

Webhooks (Paystack, Squad, Tsara) use the provider signature header, not a user JWT.

Staging and live ​

Replace the host only. Paths stay the same.

EnvCore Backend hostMiddleware Backend host
Devhttps://backend-dev.bookdirect.livehttps://middleware-dev.bookdirect.live
Stagingset when promotedset when promoted
Liveset when promotedset when promoted

Document new hosts on /next first, then promote.

Standard response envelope (Core Backend and Middleware Backend) ​

json
{
  "status": true,
  "status_code": 200,
  "message": "Login successful.",
  "data": {},
  "meta": { "pagination": {} }
}

Errors:

json
{
  "status": false,
  "status_code": 422,
  "message": "Validation error",
  "error": {
    "error_code": "optional-code",
    "recommendation": ["What to fix"]
  }
}

JWT ​

  • Issuer: nellalink
  • Typical access-token life: 30 minutes. Use POST .../user/refresh with a refresh token, or re-login.
  • Store data.uuid (user) and data.access_token. Send that uuid as owned_by on creates. Core Backend must reject a mismatch with the JWT.

API-first. Middleware Backend wins over Core Backend when both exist.