mollie / mollie-api-php

Mollie API client for PHP

Home Page:http://www.mollie.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting withheld fees and invoice number (of pending invoice)

nssnl opened this issue · comments

commented

I'm trying to replicate the transactions that are in the daily MT940 files. Currently, I use MT940 file to manually import relevant transactions into the bookkeeping software. To automate the process, I'm using the Payments and Settlements (or Balances) endpoint to get the relevant transactions and payouts.

I'm still struggling with the fees. In the MT940 the fees on one day are aggregated into one amount with description "Withheld transaction fees MOL-NL-R2023.000xxxxx". The transaction date of this transaction is equal to relating transaction. This invoice is not yet issued, but the invoice number is already in the description. Since the invoice is not issued yet, the Invoices endpoint is not listing this invoice yet.

Is there anyway to retrieve this invoice number? Having this number makes it a bit easier to settle with the invoice, when issued.

If not, any recommendations on the best way to getting the fees (before the invoice has been issued)? It's included in the Payment details, and available in the Balances, but the latter only when the amount becomes available in the Balance (for direct debits that's around 14 days after payment), so Payments endpoint seems to make more sense.

Thank you for raising this - very good question indeed!

Let me check with the appropriate team if there's a specific reason why the MOL-NL-Rxxx is not available in all places where it could be (as the number is clearly already available and allocated).

We're also currently exploring making the Pending Balance available through the Balance API as well, which should solve your issue the way I understood it. However, I don't have full confirmation on this yet. But: Maybe I'm not understanding correctly or missing something, but how would you receive the invoice ID from the Payments endpoint? When I get a payment, it's not included in the details as you describe.

commented

Thanks for your quick response.
"Pending balance" would be perfect indeed.

Regarding the "Payments" endpoint, that was actually a different question (you are correct I'm unable to get the invoice ID from there). Just the easiest/best way to get the amount of fees relating to the transactions on a given day. To be able to produce a transaction similar to the MT940 entry of "Withheld transaction fees", apart from mentioning the invoice number.

But "Pending balance" would probably solve that too.

Understood :) I'm looking into this with the team.

commented

I was able to solve the issue. Not entirely, but good enough.
The settlements endpoint, so for the payouts, lists the invoice number in the details. Also if the invoice has not been issued yet.

In order to replicate the MT940, first of all I'm retrieving the payments and for each payment I create a transaction in my bookkeeping software with the relevant transaction date. Ideally, I would also add the 'withheld fees' at that moment with the invoice number, but instead it also works (from my point of view) at the time of payout.

So when the payout occurs, I'm creating 1 transaction for the actual payout amount (that matches with the amount I receive on my bank account), and X number of transactions for the withheld transaction fees aggregated per invoice number (since a payout can relate to multiple invoices, in my case, and most other case, 1 or 2 invoices).