# 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. Endpoint: POST /v1/subscriptions/{subscription-key}/preview Version: 2026-02-20 Security: bearerAuth ## Header parameters: - `Accept-Encoding` (string) 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-Encoding` (string) 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) 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-Ids` (string) 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-Version` (string) 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. ## Path parameters: - `subscription-key` (string, required) Subscription number or ID ## Request fields (application/json): - `previewStartDate` (object) The start date of the preview. - `previewStartDate.previewStartDatePolicy` (string) 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. Enum: "startOfTerm", "today", "specificDate" - `previewStartDate.specificDate` (string) The specific date for the preview start date. Required if previewStartDatePolicy is specificDate. - `previewThroughDate` (object) The preview through date. - `previewThroughDate.previewThruDatePolicy` (string) 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. Enum: "nextBillingPeriods", "endOfTerm", "specificDate" - `previewThroughDate.nextBillingPeriods` (number) The number of billing periods to preview. Required if previewThruDatePolicy is nextBillingPeriods. - `previewThroughDate.specificDate` (string) The specific date for the preview start date. Required if previewThruDatePolicy is specificDate. - `quantityForUsageCharges` (array) Container for usage charges. Example: [{"chargeId":"402880e78ccd1743018cce026efb002d","quantity":20}] - `quantityForUsageCharges.chargeId` (string) The ID of the subscription charge. - `quantityForUsageCharges.quantity` (number) The quantity of the subscription charge. ## Response 200 fields (application/json): - `processId` (string) The ID of the process that handles the operation. - `reasons` (array) The container of the error code and message. This field is available only if the success field is false. - `reasons.code` (string) The error code of response. - `reasons.message` (string) The detail information of the error response - `requestId` (string) Unique identifier of the request. - `success` (boolean) Indicates whether the call succeeded. - `invoices` (array) Container for invoices. - `invoices.invoiceNumber` (string) The invoice number. - `invoices.amount` (number) Invoice amount. - `invoices.amountWithoutTax` (number) Invoice amount minus tax. - `invoices.taxAmount` (number) The tax amount of the invoice. - `invoices.targetDate` (string) Date through which to calculate charges if an invoice is generated, as yyyy-mm-dd. - `invoices.invoiceItems` (array) The container for invoice items. - `invoices.invoiceItems.serviceStartDate` (string) Service start date as yyyy-mm-dd. If the charge is a one-time fee, this is the date of that charge. - `invoices.invoiceItems.serviceEndDate` (string) End date of the service period for this item, i.e., the last day of the period, as yyyy-mm-dd. - `invoices.invoiceItems.taxAmount` (number) The tax amount of the invoice item. - `invoices.invoiceItems.chargeDescription` (string) Description of the charge. - `invoices.invoiceItems.chargeName` (string) Name of the charge. - `invoices.invoiceItems.chargeNumber` (string) Available when the chargeNumber field was specified in the request or when the order is amending an existing subscription. - `invoices.invoiceItems.productName` (string) Name of the product. - `invoices.invoiceItems.productRatePlanChargeId` (string) The ID of the product rate plan charge. - `invoices.invoiceItems.processingType` (string) The processing type of the invoice item. Enum: "Charge", "Discount", "Tax" - `invoices.invoiceItems.unitPrice` (number) The unit price of the charge. - `invoices.invoiceItems.quantity` (number) The quantity of the charge. - `invoices.invoiceItems.unitOfMeasure` (string,null) The unit of measure of the charge. - `invoices.invoiceItems.discountDetails` (array) Container for discount details. - `invoices.invoiceItems.discountDetails.discountChargeName` (string) The charge name of the discount. - `invoices.invoiceItems.discountDetails.discountChargeNumber` (string) The charge number of the discount. - `invoices.invoiceItems.discountDetails.discountRate` (number) The discount rate. - `invoices.invoiceItems.discountDetails.serviceStartDate` (string) Start date of the service period for this discount charge. - `invoices.invoiceItems.discountDetails.serviceEndDate` (string) End date of the service period for this discount charge. - `invoices.status` (string,null) The status of the invoice. Enum: "Draft", "Posted", null - `invoices.isFromExistingInvoice` (boolean) Indicates whether the invoice information is from an existing invoice. - `creditMemos` (array) Container for credit memos. Note: This field is only available if you have the Invoice Settlement feature enabled. - `creditMemos.creditMemoNumber` (string) The credit memo number. - `creditMemos.amount` (number) Credit memo amount. - `creditMemos.amountWithoutTax` (number) Credit memo amount minus tax. - `creditMemos.taxAmount` (number) The tax amount of the credit memo. - `creditMemos.targetDate` (string) Date through which to calculate charges if a credit memo is generated, as yyyy-mm-dd. - `creditMemos.creditMemoItems` (array) Container for credit memo items. - `creditMemos.creditMemoItems.taxAmount` (number) The tax amount of the credit memo item. - `creditMemos.creditMemoItems.processingType` (string) The processing type of the credit memo item. Enum: "Charge", "Discount", "Tax" - `creditMemos.status` (string,null) The status of the credit memo. - `creditMemos.isFromExistingCreditMemo` (boolean) Indicates whether the credit memo information is from an existing credit memo. ## Response 500 fields (application/json): - `reasons` (array) Example: [{"code":"ObjectNotFound","message":"Notification definition with id 6e569e1e05f040eda51a927b140c0ac1 does not exist"}] - `reasons.code` (string) The error code of response. - `reasons.message` (string) The detail information of the error response ## Response 4XX fields (application/json): - `processId` (string) The ID of the process that handles the operation. - `reasons` (array) The container of the error code and message. This field is available only if the success field is false. - `reasons.code` (string) The error code of response. - `reasons.message` (string) The detail information of the error response - `requestId` (string) Unique identifier of the request. - `success` (boolean) Indicates whether the call succeeded.