# Write off amounts per invoice

**URL:** <https://api-discuss.freeagent.com/t/write-off-amounts-per-invoice/1927>\
**Category:** Uncategorized\
**Created:** [15 March 2020 09:47 UTC](https://api-discuss.freeagent.com/t/write-off-amounts-per-invoice/1927 "2020-03-15T09:47:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fraser.mayfield](https://api-discuss.freeagent.com/letter_avatar_proxy/v4/letter/f/a5b964/32.png) [@fraser.mayfield](https://api-discuss.freeagent.com/u/fraser.mayfield)\
**Post date:** [15 March 2020 09:47 UTC](https://api-discuss.freeagent.com/t/write-off-amounts-per-invoice/1927/1 "2020-03-15T09:47:07Z")

</div>

Our integration creates new invoices via the API and then imports invoice receipts on a scheduled basis so that users can view the status of open invoices.

We would like to do the same by importing write off transactions, but can’t see where this information is held. Essentially we just need details of ‘write off amount’, ‘invoice\_reference’ and ‘writen off date’.

Is this something we would get from the invoice API or elsewhere?

---

<div class="post-metadata">

**Author:** ![Andrew\_Stewart](https://api-discuss.freeagent.com/user_avatar/api-discuss.freeagent.com/andrew_stewart/32/149_2.png) [@Andrew\_Stewart](https://api-discuss.freeagent.com/u/Andrew_Stewart)\
**Post date:** [16 March 2020 11:17 UTC](https://api-discuss.freeagent.com/t/write-off-amounts-per-invoice/1927/2 "2020-03-16T11:17:28Z")

</div>

You can query the invoices endpoint for all recent invoices, then look at each one’s `status` field to find those which are `Written-off` or `Part written-off`. You can then look at an invoice’s `reference` attribute and `written_off_date`.

Presumably the written-off amount is the same as the `due_value`.

[https://dev.freeagent.com/docs/invoices#invoice-attributes](https://dev.freeagent.com/docs/invoices#invoice-attributes)

Yours,  
Andrew Stewart

–  
[https://doubleagent.io](https://doubleagent.io)

---

<div class="post-metadata">

**Author:** ![Peter\_Singh](https://api-discuss.freeagent.com/user_avatar/api-discuss.freeagent.com/peter_singh/32/219_2.png) [@Peter\_Singh](https://api-discuss.freeagent.com/u/Peter_Singh)\
**Post date:** [16 March 2020 13:15 UTC](https://api-discuss.freeagent.com/t/write-off-amounts-per-invoice/1927/3 "2020-03-16T13:15:11Z")

</div>

You’re exactly right Andrew, an invoice which is written off will have a status of `Written-off` or `Part written-off` and if an invoice is written off, the amount written off will be the `due_value `.

Write off transactions don’t exist in FreeAgent as such, rather an invoice that is written off just has an amount still outstanding which has been written off.

A slight quirk I’d like to point out here is that the `written_off_date` will only be included in the response if the invoice has no payments (ie is fully written off, not partially written off).

I think it would also be worth double checking for yourself that writing off your invoices is the appropriate thing to do and this Knowledge Base article should point you in the right direction:

> **[Write off an unpaid invoice](https://support.freeagent.com/hc/en-gb/articles/115001223784-Write-off-an-unpaid-invoice)**
>
> What to do if you have an invoice open and overdue in FreeAgent that your customer isn't going to pay you for.
> Perhaps they've gone out of business, or won't pay because of a dispute. This is calle...

All the best,  
Peter

---

<div class="post-metadata">

**Author:** ![fraser.mayfield](https://api-discuss.freeagent.com/letter_avatar_proxy/v4/letter/f/a5b964/32.png) [@fraser.mayfield](https://api-discuss.freeagent.com/u/fraser.mayfield)\
**Post date:** [16 March 2020 13:26 UTC](https://api-discuss.freeagent.com/t/write-off-amounts-per-invoice/1927/4 "2020-03-16T13:26:59Z")

</div>

> [@Peter\_Singh](#):
>
> I think it would also be worth double checking for yourself that writing off your invoices is the appropriate thing to do and this Knowledge Base article should point you in the right direction:

Hi Peter & Andrew,

Thanks for your help, this explains well the process and should enable us to build the integration in principle, but we will require it to work for both full and partial write off scenarios.

I have added my vote to the relevant item on your trello board.

https://trello.com/c/cwPRSywA.html
