Add line item to order with unknown contents


I’m trying to use Zapier to add a single line item (a kit) to an order that reaches Veeqo, based on certain conditions.

I have got as far as using the Orders API endpoint to add the item, but the problem is that I don’t know (and won’t know) what other items the customer has ordered. They could have ordered multiple quantities of different things, as well as the product I’m looking for as the “trigger”.

As far as I can make out, the Update Order Detail endpoint appears to assume that you’re going to provide all of the line items that already exist, as well as adding the new one, rather than just adding or removing a line item cleanly.

As a result, when I run - e.g:

{"order": { "line_item_attributes": [ { "sellable_id": 49639387, "price_per_unit": 0, "quantity": 1 } ] } }

…then the whole order in Veeqo is replaced by the single free item I’m trying to add.

Is there any way I can just cleanly add to an order without having to provide the entire replacement line items data?

Thanks in advance,


I should also add that I have tried this:

{"order": {"line_items_attributes": [ { "sellable_id": 35206349 }, {"sellable_id": 49639387, "price_per_unit": 0, "quantity": 1 } ] }

…where 35206349 is the product_id of the existing line item on the order, and it still gets deleted.

I have the exact same issue, when I add lines it removes the lines already on the order and only adds the new lines. I have another thread open which if anyone responds you might want to watch

1 Like

I think I’ve solved the problem for myself by writing some JavaScript code in Zapier to get the contents of the existing order and turn it into JSON to add to the product I actually wanted to add.

I don’t think it’s particularly good that the only endpoint to update an order has so few parameters, and you can’t change the line items on an order without rebuilding it from scratch.

There ought to be options for appending, deleting, replacing line items etc, or separate endpoints.

Thanks for your reply on my thread. I will hopefully be able to update the orders I have that were failing due to them too big and Veeqo throwing an error.

Must admit the integration I have been doing has been frustrating with things not doing as the docs say

You’re welcome. I have no idea why the API needs you to replace everything in the order when you do the update, but that’s how it currently works, and that’s why it needs the quantity and price_per_unit, because they are required fields.

The documentation example that shows just providing the sellable_id is wrong.