Subscription items
One price within a subscription, with a quantity. Add, change and remove items with proration.
The subscription item object
idstring
Prefixed
si_.objectstring
subscription_itemsubscriptionstring
pricestring
quantityinteger
Seats or units for licensed prices.
credit_rolloverboolean
Carry unused included units into the next period.
included_unitsinteger | null
Overrides the price's included units.
metadataobject
created_attimestamp
updated_attimestamp
Proration: create_prorations (default) records the difference for the remainder of the period and adds it to the next invoice; always_invoice bills it immediately; none skips it.
Create a subscription item
POST/v1/subscription_itemsSecret key
Body
subscriptionstringrequired
pricestringrequired
Must match the subscription's interval and currency.
quantityintegerdefault: 1
proration_behaviorenumdefault: create_prorations
create_prorations, always_invoice or none.credit_rolloverboolean
included_unitsinteger
metadataobject
curl https://api.borga.is/v1/subscription_items \
-H "Authorization: Bearer sk_test_…" \
-H "Content-Type: application/json" \
-d '{
"subscription": "sub_9Qw1Er3Ty5Ui7Op9As1Df3Gh",
"price": "price_7Kl9Mn1Op3Qr5St7Uv9Wx1Yz",
"quantity": 1
}'Retrieve a subscription item
GET/v1/subscription_items/:idSecret key
Update a subscription item
POST/v1/subscription_items/:idSecret key
Body
quantityinteger
proration_behaviorenumdefault: create_prorations
credit_rolloverboolean
included_unitsinteger
metadataobject
Remove a subscription item
DELETE/v1/subscription_items/:idSecret key
Query parameters
proration_behaviorenumdefault: create_prorations
Credit for the unused remainder of the period.
Returns { "deleted": true, "id": "si_…" }. A subscription must keep at least one recurring item.