Welcome to Zuora Product Documentation

Explore our rich library of product information

Examples for applying payments

This document provides examples of applying payments to invoices using different rules, including FIFO, Proration, and Item Group Proration.

Apply payment to the invoice by FIFO rule

Consider an invoice with the following details:

Amount ($)

Balance ($)

(before the payment)

Invoice-011,284.001,284.00
Invoice Item 12,400.001,200.00
Taxation Item 1168.00168.00
Discount Item 1-1,200.000.00
Taxation Item 2-84.00-84.00

From a Balance perspective, Discount Item 1's balance is $0 because it has been counted into its parent item, which is Invoice Item 1 in this case.

Let's say that you fully paid the invoice for $1,284.00. The payment amount is distributed to each item, and the final balance of each item is listed below:

Amount ($)

Balance ($)

(before the payment)

Payment amount ($)

Balance ($)

(after the payment)

Invoice-011,284.001,284.001284.000.00
Invoice Item 12,400.001,200.001,200.000.00
Taxation Item 1168.00168.0084.0084.00
Discount Item 1-1,200.000.000.00
Taxation Item 2-84.00-84.00-84.00

The payment is applied to the invoice using the following logic:

  • The maximum possible amount from the total payable amount is applied to the first positive item in the invoice.
  • The same logic is followed, and the payment amount is applied to all the positive items in the invoice in the FIFO order until the total payable amount becomes $0.
  • The total payment won't be distributed to the items with the negative amount in the invoice.

For example,

  • $1,200.00 is applied to the first positive item, Invoice Item 1
  • $84.00 is applied to the next positive item, Taxation Item 1

Apply payment to the invoice by Proration rule

Consider an invoice with the following details:

Amount ($)

Balance ($)

(before the payment)

Invoice-011,284.001,284.00
Invoice Item 12,400.001,200.00
Taxation Item 1168.00168.00
Discount Item 1-1,200.000.00
Taxation Item 2-84.00-84.00

From a Balance perspective, Discount Item 1's balance is $0 because it has been counted into its parent item, which is Invoice Item 1 in this case.

Let's say that you fully paid the invoice for $1,284.00. The payment amount is distributed to each item, and the final balance of each item is listed below:

Amount ($)

Balance ($)

(before the payment)

Payment amount ($)

Balance ($)

(after the payment)

Invoice-011,284.001,284.001284.000.00
Invoice Item 12,400.001,200.001,200.00 / (1,200.00 + 168.00) * 1,284.00 = 1,126.321,200.00 - 1,126.32 = 73.68
Taxation Item 1168.00168.001,284.00 - 1,126.32 = 157.68168.00 - 157.68 = 10.32
Discount Item 1-1,200.000.000.00
Taxation Item 2-84.00-84.00-84.00

The payment is applied to the invoice using the following logic:

  • The total payable amount is applied to the first positive item in the invoice on a prorated basis.
  • The same logic is followed, and the payment amount is applied to all the positive items in the invoice on a prorated basis.
  • The total payment won't be distributed to the items with the negative amount in the invoice.
  • For more information on the proration algorithm, see Proration of an Invoice or Debit Memo.

For example,

  • The total payable amount is applied to all the positive items in the invoice on a prorated basis.
  • For the last positive item, the payment amount is the total amount minus all the applied amount on other ite

Apply item group proration rule to the invoice

The Item group allocation proration rule feature is in the Early Adopter phase. If you want to access this feature, submit a request at Zuora Global Support.

Consider an invoice with the following details:

Amount ($)Balance ($) (before the payment)
Invoice-01180180
Invoice Item-0181.9781.97 - 8.2 = 73.77
Taxation Item-0118.0318.03
Discount Item-01-8.20
Taxation item-02-1.8-1.8
Invoice Item-0281.9781.97 - 8.2 = 73.77
Taxation Item-0318.0318.03
Discount Item-02-8.20
Taxation item-04-1.8-1.8

Before applying the payment to the invoice, the invoice items will be grouped together along with their corresponding discount taxation items, as below:

Amount ($)Balance ($) (before the payment)
Invoice-01180180
Item Group-01N/A90
Invoice Item-0181.9781.97 - 8.2 = 73.77
Taxation Item-0118.0318.03
Discount Item-01-8.20
Taxation item-02-1.8-1.8
Item Group-02N/A90
Invoice Item-0281.9781.97 - 8.2 = 73.77
Taxation Item-0318.0318.03
Discount Item-02-8.20
Taxation item-04-1.8-1.8

The payment is applied to the invoice using the following logic:

  1. Apply a 60$ payment to the invoice at the group-level basis proration rule.
  2. Distribute the item group-level payment amount into two parts, as follows:
    1. invoice item
    2. total tax items of the group
  3. Distribute the amount to each tax item as below:

The payment is applied to the invoice using the following logic:

  1. Payment with 60$ will be distribute to Item Group-01 and Item Group-02, then 30$ will be applied to Item Group-01.
  2. With Item Group-01, 30$ will be applied using the two parts basis proration rule explained below:
    1. Invoice Item-01
    2. Total of taxation items = Taxation Item-01 + Taxation Item-02
  3. Then Invoice Item balance = 73.77, the total balance of taxation items = (18.03 - 1.8) = 16.23
    1. Invoice item that will be applied = 73.77/(73.77 + (18.03 - 1.8)) * 30 = 24.59
    2. Total taxation items that will be applied = 30 - 24.59 = 5.41

Within all the taxation items, the payment amount will be distributed to all the positive balance tax again by the proration rule. But in this case, there is only one positive tax, so 5.41$ will be applied to it.