# SubscriptionTypeItem

One template line on a subscription type: what is sold, how many, at what purchase and sales price, and at what VAT percentage. A subscription type is a blueprint rather than a live subscription, so these lines bill nothing themselves: they are copied, by value, onto a customer subscription's own lines the moment a type is picked for it. Editing a template line afterwards does not reach the subscriptions already created from it.

## Used by
- GET /api/v2/subscription-type-items/{subscription_type_item}: Read a template line (SubscriptionTypeItem)
- PATCH /api/v2/subscription-type-items/{subscription_type_item}: Update a template line (SubscriptionTypeItem)
- GET /api/v2/subscription-types/{subscription_type}/items: List a subscription type's template lines (SubscriptionTypeItemList)
- POST /api/v2/subscription-types/{subscription_type}/items: Add a template line to a subscription type (SubscriptionTypeItem)

## SubscriptionTypeItem fields
- id (integer, required): Unique identifier.
- subscription_type_id (integer, required, server-assigned): The subscription type this template line belongs to. Taken from the path on create and never writable afterwards: a line cannot be moved to another type.
- subscription_type (Ref or SubscriptionTypeSummary, required): The subscription type this template line belongs to.
- subscribable_type (string or null, required): The kind of record `subscribable` points at; it says which branch of `subscribable` applies.
- subscribable_id (integer or null, required): The id of the record `subscribable` points at.
- subscribable (Ref or SubscriptionProductSummary or null, required): The record this template line sells, normally a subscription product. Null on a line that sells nothing in particular, and a bare {"id": N} reference with `subscribable_type` of `domain` or `server` on a line pointed at a hosting record, which only plnnrly itself can do. Expanding it with `?include=subscribable` additionally requires `subscription_products` read permission and a token scope covering that prefix.
- name (string or null ≤ 255, required): Optional label for the template line. plnnrly's form does not show it, so most existing lines carry `null`; it exists for programmatic naming and is what `?q=` searches.
- description (string or null, required, multiline): Invoice-line text template, copied verbatim onto the customer subscription's line and resolved only when that line is invoiced. Placeholder tokens survive the copy unresolved: {{$domain}}, {{$period}}, {{$product}}, {{$customer}}, {{$site}}, {{$server}}, plus the Dutch aliases {{$domein}}, {{$periode}} and {{$klant}}.
- quantity (integer, required): Number of units the template line carries. Whole units: this is an integer, not the fractional quantity an invoice row uses.
- default_purchase_price (decimal (2 dp), required): Purchase price per unit, excluding VAT, copied onto a new customer subscription's line.
- default_sales_price (decimal (2 dp), required): Sales price per unit, excluding VAT, copied onto a new customer subscription's line. This is what eventually bills.
- vat_rate (integer, required): VAT percentage as a whole number: 21 means 21%.
- sort_order (integer, required, server-assigned): Position of the line within its subscription type, and the default sort key. Assigned on create; there is no way to reorder template lines through the API.
- 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.
- deleted_at (timestamp (YYYY-MM-DDThh:mm:ssZ) or null, required): Soft-delete timestamp, `null` while live.
- links (SubscriptionTypeItemLinks, required)
  - self (url, required): The canonical URI of this record.

## Variants

### SubscriptionTypeItemList

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

17 fields.
Identical to the detail object above.

### SubscriptionTypeItemSummary

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

2 fields.
Omits: subscription_type_id, subscription_type, subscribable_type, subscribable_id, subscribable, description, quantity, default_purchase_price, default_sales_price, vat_rate, sort_order, created_at, updated_at, deleted_at, links

### SubscriptionTypeItemLinks

The `links` object on this resource.

Keys: self

## Polymorphic fields
- subscribable: discriminated on `subscribable_type`

## Example
```json
{
  "id": 1,
  "subscription_type_id": 1,
  "subscription_type": {
    "id": 1
  },
  "subscribable_type": "subscription_product",
  "subscribable_id": 1,
  "subscribable": null,
  "name": "Managed hosting",
  "description": "Hosting for {{$domain}} over {{$period}}.",
  "quantity": 1,
  "default_purchase_price": "12.50",
  "default_sales_price": "29.95",
  "vat_rate": 1,
  "sort_order": 1,
  "created_at": "2026-03-04T09:15:00Z",
  "updated_at": "2026-03-04T09:15:00Z",
  "deleted_at": "2026-03-04T09:15:00Z",
  "links": {
    "self": "https://<your-url>/api/v2/work-items/1"
  }
}
```
