---
title: "Create a billing preview run"
method: POST
path: "/v1/billing-preview-runs"
tags: ["Billing Preview Run"]
---

# Create a billing preview run

`POST /v1/billing-preview-runs`

Creates a billing preview run for single and multiple customer accounts.

The maximum supported preview duration is 20 years, calculated from the current date to the target date.

You can run up to 20 billing preview runs in batches concurrently. A single batch of customer accounts can only have one billing preview run at a time. So you can have up to 20 batches running at the same time. If you create a billing preview run for all customer batches, you cannot create another billing preview run until this preview run is completed.

**Note:** The preview results for each billing preview run will be stored in the system for 180 days; after that they will be purged.

## Headers

- `Idempotency-Key` string
- `Accept-Encoding` string
- `Content-Encoding` string
- `Zuora-Track-Id` string
- `Zuora-Entity-Ids` string
- `Zuora-Org-Ids` string
- `Zuora-Version` string

## Request body

- PostBillingPreviewRunParam
  - `assumeRenewal` string — Indicates whether to generate a preview of future invoice items and credit memo items with the assumption that the subscriptions are renewed. Set one of the following values in this field to decide how the assumption is applied in the billing preview. * **All:** The assumption is applied to all the subscriptions. Zuora generates preview invoice item data and credit memo item data from the first day of the customer's next billing period to the target date. * **None:** (Default) The assumption is not applied to the subscriptions. Zuora generates preview invoice item data and credit memo item data based on the current term end date and the target date. * If the target date is later than the current term end date, Zuora generates preview invoice item data and credit memo item data from the first day of the customer's next billing period to the current term end date. * If the target date is earlier than the current term end date, Zuora generates preview invoice item data and credit memeo item data from the first day of the customer's next billing period to the target date. * **Autorenew:** The assumption is applied to the subscriptions that have auto-renew enabled. Zuora generates preview invoice item data and credit memo item data from the first day of the customer's next billing period to the target date. **Note:** - This field can only be used if the subscription renewal term is not set to 0. - The credit memo item data is only available if you have Invoice Settlement feature enabled. The Invoice Settlement feature is generally available as of Zuora Billing Release 296 (March 2021). This feature includes Unapplied Payments, Credit and Debit Memo, and Invoice Item Settlement. If you want to enable Invoice Settlement, see [Invoice Settlement Enablement and Checklist Guide](https://docs.zuora.com?resourceId=billing-invoice-settlement-migration-checklist-and-guide) for more information.
  - `batches` string — The customer batches to include in the billing preview run. You can specify multiple batches separated by comma. If not specified, all customer batches are included. **Note**: - By default, you have 50 configurable account batches. To increase the limit to 200 batches, you must have the <a href="https://docs.zuora.com?resourceId=performance-booster-elite" target="_blank">Performance Booster Elite</a> package. - This field is available only if you are on the latest Zuora API version, or you set the `Zuora-Version` request header to `314.0` or [a later available version](https://developer.zuora.com/v1-api-reference/api-versions/#minor-version).
  - `chargeTypeToExclude` string — The charge types to exclude from the forecast run. **Possible values:** OneTime, Recurring, Usage, and any comma-separated combination of these values.
  - `includingDraftItems` boolean — Whether draft document items are included in the billing preview run. By default, draft document items are not included. This field loads draft invoice items and credit memo items. The `chargeTypeToExclude`, `targetDate`, `includingEvergreenSubscription`, and `assumeRenewal` fields do not affect the behavior of the `includingDraftItems` field.
  - `includingEvergreenSubscription` boolean — Whether evergreen subscriptions are included in the billing preview run. By default, evergreen subscriptions are not included.
  - `organizationLabels` object[] — The organization(s) that this billing preview run is created for. For each item in the array, either the `organizationId` or the `organizationName` field is required. This field is only required when you have already turned on Multi-Org feature.
    - `organizationId` string — The organization ID.
    - `organizationName` string — The organization name.
  - `storageOption` 'Csv' | 'Database' — The saving options. The default value is `Csv`. To compare the current billing preview run result with a specified billing preview run result and store the difference in the database, you must set the `storageOption` field to `Database`. For more information, see [Billing Preview Run Result data source](https://docs.zuora.com?resourceId=platform-billing-preview-run-result-data-source).
  - `storeDifference` boolean — Specify this field to `yes` to compare the current billing preview run result with a specified billing preview run result and store the difference in the database. You can view the difference in the Billing Preview Run Result Difference data source. **Note**: This feature is in the **Early Adopter** phase. If you want to use the feature, submit a request at <a href="http://support.zuora.com/" target="_blank">Zuora Global Support</a>. The default value is `false`.
  - `comparedBillingPreviewRunId` string — Specify an existing billing preview run result to compare the current billing preview result with. You can view the difference in the Billing Preview Run Result Difference data source. **Note**: This feature is in the **Early Adopter** phase. If you want to use the feature, submit a request at <a href="http://support.zuora.com/" target="_blank">Zuora Global Support</a>.
  - `targetDate` string, date, required — The target date for the billing preview run. The billing preview run generates preview invoice item data and credit memo item data from the first day of the customer's next billing period to the target date. The value for the `targetDate` field must be in _`YYYY-MM-DD`_ format. If the target date is later than the subscription current term end date, the preview invoice item data and credit memo item data is generated from the first day of the customer's next billing period to the current term end date. If you want to generate preview invoice item data and credit memo item data past the end of the subscription current term, specify the AssumeRenewal field in the request. **Note:** The credit memo item data is only available if you have Invoice Settlement feature enabled. The Invoice Settlement feature is generally available as of Zuora Billing Release 296 (March 2021). This feature includes Unapplied Payments, Credit and Debit Memo, and Invoice Item Settlement. If you want to enable Invoice Settlement, see [Invoice Settlement Enablement and Checklist Guide](https://docs.zuora.com?resourceId=billing-invoice-settlement-migration-checklist-and-guide) for more information.
  - `filters` object[] — A list of filters to apply to the billing preview run. You can specify only one filter.
    - `filterType` 'Account', required — The type of filter to apply.
    - `accountId` string, required — The target account ID.

## Response `200`

OK

- object
  - `billingPreviewRunId` string — Id of the billing preview run.
  - `success` boolean — Returns `true` if the request was processed successfully.

## Other responses

- `500` — Internal Server Error
- `4XX` — Request Errors

---

[API](https://skmtc.dev/zuora/apis/api-reference.md) · [All operations](https://skmtc.dev/zuora/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/zuora/api-reference/revisions/d11e237f3e54/schema)
