---
schema_version: "1"
id: b43513d192d5f0cf82c60b6af86ebf83c7db822fca42d123fcac03d2216d164c
title: Generate Invoice Previews with the Invoice Preview API
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/billing_invoice_preview_procedure_plan_create.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.billing_invoice_preview_procedure_plan_create.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: ce753072b6c365dff27b7f783aa7b7b147b3aba9170fbf356a0b5d8db19f669c
description: To generate preview invoices by using the Invoice Preview API, create and activate a custom procedure plan definition for the object that you want to preview invoices for. The Invoice Preview API uses the procedure plan to generate invoice previews. A custom procedure plan creation isn't required to use the Invoice Preview API for orders, accounts, and billing schedule groups.
products:
  - Revenue Cloud
release: "264"
---
# Generate Invoice Previews with the Invoice Preview API

To generate preview invoices by using the Invoice Preview API, create and activate a custom procedure plan definition for the object that you want to preview invoices for. The Invoice Preview API uses the procedure plan to generate invoice previews. A custom procedure plan creation isn't required to use the Invoice Preview API for orders, accounts, and billing schedule groups.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions with <a href="https://help.salesforce.com/s/articleView?id=ind.revenue_licenses_areas_and_features.htm&amp;release=264.0.0&amp;type=5">the Revenue Cloud Advanced license or the Revenue Cloud Billing license</a></td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d212055e72">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d212055e72 ">To create and update custom procedure plan
              definitions:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d212055e72 ">Context Service Admin permission
              set</td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d212055e72 ">To generate invoice previews by using the
              API:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d212055e72 ">
              <p>You must have one of these permission sets:</p>
              <ul>
                <li>Billing Admin</li>

                <li>Billing Operations User</li>

                <li>Billing Customer Service</li>

              </ul>
            </td>

          </tr>
        </tbody>
      </table>

![Important](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-revenue-264-0-0-production-enus/91ca99c6-d5c8-4986-b961-c6b7801e0d0d/images/icon_important.png)

Important

From Summer ’25 and onwards, you will not be able to sync existing context definitions that were either cloned or extended from the standard BillingContext context definition. To fix this issue, use the [Context Attribute Mapping API](https://developer.salesforce.com/docs/atlas.en-us.industries_reference.meta/industries_reference/connect_resources_attribute_mapping.htm) to delete duplicate BSGEntitiesMapping attribute mappings.

- BillingTransactionSource attribute of the BillingSchedule node to Reference attribute of the BillingSchedule object.
- BillingTransactionItemSource attribute of the BillingSchedule node to the ReferenceItem attribute of the BillingSchedule object.

#### See Also

- [Create a Custom Procedure Plan Definition](https://help.salesforce.com/s/articleView?id=ind.pricing_create_a_custom_procedure_plan_definition.htm&language=en_US)

## Create a Custom Procedure Plan

Create a custom procedure plan when you want to preview invoices using the Invoice Preview API for quotes or other billing transactions.

1. Create a custom procedure plan definition.
    1. Select **Billing** as the process type.
    2. Select the object that you want to preview invoices for as the primary object.
    3. Select the extended BillingContext context definition as the context definition.
2. Update and activate the procedure plan definition.
    1. Open the procedure plan definition and select a read context mapping for the primary object.
    2. Activate the procedure plan definition.
3. To generate invoice previews for any billing transaction, use the [Invoice Preview API](https://developer.salesforce.com/docs/atlas.en-us.revenue_lifecycle_management_dev_guide.meta/revenue_lifecycle_management_dev_guide/connect_resources_preview_invoices.htm).

## Preview Invoices for Quotes

To use the standalone Billing Schedules API and Invoice API for quotes, create context definition, a context mapping and a procedure plan.

1. [Extend the BillingContext Context Definition](https://help.salesforce.com/s/articleView?id=ind.context_service_extend_context_definitions.htm&language=en_US).
2. Map the Billing Transaction, Billing Transaction Item, Billing Transaction Item Detail, and Billing Transaction Item Relationship nodes and fields to Quote, Quote Line, Quote Line Detail, and Quote Line Relationship objects and fields.
    
    See [Add Context Mapping](https://help.salesforce.com/s/articleView?id=ind.context_service_add_context_mapping.htm&language=en_US).
3. [Activate the context definition](https://help.salesforce.com/s/articleView?id=ind.context_service_activate_context_definition.htm&language=en_US).
4. Create a custom procedure plan.
5. To generate invoice previews for quotes, use the [Invoice Preview API](https://developer.salesforce.com/docs/atlas.en-us.revenue_lifecycle_management_dev_guide.meta/revenue_lifecycle_management_dev_guide/connect_resources_preview_invoices.htm).