v2

latestOpenAPI 3.0.12026-07-262352981007.0 KB
Subscriptions

Preview upcoming subscription charges

Returns a preview of upcoming subscription charges or refunds for any specified update to subscriptions tiers, add-ons, or interval.

post/subscriptions/{id}/preview

Path parameters

idstring required

The unique identifier of the subscription

Request body

tierIdstring uuid nullable

Optional tier id subscription update to preview.

An error is thrown if the supplied or existing add-ons are not valid for the supplied tier id.

addOnIdsstring[] nullable

Optional add-on ids subscription update to preview.

An error is thrown if the supplied or existing add-ons are not valid for the existing or supplied tier id.

promotionIdsstring[] nullable

Optional promotion ids subscription update to preview.

intervalstring nullable

Optional billing interval/pricing option change in subscription tier to preview.

If an interval is not supplied and a tier id is supplied, the default interval option for the supplied tier will be used.

If an interval is supplied but a tier is not supplied, the existing tier is used and the interval is changed.

Example request

{
  "tierId": "8d074e85-4d95-4d9a-8a63-187719470d49",
  "interval": "Monthly"
}

Response

When request is successful. Returns a 'SubscriptionPreview' object.

quantityinteger nullable

The number of users on the subscription.

Example response

{
  "immediateProrationPayment": {
    "dueDate": "2022-04-23T14:00:00Z",
    "total": 1899,
    "subTotal": 1000,
    "tax": 100,
    "preTaxCredit": 200,
    "previewLineItems": [
      {
        "product": {
          "smokeballId": "SMK001"
        },
        "amount": 109,
        "preTaxCredit": 200
      }
    ]
  },
  "nextBillingCyclePayment": {
    "dueDate": "2022-04-23T14:00:00Z",
    "total": 1899,
    "subTotal": 1000,
    "tax": 100,
    "preTaxCredit": 200,
    "previewLineItems": [
      {
        "product": {
          "smokeballId": "SMK001"
        },
        "amount": 109,
        "preTaxCredit": 200
      }
    ]
  },
  "quantity": 3
}