Setting invoice to "paid" status the right way through API

We’ve been instructed from to post our question here, although I think the question is more on the “business side” but here it goes

My team is considering option about how to integrate FreeAgent with our system and we’ve done some integration via your API for invoices. We have found out that thorugh API we may create an invoice in FreeAgent in states Draft and Sent only. We cannot create or directly update it into “paid”. We would like to programmatically mark those invoices as paid.
Here is our business logic:

  1. Customer orders a service from us
  2. We charge customer for the service from their “balance” on their GoSend account + through our payment gateway for any difference in case their balance on their GoSend account can’t cover the whole order. – So, at this moment, the service has been paid for and we send an invoice to our customer (from our own system)
  3. We are then basically trying to “register” this invoice in FreeAgent by re-creating it in FreeAgent through API.
  4. From the accounting’s standpoint (btw I’m not an accountant so please consider this as a best educated guess):
    a. this invoice was paid from 1 or combination of 2 sources:
    i. Customer’s balance they have with us
    ii. By charging their payment method through a payment gateway
    b. In case we charged their credit card or any other payment method they have, this creates a debit on that payment gateway’s general ledger account toward us.
    c. In case we took some amount from their balance, this should be matched with, let’s say, same amount taken from a general ledger account where we keep sum of balances of all customer’s accounts we have in the system (kind of a reserved cash general ledger account).

Given the described situation, can you advise us how to mark the invoice “paid” through API? What would be the right way to do it? ( I do understand the concept of matching the invoice with the bank statement entry but mind our situation above - we are not going to get “REAL” bank statement for these invoices ever.

Damir Ivan Konjevod

GoSend, Inc.
+385 (0)91 585 77 89 (GMT+1 time zone)
Skype: damir.ivan.konjevod


is there anyone who can answer this please?

Hi Damir,

Sorry for the delayed response - we’ve talked about it round the office and were trying to find the least bad option. I thought someone else had come back to you.

You’re right - there is a certain amount of business and accounting logic in play here. The concept of storing a credit (or debit) balance against a contact is one we’ve looked at adding to the FreeAgent app in the past, but it’s not there yet. Storing this aggregated liability balance in a ledger does seem to make sense - maybe in the Contra Account?

There’s no way to reconcile an invoice payment by any other means than a bank transaction currently, so our suggested workaround would be

  1. Create a dummy bank account for reconciling these invoices
  2. Create a bank transaction in the dummy account for the full amount as an invoice receipt against the invoice
  3. Transfer the payment gateway portion of the payment out of the dummy account into your gateway account and reconcile your gateway receipt against this
  4. Record the account portion of the invoice value as a payment to the Contra Account

This should leave the dummy account with a zero net balance, reduce the liability of the contra account, and keep your payment gateway account reconciled correctly.

It’s a bit convoluted, but I’ve run this past our support accountants and that’s the best option we have for you currently.

Hope that helps,

thank you Paul. That confirms our current knowledge on the subject.