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

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.

Servers

Path parameters

Name Type Required Description
subscription-key String Yes

Subscription number or ID

Request headers

Name Type Required Description
Content-Type String Yes The media type of the request body.

Default value: "application/json"

Content-Encoding String No

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-Id String No

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-version String No

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.

Authorization String No

The value is in the Bearer {token} format where {token} is a valid OAuth token generated by calling Create an OAuth token.

Zuora-Entity-Ids String No

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 do not need to set this header.

Accept-Encoding String No

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.

Request body fields

Name Type Required Description
previewThroughDate Object No

The preview through date.

previewThroughDate.nextBillingPeriods Number No

The number of billing periods to preview. Required if previewThruDatePolicy is nextBillingPeriods.

previewThroughDate.specificDate String No

The specific date for the preview start date. Required if previewThruDatePolicy is specificDate.

previewThroughDate.previewThruDatePolicy String No

The options on how the preview through date is calculated.

  • If you set this field to nextBillingPeriods, you must specify the number of billing periods to preview in the nextBillingPeriods field.
  • If you set this field to endOfTerm, the preview through date is the end date of the subscription term.
  • If you set this field to specificDate, you must specify a specific date in the specificDate field. The date must be in the format yyyy-mm-dd.

Possible values:

  • "endOfTerm"
  • "specificDate"
  • "nextBillingPeriods"
previewStartDate Object No

The start date of the preview.

previewStartDate.previewStartDatePolicy String No

The options on how the preview start date is calculated.

  • If you set this field to startOfTerm, the preview start date is the start date of the subscription term.
  • If you set this field to today, the preview start date is today.
  • If you set this field to specificDate, you must specify a specific date in the specificDate field. The date must be in the format yyyy-mm-dd.

Possible values:

  • "today"
  • "startOfTerm"
  • "specificDate"
previewStartDate.specificDate String No

The specific date for the preview start date. Required if previewStartDatePolicy is specificDate.

quantityForUsageCharges[] Array No

Container for usage charges.

quantityForUsageCharges[].quantity Number No

The quantity of the subscription charge.

quantityForUsageCharges[].chargeId String No

The ID of the subscription charge.

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.