# SubscriptionType

A subscription type: the organisation's hand-maintained template a customer subscription is instanced from, carrying the default billing interval and renewal behaviour new subscriptions start with. Its template lines live on the items sub-resource, and the type's name is the name plnnrly shows for every subscription of that type.

## Used by
- GET /api/v2/subscription-types: List subscription types (SubscriptionTypeList)
- POST /api/v2/subscription-types: Create a subscription type (SubscriptionType)
- GET /api/v2/subscription-types/{subscription_type}: Read a subscription type (SubscriptionType)
- PATCH /api/v2/subscription-types/{subscription_type}: Update a subscription type (SubscriptionType)
- POST /api/v2/subscription-types/{subscription_type}/actions/restore: Restore a deleted subscription type (SubscriptionType)

## SubscriptionType fields
- id (integer, required): Unique identifier.
- name (string ≤ 255, required): Subscription type name. It is also the name every customer subscription of this type is displayed under, so renaming a type renames what its existing subscriptions read as. Names are not unique.
- description (string or null, required, multiline): What subscriptions of this type cover, as free text.
- default_billing_interval (string, required): Interval a new subscription of this type is billed at by default. Omitting it on create yields yearly, the stored default, not the monthly that plnnrly's form pre-selects, which is a form convenience the API deliberately does not reproduce.
- auto_renew (boolean, required): Whether subscriptions created from this type renew automatically by default. The value is stored exactly as sent; nothing forces it to `false`.
- active (boolean, required): Whether the type is offered in the catalogue. It is a catalogue flag only: nothing in the application filters on it, so deactivating a type does not stop existing subscriptions of that type from being renewed or invoiced.
- sort_order (integer or null, required, server-assigned): Position in the catalogue, assigned by the server on create as one past the highest existing position. It is the default sort key, and there is no way to reorder types through the API: dragging types into order in plnnrly has no API equivalent in v2.0.
- created_at (timestamp (YYYY-MM-DDThh:mm:ssZ), required): Creation timestamp.
- updated_at (timestamp (YYYY-MM-DDThh:mm:ssZ), required): Last-write timestamp; use for incremental sync. It also feeds the `ETag` revision, because a subscription type has no `version` field.
- deleted_at (timestamp (YYYY-MM-DDThh:mm:ssZ) or null, required): Soft-delete timestamp, `null` while live.
- items_count (integer ≥ 0, required): Number of template lines on this subscription type.
- links (SubscriptionTypeLinks, required)
  - self (url, required): The canonical URI of this record.
  - items (url, required): Template lines on this subscription type.

## Variants

### SubscriptionTypeList

What a collection returns, and what `?view=summary` returns on a single record.

12 fields.
Identical to the detail object above.

### SubscriptionTypeSummary

The embedded form: what you get when another resource carries this one and you did not `include` it.

2 fields.
Omits: description, default_billing_interval, auto_renew, active, sort_order, created_at, updated_at, deleted_at, items_count, links

### SubscriptionTypeLinks

The `links` object on this resource.

Keys: self, items

## Example
```json
{
  "id": 1,
  "name": "Hosting retainer",
  "description": "Managed hosting and monitoring, billed monthly.",
  "default_billing_interval": "monthly",
  "auto_renew": true,
  "active": true,
  "sort_order": 1,
  "created_at": "2026-03-04T09:15:00Z",
  "updated_at": "2026-03-04T09:15:00Z",
  "deleted_at": "2026-03-04T09:15:00Z",
  "items_count": 1,
  "links": {
    "self": "https://<your-url>/api/v2/work-items/1",
    "items": "https://<your-url>/api/v2/work-items/1"
  }
}
```
