I am using the apis to manage invoices.
We:
- create an invoice,
- download the pdf,
- send it along with other documents to a client,
- mark it as sent in free agent,
- then if the client has a direct debit mandate set up, we make a post request to
POST https://api.freeagent.com/v2/invoices/:id/direct_debit
We have been notified that on some occasions, the payment is taken twice for certain clients but not for every invoice.
My initial thought was for some reason, on these occasions, I am hitting the endpoint twice. However, from the docs, it seems this shouldn’t be possible as the invoice would not meet the criteria the endpoint enforces.
Does anyone have any ideas? I am not using any endpoints other than the ones required to complete the functionality above.