3. Structure and Group Allocations

2 minute read

In this step we need to structure and group the allocations in a way that matches how you want to build your report.

In this example in this example we want to create a single report for each receiving merchant display the following information:

  • Total disbursed amount to the merchant
  • List all disbursed payment with associated tenant fee

To achieve this, you can:

  1. Group allocations by merchant_id
  2. For each group, sum the allocated amounts to get the total disbursed amount.
  3. For each group, group all the allocations based on payment_id. This way we can calculate exactly how much of the acquired funds of the payment is disbursed to the merchant and also if the payment carries any potential fees.