Update Subscription Item Quantity

Self-serve quantity changes let customers scale their own Subscription as their requirements change, like buying two more seats on a Per-Seat Line Item or increasing allocated consultancy hours on a Flat Rate Line Item. Salable applies the change to the existing Subscription, so your application never touches Stripe's API.

Updating a Subscription Plan Line Item

The quantity must be within the Line Item's configured minimum and maximum. On a Per-Seat Line Item, the quantity must also be at least the number of Grantees in the attached Group. To go below this, remove a Grantee from the Group before reducing the quantity. Quantities cannot be updated on Metered Line Items, to increase consumption on a meter, use the record usage endpoint.

import { Salable } from '@salable/sdk';
const salable = new Salable(process.env.SALABLE_SECRET_KEY);
 
await salable.api.subscriptionPlanLineItems.byId('spli_01KHRQ6CRK2HW7CHXMYFGXFSNX').put({
    quantity: 20,
    proration: 'create_prorations' // omit for Salable Only Subscriptions
});

Important proration controls how Stripe bills the mid-cycle change: create_prorations, always_invoice, or none. It's required for a paid Subscription and rejected for a Salable Only Subscription.

  • Subscriptions & Billing The proration behaviours in depth and how mid-cycle changes are billed.
  • Groups How seats and Group membership relate for Per-Seat Line Items.