How to remove an order item by API


(Andrea Tasca) #1

Hi I need to remove an item from an order using API, I’m trying using DataService.delete and OrderItem as table but I get the error:
"[NoTableAccess]You cannot delete from OrderItem through the API"

Is there a way to do that?

Best regards,
Andrea


(John Borelli) #2

Delete an order item? no. Think about the implications. What would happen to the orders that the order item was attached to? It would create data integrity issues in the database. You could change the order id so it doesn’t show up on the order or you could edit the item and show it as a “removed from order” item but not actually deleting it from the table.


(Pav) #3

Out of curiosity is this just a single Order you want to delete the Item from, or several Orders?

The only thing you can do is to delete the Invoice, which will delete the Order via the API.

https://developer.infusionsoft.com/docs/xml-rpc/#invoice-delete-an-invoice


(Andrea Tasca) #4

I just want to remove an article from the order.
Think about an operator that make a mistake inserting the order and then he wants to remove a wrong article.
I think that if I can add an item I can remove it too, at least until the order is paid.
The only choice in this case is to completly remove the order and then insert it again.
Not an elegant solution…