Invoices api question

Assuming I have some kind of a marketplace app, where I listen on a webhook, to any suucess payment data, like the total amout of the order belongs to merchant id-123, etc".
I save the data of each transaction in a DB.
Twice a month I query that data, do some calculation (like summing the total_amount of all transactions of that merchant * .03 ) and then using the freeagent api to create a contact (if not already exists) and create an invoice for him for the back half moth and idealy send him an email with invoice.
Is that what I should do? if so which of the invoice status should I use?
Thanks, Avi.

Hi @Avi_A ,

Ewa here from the Engineering Team at FreeAgent — thanks for your message on our forum and I’ll do my best to help out. If I understand correctly, what you’re aiming to achieve is to issue bi-monthly invoices to users of your marketplace app (merchants) for a percentage of their orders total. In these circumstances, you can by all means create invoices in FreeAgent via the API – you don’t actually have to include status in your request, the invoice will be created as Draft by default. Once the invoice is created, you can e-mail it to the merchant using the email an invoice endpoint.

I hope this helps, Avi, but do let me know if you have any further questions. Our API docs and the FreeAgent Knowledge Base contain a lot of useful resources, but of course we’re also here to help if you don’t find the answers you need there.

Best wishes,


Hi, thanks for getting back to me,

Exactly, would have taken me weeks to write it so clear :).
So I create an invoice and when I got back the id I use the email method. Awesome.
Another question, On the “Description” input in both invoice and email, can I use any markup?

Hi @Avi_A,

Another question, On the “Description” input in both invoice and email, can I use any markup?

We don’t support markup for invoice item descriptions, but you can include some basic HTML tags in your e-mail body.

All best,