API

Organizations - Billing

Owner endpoint for viewing the organization's subscription status and plan details.

Base path: /api/v1/organizations/billing

Used by: owner-booki-web-app · Role: owner, branch-manager
organizationId: From JWT token (automatically scoped to the authenticated user's organization)


GET /api/v1/organizations/billing/subscription — Get Subscription

Auth: Protected (Authorization: Bearer <accessToken>)
Used by: owner-booki-web-app · Role: owner, branch-manager
Description: Fetch the current subscription status and plan details for the authenticated user's organization.

Request

GET /api/v1/organizations/billing/subscription

Response (200 OK)

{
  "subscription": {
    "_id": "607f1f77bcf86cd799431234",
    "organizationId": "507f191e810c19729de860ea",
    "status": "active",
    "interval": "monthly",
    "pricePerBranch": 999,
    "branchCount": 2,
    "totalAmount": 1998,
    "trialEndsAt": "2026-07-01T00:00:00Z",
    "nextBillingDate": "2026-06-01T00:00:00Z",
    "startDate": "2026-04-01T00:00:00Z",
    "createdAt": "2026-04-01T09:00:00Z"
  }
}

Fields:

  • status: trial | active | suspended | cancelled
  • interval: monthly | annually
  • pricePerBranch: Per-branch monthly fee in PHP
  • branchCount: Number of branches in the subscription
  • totalAmount: pricePerBranch × branchCount
  • trialEndsAt: When the free trial expires (null if not in trial)
  • nextBillingDate: Upcoming billing date

Error Responses

401 Unauthorized — No valid token:

{
  "statusCode": 401,
  "message": "Access token is required to proceed."
}

404 Not Found — Organization has no subscription:

{
  "statusCode": 404,
  "message": "Subscription not found."
}

cURL Example

curl -X GET http://localhost:4001/api/v1/organizations/billing/subscription \
  -H "Authorization: Bearer OWNER_TOKEN"