---
title: "Generate a billing preview"
method: POST
path: "/v1/operations/billing-preview"
tags: ["Operations"]
---

# Generate a billing preview

`POST /v1/operations/billing-preview`

Generates a preview of future invoice items for one customer account. Use the BillingPreview call to calculate how much a single customer will be invoiced from the most recent invoice to a specific end of term date in the future.

Additionally, you can use the BillingPreview service to access real-time data on an individual customer's usage consumption. 

The BillingPreview call only calculates taxes for charges in the subscription if you use [Zuora Tax](https://docs.zuora.com?resourceId=billing-zuora-tax-overview) and the product rate plan charge associated with the invoice item uses the [tax inclusive mode](https://docs.zuora.com?resourceId=billing-tax-code-and-set-tax-mode); otherwise, this call does not calculate taxes.

If you have the Invoice Settlement feature enabled, you can also generate a preview of future credit memo items for one customer account. 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.

## 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

- PostBillingPreviewParam
  - `accountId` string — The ID of the customer account to which the billing preview applies. **Note**: When posting billing preview, you must specify either `accountId` or `accountNumber` in the request body.
  - `accountNumber` string — The number of the customer account to which the billing preview applies. **Note**: When posting billing preview, you must specify either `accountId` or `accountNumber` in the request body.
  - `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 memo 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.
  - `chargeTypeToExclude` string — The charge types to exclude from the billing preview. **Possible values:** OneTime, Recurring, Usage, and any 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 — Indicates if evergreen subscriptions are included in the billingPreview call.
  - `targetDate` string, date, required — The target date for the billingPreview call. The billingPreview call generates preview invoice item data and credit memo item data from the first day of the customer's next billing period to the TargetDate. If the TargetDate 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.

## Response `200`

OK

- BillingPreviewResult
  - `accountId` string — ID of the customer account to which the billing preview applies.
  - `creditMemoItems` POSTBillingPreviewCreditMemoItem[] — An array of credit memo items returned as the result of the billing preivew request. **Note:** The credit memo items are 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.
    - `amount` number, double — The amount of the credit memo item. For tax-inclusive credit memo items, the amount indicates the credit memo item amount including tax. For tax-exclusive credit memo items, the amount indicates the credit memo item amount excluding tax
    - `amountWithoutTax` number, double — The credit memo item amount excluding tax.
    - `appliedToItemId` string, nullable — The unique ID of the credit memo item that the discount charge is applied to.
    - `chargeDate` string — The date when the credit memo item is created.
    - `chargeNumber` string — Number of the charge.
    - `chargeType` string — The type of charge. Possible values are `OneTime`, `Recurring`, and `Usage`.
    - `comment` string — Comment of the credit memo item.
    - `id` string — Credit memo item id.
    - `numberOfDeliveries` number — The number of deliveries dedicated to the Delivery Pricing charges. **Note**: This field is available only if you have the Delivery Pricing feature enabled.
    - `processingType` string — Identifies the kind of charge. Possible values: * charge * discount * prepayment * tax
    - `quantity` string, decimal — Quantity of this item, in the configured unit of measure for the charge.
    - `ratePlanChargeId` string — Id of the rate plan charge associated with this item.
    - `serviceEndDate` string, date — End date of the service period for this item, i.e., the last day of the service period, in yyyy-mm-dd format.
    - `serviceStartDate` string, date — Start date of the service period for this item, in yyyy-mm-dd format. If the charge is a one-time fee, this is the date of that charge.
    - `sku` string — Unique SKU for the product associated with this item.
    - `skuName` string — Name of the unique SKU for the product associated with this item.
    - `subscriptionId` string — ID of the subscription associated with this item.
    - `subscriptionNumber` string — Name of the subscription associated with this item.
    - `unitOfMeasure` string — Unit used to measure consumption.
  - `invoiceItems` POSTBillingPreviewInvoiceItem[] — An array of invoice items returned as the result of the billing preview request.
    - `appliedToItemId` string, nullable — The unique ID of the invoice item that the discount charge is applied to.
    - `chargeAmount` string, decimal — The amount of the charge. This amount doesn't include taxes regardless if the charge's tax mode is inclusive or exclusive.
    - `chargeDate` string — The date when the invoice item was created.
    - `chargeDescription` string — Description of the charge.
    - `chargeId` string — Id of the charge.
    - `chargeName` string — Name of the charge.
    - `chargeNumber` string — Number of the charge.
    - `chargeType` string — The type of charge. Possible values are `OneTime`, `Recurring`, and `Usage`.
    - `id` string — Invoice item ID.
    - `numberOfDeliveries` number — The number of deliveries dedicated to the Delivery Pricing charges. **Note**: This field is available only if you have the Delivery Pricing feature enabled.
    - `processingType` string — Identifies the kind of charge. Possible values: * charge * discount * prepayment * tax
    - `productName` string — Name of the product associated with this item.
    - `quantity` string, decimal — Quantity of this item, in the configured unit of measure for the charge.
    - `serviceEndDate` string, date — End date of the service period for this item, i.e., the last day of the service period, in `yyyy-mm-dd` format.
    - `serviceStartDate` string, date — Start date of the service period for this item, in `yyyy-mm-dd` format. If the charge is a one-time fee, this is the date of that charge.
    - `subscriptionId` string — ID of the subscription associated with this item.
    - `subscriptionName` string — Name of the subscription associated with this item.
    - `subscriptionNumber` string — Number of the subscription associated with this item.
    - `taxAmount` string, decimal — If you use [Zuora Tax](https://docs.zuora.com?resourceId=billing-zuora-tax-overview) and the product rate plan charge associated with the invoice item is of [tax inclusive mode](https://docs.zuora.com?resourceId=billing-tax-code-and-set-tax-mode), the value of this field is the amount of tax applied to the charge. Otherwise, the value of this field is `0`.
    - `unitOfMeasure` string — Unit used to measure consumption.
  - `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)
