Skip to content
Try For Free
Bizstim
Free tools
Pricing Contact Log in
Try For Free Book Demo
Home / API Reference / Plan categories
Resource

Plan categories

The headings your public Plans page groups plans and packages under, in your order. Granted with plans.

The plan_category object

Every plan_category record carries these fields in this order, after object, which is always "plan_category".

FieldTypeDescription
idinteger
namestring, up to 100 charactersThe heading shown on the Plans page. One name per account (not case sensitive).
descriptionstring, up to 255 charactersA line under the heading; empty when none.
orderingintegerThe category's place, lowest first. A new category is placed last; the order is changed by dragging in the app. Read-only.
plansintegerHow many plans (any status) use the category. Read-only.
packagesintegerHow many service groups (packages, any status) use the category. Read-only.

Example

{
    "object": "plan_category",
    "id": 42,
    "name": "Example name",
    "description": "An example description.",
    "ordering": 1,
    "plans": 1,
    "packages": 1
}

List plan categories

GET /api/v1/plan-categories

Parameters

ParameterInDescription
limitqueryRecords per page, 1 to 1000 (default 100).
offsetqueryRecords to skip (default 0).

Returns

A list envelope of plan_category records (see Pagination).

Request

curl "https://www.bizstim.com/api/v1/plan-categories" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -H "Accept: application/json"

Response

{
    "object": "list",
    "total": 2,
    "limit": 100,
    "offset": 0,
    "has_more": false,
    "data": [
        {
            "object": "plan_category",
            "id": 42,
            "name": "Example name",
            "description": "An example description.",
            "ordering": 1,
            "plans": 1,
            "packages": 1
        },
        {
            "object": "plan_category",
            "id": 43,
            "name": "Example name",
            "description": "An example description.",
            "ordering": 1,
            "plans": 1,
            "packages": 1
        }
    ]
}

Retrieve a plan category

GET /api/v1/plan-categories/{id}

Parameters

ParameterInDescription
idpathThe record's id.

Returns

One plan_category record, or 404 not_found when no record with that id exists on your account.

Request

curl "https://www.bizstim.com/api/v1/plan-categories/42" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -H "Accept: application/json"

Response

{
    "object": "plan_category",
    "id": 42,
    "name": "Example name",
    "description": "An example description.",
    "ordering": 1,
    "plans": 1,
    "packages": 1
}

Create a plan category

POST /api/v1/plan-categories

Request body

A JSON object (Content-Type: application/json) with these fields.

FieldTypeRequiredDescription
namestring, up to 100 charactersyesThe heading (tags are removed).
descriptionstring, up to 255 charactersnoA line under the heading.

Returns

201 with the new category record, placed last in the order. 400 invalid_request names the field to fix; 409 conflict when the account already has a category with that name.

Request

curl -X POST "https://www.bizstim.com/api/v1/plan-categories" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "High School",
    "description": "Grades 9 to 12"
}'

Response (201)

{
    "object": "plan_category",
    "id": 42,
    "name": "Example name",
    "description": "An example description.",
    "ordering": 1,
    "plans": 1,
    "packages": 1
}

Update a plan category

PATCH /api/v1/plan-categories/{id}

Parameters

ParameterInDescription
idpathThe record's id.

Request body

A JSON object (Content-Type: application/json) with these fields.

FieldTypeRequiredDescription
namestring, up to 100 charactersnoThe heading (cannot be emptied).
descriptionstring, up to 255 charactersnoA line under the heading; "" removes it.

Returns

200 with the updated category record. Fields left out keep their values. 400 invalid_request; 404 not_found; 409 conflict when another category has that name.

Request

curl -X PATCH "https://www.bizstim.com/api/v1/plan-categories/42" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "High School (9-12)"
}'

Response

{
    "object": "plan_category",
    "id": 42,
    "name": "Example name",
    "description": "An example description.",
    "ordering": 1,
    "plans": 1,
    "packages": 1
}

Delete a plan category

DELETE /api/v1/plan-categories/{id}

Parameters

ParameterInDescription
idpathThe record's id.

Returns

200 with {"id", "object": "plan_category", "deleted": true}. 404 not_found; 409 conflict while a plan or a service group (package) uses it: move them first.

Request

curl -X DELETE "https://www.bizstim.com/api/v1/plan-categories/42" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -H "Accept: application/json"

Response

{
    "id": 42,
    "object": "plan_category",
    "deleted": true
}