Skip to main content
GET
/
v1
/
subscription-plans
curl -X GET "https://olp-api.nipuntheekshana.com/v1/subscription-plans?active=true" \
  -H "Authorization: Bearer <your_jwt_token>"
{
  "plans": [
    {
      "id": "plan_abc123def456",
      "name": "Pro Monthly",
      "amount": 29.99,
      "currency": "USD",
      "interval": "monthly",
      "trialDays": 14,
      "subscriberCount": 42,
      "active": true,
      "createdAt": "2026-03-01T10:00:00Z"
    },
    {
      "id": "plan_xyz789ghi012",
      "name": "Enterprise Yearly",
      "amount": 299.00,
      "currency": "USD",
      "interval": "yearly",
      "trialDays": 30,
      "subscriberCount": 8,
      "active": true,
      "createdAt": "2026-02-15T08:00:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 2,
    "totalPages": 1
  }
}

Authentication

This endpoint requires a Bearer token in the Authorization header.
Authorization: Bearer <your_jwt_token>

Query Parameters

page
integer
default:"1"
The page number for pagination.
limit
integer
default:"20"
The number of plans per page. Maximum value is 100.
active
boolean
Filter by plan status. Set to true to return only active plans, or false for inactive plans.

Response

plans
array
An array of subscription plan objects.
pagination
object
Pagination metadata.
curl -X GET "https://olp-api.nipuntheekshana.com/v1/subscription-plans?active=true" \
  -H "Authorization: Bearer <your_jwt_token>"
{
  "plans": [
    {
      "id": "plan_abc123def456",
      "name": "Pro Monthly",
      "amount": 29.99,
      "currency": "USD",
      "interval": "monthly",
      "trialDays": 14,
      "subscriberCount": 42,
      "active": true,
      "createdAt": "2026-03-01T10:00:00Z"
    },
    {
      "id": "plan_xyz789ghi012",
      "name": "Enterprise Yearly",
      "amount": 299.00,
      "currency": "USD",
      "interval": "yearly",
      "trialDays": 30,
      "subscriberCount": 8,
      "active": true,
      "createdAt": "2026-02-15T08:00:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 2,
    "totalPages": 1
  }
}