> For the complete documentation index, see [llms.txt](https://docs.osmosworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.osmosworks.com/api-reference/billing.md).

# Billing subscriptions

Base path: `/api/v1/billing`

These endpoints let tenant administrators manage their platform subscription.

## List billing plans

* **Method:** `GET`
* **Path:** `/api/v1/billing/plans`
* **Authentication:** Tenant session

## Get current subscription

* **Method:** `GET`
* **Path:** `/api/v1/billing/subscription`
* **Authentication:** Tenant admin

### Response

```json
{
  "status": "Success",
  "message": "Subscription retrieved successfully.",
  "data": {
    "planCode": "BUSINESS",
    "planName": "Business",
    "status": "ACTIVE",
    "price": 50000,
    "currency": "NGN",
    "periodStart": "2026-10-01T00:00:00",
    "periodEnd": "2026-11-01T00:00:00"
  }
}
```

## Start checkout

Starts a Paystack subscription checkout for a paid plan.

* **Method:** `POST`
* **Path:** `/api/v1/billing/checkout`
* **Authentication:** Tenant admin

### Request body

```json
{
  "planCode": "BUSINESS"
}
```

### Response

```json
{
  "status": "Success",
  "message": "Checkout started — complete the payment on Paystack.",
  "data": {
    "planCode": "BUSINESS",
    "planName": "Business",
    "price": 50000,
    "currency": "NGN",
    "authorizationUrl": "https://checkout.paystack.com/...",
    "reference": "SUB-000001"
  }
}
```

### Error cases

| HTTP status | Message                                            | Cause                            |
| ----------- | -------------------------------------------------- | -------------------------------- |
| 400         | `The selected plan is not available for checkout.` | Plan missing, inactive, or free. |
| 400         | `The organization is already on this plan.`        | Same active plan.                |

## Change plan

* **Method:** `PUT`
* **Path:** `/api/v1/billing/subscription/plan`
* **Authentication:** Tenant admin

```json
{
  "planCode": "ENTERPRISE"
}
```

## Cancel subscription

* **Method:** `POST`
* **Path:** `/api/v1/billing/subscription/cancel`
* **Authentication:** Tenant admin

Only an active paid subscription can be canceled. Access continues until the end of the current period.

## Request card update

* **Method:** `POST`
* **Path:** `/api/v1/billing/subscription/card-update`
* **Authentication:** Tenant admin

Requests a Paystack manage-subscription link sent to the billing email.

## Platform billing plans

Platform administrators manage billing plans.

### Create or update a plan

* **Method:** `POST` / `PUT`
* **Path:** `/api/v1/platform/billing-plans` / `/api/v1/platform/billing-plans/{planId}`
* **Authentication:** Platform admin

```json
{
  "code": "BUSINESS",
  "name": "Business",
  "price": 50000,
  "currency": "NGN",
  "interval": "MONTHLY",
  "paystackPlanCode": "PLN_...",
  "maxStaff": 10,
  "maxApplicationsPerCycle": 500
}
```

### Billing operations

* **Method:** `GET`
* **Path:** `/api/v1/platform/billing-plans/ops/summary`
* **Authentication:** Platform admin
* **Method:** `GET`
* **Path:** `/api/v1/platform/billing-plans/ops/tenants`
* **Authentication:** Platform admin
* **Method:** `GET`
* **Path:** `/api/v1/platform/billing-plans/ops/past-due`
* **Authentication:** Platform admin


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.osmosworks.com/api-reference/billing.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
