Subscriptions

Preview a Subscription update

Generates a preview of the changes that would occur if the Subscription is updated

post/subscriptions/{id}/preview

Path parameters

idstring required

Request body

pricestring

The ID of the price to apply to the subscription update

nextBillingDatestring date-time

The date of the next recurring payment. Must be in the future and after the current period start.

Example request

{
  "price": "price_2R4e2xDqbww8ewmkIYWE1A6Zcfp",
  "nextBillingDate": "2026-06-01T00:00:00.000Z"
}

Response

OK

idstring required

The ID of the preview

previewValidUntilstring date-time required

The date until the preview is valid.

Example response

{
  "id": "sub_preview_2pKw553IpHphT79MHhZh8jEf2cT",
  "subscription": {
    "id": "sub_2QC7PqoUeOxQEWscJJt6B3PkvyL",
    "currentCycle": 1,
    "upcomingInvoice": {
      "amount": 1500,
      "currency": "usd",
      "periodStart": "2023-01-01T00:00:00Z",
      "periodEnd": "2023-01-31T23:59:59Z",
      "statementDescriptor": "SUBSCRIPTION",
      "comment": "Invoice for subscription 123, period January 2023"
    }
  }
}

Changes

Changed in 1 of the 2 revisions of this API.1