Subscription Templates

This resource represents a subscription template. A subscription template provides a reusable configuration for creating subscriptions with predefined line items, tax settings, and billing intervals.

All amounts are in the minor unit of the currency. For example, 1000 represents $10.00 for USD, £10.00 for GBP, or ¥1000 for JPY.

Properties

id string

The unique identifier for this subscription template.

object string

The object type of this resource.

createdAt string

The date this template was created in RFC3339 format.

updatedAt string

The date this template was last updated in RFC3339 format.

name string

The name of the subscription template.

memo string

An arbitrary string attached to the template, often useful for displaying to users.

taxPercentage number

The percentage of tax to be applied to subscriptions created from this template.

currency string

The 3 letter currency code representing the settlement currency for subscriptions created from this template.

interval string

The billing frequency for subscriptions created from this template. Only required if any of the line items doesn't have a recurring price. When line items include a recurring price, the interval is automatically determined from that price. One of:

intervalCount integer

The number of intervals between subscription billings. For example, interval=month and intervalCount=3 bills every 3 months. Used in conjunction with the interval field to determine billing frequency.

lineItems array(object)

Array of line items to be included in subscriptions created from this template:

Amount in cents for one unit. Required if priceId not provided.

Description of the line item. Optional for items with priceId where product name is used.

Quantity of the item (can be decimal).

ID of the price object. Required if amount not provided.

ID of the associated product object.

Note: When a subscription is created using a template, the template's configuration (lineItems, memo, taxPercentage, currency, and interval) will be automatically applied to the new subscription.

Example Subscription Template Object

{
    "id": "9e1e238f-25e5-4aff-b5f3-6793f8f2703f",
    "object": "subscriptionTemplate",
    "createdAt": "2024-06-24T18:22:31.123456Z",
    "updatedAt": "2024-06-24T18:22:31.123456Z",
    "name": "Enterprise Package",
    "memo": "Annual enterprise subscription package",
    "taxPercentage": 8.5,
    "currency": "usd",
    "interval": "year",
    "intervalCount": 1,
    "lineItems": [
        {
            "amount": 50000,
            "description": "Base License",
            "quantity": 10
        },
        {
            "amount": 25000,
            "description": "Premium Support",
            "priceId": "81108543-bc52-4202-83de-71ad52a74df9",
            "productId": "d0000000-d7a5-473d-a75b-9821a8f4e191",
            "quantity": 1
        }
    ]
}