Our billing cycle loops through all customers and generates an invoice for them over the API. We’re finding that multiple invoices can be issued the same invoice reference (auto-generated by Freeagent), which is saved fine, but surfaces when we attempt to send the invoice.
When you use the FA UI, it’s not possible to create multiple invoices with the same reference, but yet FA doesn’t prevent this over the API. Again, to clarify, we’re not providing the reference over the API ourselves, this is something that FA is generating and returning.
It sounds like there’s no unique constraint on the reference column in the DB. Is this something that you could look to fix please?