---
schema_version: "1"
id: c1328c0c4c2445644637aca7b176ebc7b9bd72731754a43fcc2def208e707405
title: Define Rules and Order to Apply Credit Memo and Payments
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/billing_setup_credit_memos_payments_application_rules.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.billing_setup_credit_memos_payments_application_rules.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 021af3f65c0bf03bea96017e9ee338b8b52413604ae99663029df713b4718cc4
description: Define the rules and the order in which credit memos and payments are applied to settle the balances of posted invoices or invoice lines within the same account.
products:
  - Revenue Cloud
release: "264"
---
# Define Rules and Order to Apply Credit Memo and Payments

Define the rules and the order in which credit memos and payments are applied to settle the balances of posted invoices or invoice lines within the same account.

### 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 Billing license</a>. Contact your Salesforce account executive for more information.</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="d111696e75">User Permissions
              Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d111696e75 ">To enable Billing features:</td>

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

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

1. From Setup, in the Quick Find box, enter Billing, and then select **Billing Settings**.
2. Select the order in which credit memos and payments are applied.
    
    The default selection is Payments First, which applies payments to the posted invoices before credits.
3. Select these predefined rules in the sequence in which you want to run them.
    
    - To apply credit memos or payments only if an invoice is specified on the Reference Entity field of the Credit Memo record or on the Invoice field within the Payment record's payment initiation source, select **Match ID**. Select this rule only if the invoice is referenced on the Credit Memo or Payment records.
    - To apply credit memos and payments to invoices that have the same balance, select **Match Balance**.
    - To apply credit memos or payments to the invoice with the oldest posted date, select **Prioritize Oldest Invoices**.
    - To apply credit memos or payments to the invoice with the highest current outstanding balance, select **Prioritize Highest Balance Invoices**. When the [credit and payment application level](https://help.salesforce.com/s/articleView?id=ind.billing_setup_credit_memo_features_enable.htm&release=264.0.0&type=5 "Set up Billing to automatically create credit memos from negative invoice lines and apply them to settle outstanding invoice balances, and to configure whether credits apply to invoices or invoice lines.") is Invoice Line, Billing uses the selected rules to match the invoice. It then applies the credit memo line or payment with highest balance to the invoice line with highest balance on that invoice.
    
    ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-revenue-264-0-0-production-enus/91ca99c6-d5c8-4986-b961-c6b7801e0d0d/images/icon_note.png)
    
    Note When there are more than 2000 invoices to be processed, Billing applies only the first rule selected for credit and payment application.
4. Turn on Rule-Based Credit and Payment Application.
    
    You can enable this feature only if you select the application order and rules.
    
    ![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-revenue-264-0-0-production-enus/91ca99c6-d5c8-4986-b961-c6b7801e0d0d/images/icon_note.png)
    
    Note When both Rule-Based Credit and Payment Application and [Apply Credits to Posted Invoices](https://help.salesforce.com/s/articleView?id=ind.billing_setup_credit_memo_features_enable.htm&release=264.0.0&type=5 "Set up Billing to automatically create credit memos from negative invoice lines and apply them to settle outstanding invoice balances, and to configure whether credits apply to invoices or invoice lines.") features are turned on, Rule-Based Credit and Payment Application takes precedence.

The balance of credit memos and payments are applied to settle the balances of posted invoices based on these rules and the [credit, refunds, and payment application level](https://help.salesforce.com/s/articleView?id=ind.billing_setup_credit_memo_features_enable.htm&release=264.0.0&type=5 "Set up Billing to automatically create credit memos from negative invoice lines and apply them to settle outstanding invoice balances, and to configure whether credits apply to invoices or invoice lines.") when your users perform one of these tasks.

- [Schedule an invoice batch run](https://help.salesforce.com/s/articleView?id=ind.billing_automate_invoice_run_schedules.htm&release=264.0.0&type=5 "Set up invoice schedulers to generate invoices on a schedule or on demand. Select billing schedules by target date, billing period count, or both. Generate invoice documents during the run, or use a catch-up bill run to advance migrated schedules without creating invoices.")
- [Generate invoices for accounts or orders](https://help.salesforce.com/s/articleView?id=ind.billing_invoice_generation_for_accounts_orders.htm&release=264.0.0&type=5 "Generate all the pending invoices of your customers in one go and on-demand. You can also generate consolidated invoices on-demand based on the invoice group type of the related billing schedules.")
- [Use Post Draft Invoices in Batch API](https://developer.salesforce.com/docs/atlas.en-us.revenue_lifecycle_management_dev_guide.meta/revenue_lifecycle_management_dev_guide/connect_resources_batch_draft_invoices_to_posted.htm)
- [Run the Post Draft Invoice Batch Run action](https://developer.salesforce.com/docs/atlas.en-us.revenue_lifecycle_management_dev_guide.meta/revenue_lifecycle_management_dev_guide/actions_obj_post_draft_invoice.htm)

To apply rule-based credit and payment application on existing invoices of an account, use [Rules Application API](https://developer.salesforce.com/docs/atlas.en-us.revenue_lifecycle_management_dev_guide.meta/revenue_lifecycle_management_dev_guide/connect_resources_rules_application.htm).

- **[Invalid Match ID During Payment Application](https://help.salesforce.com/s/articleView?id=ind.billing_rules_based_credits_payments_application.htm&release=264.0.0&type=5)**  
    When a payment is applied using the Match ID rule, the invoice ID specified on the payment record is validated. If the referenced invoice is deemed invalid, the payment is applied to the next available invoice based on the subsequent rule in the sequence.
- **[Example: Apply Rule-Based Credits and Payments](https://help.salesforce.com/s/articleView?id=ind.billing_rules_based_credits_payments_example.htm&release=264.0.0&type=5)**  
    Explore an example to understand the setup of rule-based credits and payments in your Salesforce org, and how credit memos and payments are applied to posted invoices of the same account.