# Delete invoice item

**URL:** <https://api-discuss.freeagent.com/t/delete-invoice-item/322>\
**Category:** Uncategorized\
**Created:** [8 May 2013 15:03 UTC](https://api-discuss.freeagent.com/t/delete-invoice-item/322 "2013-05-08T15:03:23Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Donal\_McBreen](https://api-discuss.freeagent.com/letter_avatar_proxy/v4/letter/d/ee59a6/32.png) [@Donal\_McBreen](https://api-discuss.freeagent.com/u/Donal_McBreen)\
**Post date:** [8 May 2013 15:03 UTC](https://api-discuss.freeagent.com/t/delete-invoice-item/322/1 "2013-05-08T15:03:23Z")

</div>

Hi Hardik,

You can delete an invoice item by sending a DELETE request to its url.

In this case that would be  
[https://api.sandbox.freeagent.com/v2/invoice\_items/2945](https://api.sandbox.freeagent.com/v2/invoice_items/2945).

Regards  
DonalOn Tuesday, May 7, 2013 6:34:22 PM UTC+1, hardik patel wrote:

> Hello,
> 
> I am trying to delete an invoice item using json request as below.
> 
> { “invoice”:{“contact”:“[https://api.sandbox.freeagent.com/v2/contacts/1697](https://api.sandbox.freeagent.com/v2/contacts/1697)  
> “,“dated\_on”:“2013-05-07”,“currency”:“GBP”,“payment\_terms\_in\_days”:5,“invoice\_items”:[{“id”:“2945”,”\_destroy”:“1”}]}}
> 
> The invoice item is not deleted but item\_type has been updated with  
> “no-unit”.
> 
> Please advise.
> 
> Thanks.

---

<div class="post-metadata">

**Author:** ![peter](https://api-discuss.freeagent.com/letter_avatar_proxy/v4/letter/p/278dde/32.png) [@peter](https://api-discuss.freeagent.com/u/peter)\
**Post date:** [4 July 2014 15:09 UTC](https://api-discuss.freeagent.com/t/delete-invoice-item/322/2 "2014-07-04T15:09:15Z")

</div>

Id: 17572221

This is in production.On Friday, July 4, 2014 6:36:37 PM UTC+4, Jonathan Barrett wrote:

> Hi Peter,
> 
> Can you give me an example of an invoice item ID that you’re trying to  
> destroy, and confirm whether you’re seeing this on the sandbox or in  
> production, please?
> 
> Thanks
> 
> -J
> 
> On Friday, 4 July 2014 15:08:12 UTC+1, [pe...@golov.me](mailto:pe...@golov.me) wrote:
> 
> > Hi,
> > 
> > I am having the same problem.
> > 
> > According to the API documentation (  
> > [FreeAgent Developer Dashboard](https://dev.freeagent.com/docs/invoices#update-an-invoice)), it should  
> > delete the invoice item as you have described.
> > 
> > - id The id of the invoice\_item you would like to delete.
> > - \_destroy Should be equal to 1.
> > 
> > {“id”:“2945”,“\_destroy”:“1”}
> > 
> > This does not seem to be working.
> > 
> > Thanks
> > 
> > On Tuesday, May 14, 2013 6:42:03 PM UTC+4, hardik patel wrote:
> > 
> > > Thanks Donal  
> > > Its working fine.
> > > 
> > > On Wednesday, May 8, 2013 8:33:23 PM UTC+5:30, Donal McBreen wrote:
> > > 
> > > > Hi Hardik,
> > > > 
> > > > You can delete an invoice item by sending a DELETE request to its url.
> > > > 
> > > > In this case that would be  
> > > > [https://api.sandbox.freeagent.com/v2/invoice\_items/2945](https://api.sandbox.freeagent.com/v2/invoice_items/2945).
> > > > 
> > > > Regards  
> > > > Donal
> > > > 
> > > > On Tuesday, May 7, 2013 6:34:22 PM UTC+1, hardik patel wrote:
> > > > 
> > > > > Hello,
> > > > > 
> > > > > I am trying to delete an invoice item using json request as below.
> > > > > 
> > > > > { “invoice”:{“contact”:"  
> > > > > [https://api.sandbox.freeagent.com/v2/contacts/1697](https://api.sandbox.freeagent.com/v2/contacts/1697)  
> > > > > “,“dated\_on”:“2013-05-07”,“currency”:“GBP”,“payment\_terms\_in\_days”:5,“invoice\_items”:[{“id”:“2945”,”\_destroy":“1”}]}}
> > > > > 
> > > > > The invoice item is not deleted but item\_type has been updated with  
> > > > > “no-unit”.
> > > > > 
> > > > > Please advise.
> > > > > 
> > > > > Thanks.

---

<div class="post-metadata">

**Author:** ![peter](https://api-discuss.freeagent.com/letter_avatar_proxy/v4/letter/p/278dde/32.png) [@peter](https://api-discuss.freeagent.com/u/peter)\
**Post date:** [4 July 2014 14:08 UTC](https://api-discuss.freeagent.com/t/delete-invoice-item/322/3 "2014-07-04T14:08:12Z")

</div>

Hi,

I am having the same problem.

According to the API documentation  
([FreeAgent Developer Dashboard](https://dev.freeagent.com/docs/invoices#update-an-invoice)), it should  
delete the invoice item as you have described.

- id The id of the invoice\_item you would like to delete.
- \_destroy Should be equal to 1.

{“id”:“2945”,“\_destroy”:“1”}

This does not seem to be working.

ThanksOn Tuesday, May 14, 2013 6:42:03 PM UTC+4, hardik patel wrote:

> Thanks Donal  
> Its working fine.
> 
> On Wednesday, May 8, 2013 8:33:23 PM UTC+5:30, Donal McBreen wrote:
> 
> > Hi Hardik,
> > 
> > You can delete an invoice item by sending a DELETE request to its url.
> > 
> > In this case that would be  
> > [https://api.sandbox.freeagent.com/v2/invoice\_items/2945](https://api.sandbox.freeagent.com/v2/invoice_items/2945).
> > 
> > Regards  
> > Donal
> > 
> > On Tuesday, May 7, 2013 6:34:22 PM UTC+1, hardik patel wrote:
> > 
> > > Hello,
> > > 
> > > I am trying to delete an invoice item using json request as below.
> > > 
> > > { “invoice”:{“contact”:"  
> > > [https://api.sandbox.freeagent.com/v2/contacts/1697](https://api.sandbox.freeagent.com/v2/contacts/1697)  
> > > “,“dated\_on”:“2013-05-07”,“currency”:“GBP”,“payment\_terms\_in\_days”:5,“invoice\_items”:[{“id”:“2945”,”\_destroy":“1”}]}}
> > > 
> > > The invoice item is not deleted but item\_type has been updated with  
> > > “no-unit”.
> > > 
> > > Please advise.
> > > 
> > > Thanks.

---

<div class="post-metadata">

**Author:** ![Jonathan\_Barrett](https://api-discuss.freeagent.com/user_avatar/api-discuss.freeagent.com/jonathan_barrett/32/150_2.png) [@Jonathan\_Barrett](https://api-discuss.freeagent.com/u/Jonathan_Barrett)\
**Post date:** [4 July 2014 17:43 UTC](https://api-discuss.freeagent.com/t/delete-invoice-item/322/4 "2014-07-04T17:43:02Z")

</div>

Hi Peter,

Thanks for that. I’m not seeing any queries to that ID: can you post the  
JSON you’re submitting, along with confirming the endpoint you’re  
submitting to (obviously obscuring any sensitive details!).

Thanks,

-J

---

<div class="post-metadata">

**Author:** ![peter](https://api-discuss.freeagent.com/letter_avatar_proxy/v4/letter/p/278dde/32.png) [@peter](https://api-discuss.freeagent.com/u/peter)\
**Post date:** [7 July 2014 12:59 UTC](https://api-discuss.freeagent.com/t/delete-invoice-item/322/5 "2014-07-07T12:59:10Z")

</div>

Hi Jonathan,

PUT to [https://api.freeagent.com/v2/invoices/9462450](https://api.freeagent.com/v2/invoices/9462450)

Request json:  
{ “invoice”:{  
“invoice\_items”:[  
{  
“id”: “17612624”,  
“\_destroy”: 1  
}  
]  
}}

Response is a 200.

What I am seeing in the invoice is that the invoice item’s quantity  
switches from ‘Product’ to 1. It stays in the invoice and it’s price is  
added up to the total.

Thanks  
PeterOn Friday, July 4, 2014 9:43:03 PM UTC+4, Jonathan Barrett wrote:

> Hi Peter,
> 
> Thanks for that. I’m not seeing any queries to that ID: can you post the  
> JSON you’re submitting, along with confirming the endpoint you’re  
> submitting to (obviously obscuring any sensitive details!).
> 
> Thanks,
> 
> -J

---

<div class="post-metadata">

**Author:** ![Jonathan\_Barrett](https://api-discuss.freeagent.com/user_avatar/api-discuss.freeagent.com/jonathan_barrett/32/150_2.png) [@Jonathan\_Barrett](https://api-discuss.freeagent.com/u/Jonathan_Barrett)\
**Post date:** [8 July 2014 09:57 UTC](https://api-discuss.freeagent.com/t/delete-invoice-item/322/6 "2014-07-08T09:57:25Z")

</div>

That’s my intention, yes.

-J

---

<div class="post-metadata">

**Author:** ![Jonathan\_Barrett](https://api-discuss.freeagent.com/user_avatar/api-discuss.freeagent.com/jonathan_barrett/32/150_2.png) [@Jonathan\_Barrett](https://api-discuss.freeagent.com/u/Jonathan_Barrett)\
**Post date:** [4 July 2014 14:36 UTC](https://api-discuss.freeagent.com/t/delete-invoice-item/322/7 "2014-07-04T14:36:37Z")

</div>

Hi Peter,

Can you give me an example of an invoice item ID that you’re trying to  
destroy, and confirm whether you’re seeing this on the sandbox or in  
production, please?

Thanks

-JOn Friday, 4 July 2014 15:08:12 UTC+1, [pe...@golov.me](mailto:pe...@golov.me) wrote:

> Hi,
> 
> I am having the same problem.
> 
> According to the API documentation (  
> [FreeAgent Developer Dashboard](https://dev.freeagent.com/docs/invoices#update-an-invoice)), it should  
> delete the invoice item as you have described.
> 
> - id The id of the invoice\_item you would like to delete.
> - \_destroy Should be equal to 1.
> 
> {“id”:“2945”,“\_destroy”:“1”}
> 
> This does not seem to be working.
> 
> Thanks
> 
> On Tuesday, May 14, 2013 6:42:03 PM UTC+4, hardik patel wrote:
> 
> > Thanks Donal  
> > Its working fine.
> > 
> > On Wednesday, May 8, 2013 8:33:23 PM UTC+5:30, Donal McBreen wrote:
> > 
> > > Hi Hardik,
> > > 
> > > You can delete an invoice item by sending a DELETE request to its url.
> > > 
> > > In this case that would be  
> > > [https://api.sandbox.freeagent.com/v2/invoice\_items/2945](https://api.sandbox.freeagent.com/v2/invoice_items/2945).
> > > 
> > > Regards  
> > > Donal
> > > 
> > > On Tuesday, May 7, 2013 6:34:22 PM UTC+1, hardik patel wrote:
> > > 
> > > > Hello,
> > > > 
> > > > I am trying to delete an invoice item using json request as below.
> > > > 
> > > > { “invoice”:{“contact”:"  
> > > > [https://api.sandbox.freeagent.com/v2/contacts/1697](https://api.sandbox.freeagent.com/v2/contacts/1697)  
> > > > “,“dated\_on”:“2013-05-07”,“currency”:“GBP”,“payment\_terms\_in\_days”:5,“invoice\_items”:[{“id”:“2945”,”\_destroy":“1”}]}}
> > > > 
> > > > The invoice item is not deleted but item\_type has been updated with  
> > > > “no-unit”.
> > > > 
> > > > Please advise.
> > > > 
> > > > Thanks.

---

<div class="post-metadata">

**Author:** ![peter](https://api-discuss.freeagent.com/letter_avatar_proxy/v4/letter/p/278dde/32.png) [@peter](https://api-discuss.freeagent.com/u/peter)\
**Post date:** [8 July 2014 09:55 UTC](https://api-discuss.freeagent.com/t/delete-invoice-item/322/8 "2014-07-08T09:55:20Z")

</div>

Thanks Jonathan. Will you keep this thread updated?On Tuesday, July 8, 2014 1:15:16 PM UTC+4, Jonathan Barrett wrote:

> Hi Hardik,
> 
> Looks very much like you’ve uncovered a bug here. You _should_ be able to  
> work around this just now by issuing a DELETE request directly to the  
> invoice item’s URL (as suggested by Donal above), but I’ll file this bug  
> and get it fixed up as soon as possible.
> 
> Thanks again,
> 
> -J
> 
> On Mon, Jul 7, 2014 at 1:59 PM, \<[pe...@golov.me](mailto:pe...@golov.me) \<javascript:\>\> wrote:
> 
> > Hi Jonathan,
> > 
> > PUT to [https://api.freeagent.com/v2/invoices/9462450](https://api.freeagent.com/v2/invoices/9462450)
> > 
> > Request json:  
> > { “invoice”:{  
> > “invoice\_items”:[  
> > {  
> > “id”: “17612624”,  
> > “\_destroy”: 1  
> > }  
> > ]  
> > }}
> > 
> > Response is a 200.
> > 
> > What I am seeing in the invoice is that the invoice item’s quantity  
> > switches from ‘Product’ to 1. It stays in the invoice and it’s price is  
> > added up to the total.
> > 
> > Thanks  
> > Peter
> > 
> > On Friday, July 4, 2014 9:43:03 PM UTC+4, Jonathan Barrett wrote:
> > 
> > > Hi Peter,
> > > 
> > > Thanks for that. I’m not seeing any queries to that ID: can you post the  
> > > JSON you’re submitting, along with confirming the endpoint you’re  
> > > submitting to (obviously obscuring any sensitive details!).
> > > 
> > > Thanks,
> > > 
> > > -J
> > 
> > –  
> > You received this message because you are subscribed to the Google Groups  
> > “FreeAgent API” group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [freeagent\_ap...@googlegroups.com](mailto:freeagent_ap...@googlegroups.com) \<javascript:\>.  
> > To post to this group, send email to [freeag...@googlegroups.com](mailto:freeag...@googlegroups.com)  
> > \<javascript:\>.  
> > Visit this group at [http://groups.google.com/group/freeagent\_api](http://groups.google.com/group/freeagent_api).  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> –
> 
> Jonathan Barrett, Senior Engineer
> 
> FreeAgent: Accounting software, simplified  
> [www.freeagent.com](http://www.freeagent.com)
> 
> +44 (0)131 447 0011
> 
> Follow us on Twitter: @freeagent [https://twitter.com/freeagent](https://twitter.com/freeagent)
> 
> FreeAgent Central Ltd, 40 Torphichen Street, Edinburgh EH3 8JB  
> Registered in Scotland SC316774

---

<div class="post-metadata">

**Author:** ![Jonathan\_Barrett](https://api-discuss.freeagent.com/user_avatar/api-discuss.freeagent.com/jonathan_barrett/32/150_2.png) [@Jonathan\_Barrett](https://api-discuss.freeagent.com/u/Jonathan_Barrett)\
**Post date:** [8 July 2014 09:15 UTC](https://api-discuss.freeagent.com/t/delete-invoice-item/322/9 "2014-07-08T09:15:15Z")

</div>

Hi Hardik,

Looks very much like you’ve uncovered a bug here. You _should_ be able to  
work around this just now by issuing a DELETE request directly to the  
invoice item’s URL (as suggested by Donal above), but I’ll file this bug  
and get it fixed up as soon as possible.

Thanks again,

-JOn Mon, Jul 7, 2014 at 1:59 PM, [peter@golov.me](mailto:peter@golov.me) wrote:

> Hi Jonathan,
> 
> PUT to [https://api.freeagent.com/v2/invoices/9462450](https://api.freeagent.com/v2/invoices/9462450)
> 
> Request json:  
> { “invoice”:{  
> “invoice\_items”:[  
> {  
> “id”: “17612624”,  
> “\_destroy”: 1  
> }  
> ]  
> }}
> 
> Response is a 200.
> 
> What I am seeing in the invoice is that the invoice item’s quantity  
> switches from ‘Product’ to 1. It stays in the invoice and it’s price is  
> added up to the total.
> 
> Thanks  
> Peter
> 
> On Friday, July 4, 2014 9:43:03 PM UTC+4, Jonathan Barrett wrote:
> 
> > Hi Peter,
> > 
> > Thanks for that. I’m not seeing any queries to that ID: can you post the  
> > JSON you’re submitting, along with confirming the endpoint you’re  
> > submitting to (obviously obscuring any sensitive details!).
> > 
> > Thanks,
> > 
> > -J
> 
> –  
> You received this message because you are subscribed to the Google Groups  
> “FreeAgent API” group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [freeagent\_api+unsubscribe@googlegroups.com](mailto:freeagent_api+unsubscribe@googlegroups.com).  
> To post to this group, send email to [freeagent\_api@googlegroups.com](mailto:freeagent_api@googlegroups.com).  
> Visit this group at [http://groups.google.com/group/freeagent\_api](http://groups.google.com/group/freeagent_api).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

Jonathan Barrett, Senior Engineer

FreeAgent: Accounting software, simplified

> **[Easy-to-use accounting software for UK small businesses](https://www.freeagent.com)**
>
> FreeAgent's powerful and easy-to-use accounting software for UK businesses brings everything together – from invoices and expenses to Self Assessment tax returns, payroll and MTD-compliant VAT filing. Take a free trial today!

+44 (0)131 447 0011

Follow us on Twitter: @freeagent [https://twitter.com/freeagent](https://twitter.com/freeagent)

FreeAgent Central Ltd, 40 Torphichen Street, Edinburgh EH3 8JB  
Registered in Scotland SC316774

---

<div class="post-metadata">

**Author:** ![hardik\_patel](https://api-discuss.freeagent.com/letter_avatar_proxy/v4/letter/h/e0b2c6/32.png) [@hardik\_patel](https://api-discuss.freeagent.com/u/hardik_patel)\
**Post date:** [14 May 2013 14:42 UTC](https://api-discuss.freeagent.com/t/delete-invoice-item/322/10 "2013-05-14T14:42:03Z")

</div>

Thanks Donal  
Its working fine.On Wednesday, May 8, 2013 8:33:23 PM UTC+5:30, Donal McBreen wrote:

> Hi Hardik,
> 
> You can delete an invoice item by sending a DELETE request to its url.
> 
> In this case that would be  
> [https://api.sandbox.freeagent.com/v2/invoice\_items/2945](https://api.sandbox.freeagent.com/v2/invoice_items/2945).
> 
> Regards  
> Donal
> 
> On Tuesday, May 7, 2013 6:34:22 PM UTC+1, hardik patel wrote:
> 
> > Hello,
> > 
> > I am trying to delete an invoice item using json request as below.
> > 
> > { “invoice”:{“contact”:"  
> > [https://api.sandbox.freeagent.com/v2/contacts/1697](https://api.sandbox.freeagent.com/v2/contacts/1697)  
> > “,“dated\_on”:“2013-05-07”,“currency”:“GBP”,“payment\_terms\_in\_days”:5,“invoice\_items”:[{“id”:“2945”,”\_destroy":“1”}]}}
> > 
> > The invoice item is not deleted but item\_type has been updated with  
> > “no-unit”.
> > 
> > Please advise.
> > 
> > Thanks.
