Subscriptions

Preview upcoming subscription charges

Changed on

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

post/subscriptions/{id}/preview

Request

  • Base URL
    https://api.smokeball.com
  • URL
    https://api.smokeball.com/subscriptions/{id}/preview
  • Auth
    API key in header x-api-key and API key in header Authorization

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.

archieTierIdstring uuid nullable

Optional Archie tier id subscription update to preview. Omit or supply null to preserve the current Archie tier.

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
}

Changes

    • info

      added the new optional request property //// (media type: application/json-patch+json)

    • info

      added the new optional request property //// (media type: application/json)

    • info

      added the new optional request property //// (media type: application/*+json)

    • warning

      added the new 4.00 enum value to the //////////////// response property for the response status

    • warning

      added the new 4.00 enum value to the //////////////// response property for the response status