Subscriptions

Preview a subscription by subscription key

Describes how to preview an existing subscription to view information about existing and future invoices or credit memos.

Note: The Zuora-Version parameter must be 207.0 or later.

post/v1/subscriptions/{subscription-key}/preview

Path parameters

subscription-keystring required

Subscription number or ID

Headers

Accept-Encodingstring

Include the Accept-Encoding: gzip header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.

If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a Content-Encoding header with the compression algorithm so that your client can decompress it.

Content-Encodingstring

Include the Content-Encoding: gzip header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload.

Zuora-Track-Idstring

A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.

The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (:), semicolon (;), double quote ("), and quote (').

Zuora-Entity-Idsstring

An entity ID. If you have Zuora Multi-entity enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you should not set this header.

Zuora-Versionstring

The minor version of the Zuora REST API.

You need to set this parameter if you use the following fields:

  • targetDate
  • includeExistingDraftDocItems
  • previewType
  • taxationItems

If you have the Invoice Settlement feature enabled, you need to specify this parameter. Otherwise, an error is returned.

Request body

skipTaxboolean

If set to true, the system will bypass the tax calculation during subscription preview.

Example request

{
  "previewStartDate": {
    "previewStartDatePolicy": "specificDate",
    "specificDate": "2024-01-01"
  },
  "previewThroughDate": {
    "previewThruDatePolicy": "nextBillingPeriods",
    "nextBillingPeriods": "2"
  },
  "quantityForUsageCharges": [
    {
      "chargeId": "402880e78ccd1743018cce026efb002d",
      "quantity": 20
    }
  ]
}

Response

OK

processIdstring

The ID of the process that handles the operation.

requestIdstring uuid

Unique identifier of the request.

successboolean

Indicates whether the call succeeded.

Changes