Delete invoice item

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.

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
“,“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.

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 wrote:

Hi,

I am having the same problem.

According to the API documentation (
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.

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
“,“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.

Hi,

I am having the same problem.

According to the API documentation
(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.

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
“,“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.

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

Hi Jonathan,

PUT to 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

That’s my intention, yes.

-J

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 wrote:

Hi,

I am having the same problem.

According to the API documentation (
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.

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
“,“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.

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 <javascript:>> wrote:

Hi Jonathan,

PUT to 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 <javascript:>.
To post to this group, send email to freeag...@googlegroups.com
<javascript:>.
Visit this group at http://groups.google.com/group/freeagent_api.
For more options, visit https://groups.google.com/d/optout.

Jonathan Barrett, Senior Engineer

FreeAgent: Accounting software, simplified
www.freeagent.com

+44 (0)131 447 0011

Follow us on Twitter: @freeagent https://twitter.com/freeagent

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

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 wrote:

Hi Jonathan,

PUT to 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.
To post to this group, send email to freeagent_api@googlegroups.com.
Visit this group at http://groups.google.com/group/freeagent_api.
For more options, visit https://groups.google.com/d/optout.

Jonathan Barrett, Senior Engineer

FreeAgent: Accounting software, simplified

+44 (0)131 447 0011

Follow us on Twitter: @freeagent https://twitter.com/freeagent

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

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.

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
“,“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.