Error updating order with new items

I am trying to add items to an order after it has been created as the requests I am sending to create the original order are constantly failing due to the payload been too big (if i have an order with over 75 different products I generally get a 504 error and the order is not created, below 60 seems ok)

I am using the put request to update the order as per the documentation but when I attempt to add new lines the only thing that is happening is that the lines previously on the order are removed and only the new items appear.

below is an example of the put request I am sending, when I make this request the first two items are removed from the order and only the new one I send is showing. has anyone had any experience of adding additional lines to an order correctly, or can see anything wrong with the request I am making

{
“order”: {
“line_items_attributes”: [
{
“sellable_id”: 45167688
},
{
“sellable_id”: 45164884
},
{
“sellable_id”: “45165633”,
“quantity”: 1,
“price_per_unit”: “7.5000”,
“tax_rate”: “0”,
“taxless_discount_per_unit”: “0.0000”
}
]
}
}

In spite of what the documentation says, you have to provide the quantity and price_to_pay for each existing line item, as a minimum, otherwise they get deleted. Providing just the sellable_id isn’t enough.

Found that out by a lot of trial and error today. :frowning:

awesome thank you, was driving me crazy, thanks for your persistence

Sorry I meant price_per_unit, but I guess you knew that :slight_smile:

Hey Mate, thought I would give you an update on trying this

so I think what this is doing is still removing all the products previously on the order but as you are sending all the data again it is adding them again,

I have some orders that are very big, in that Veeqo wont accept them in one payload hence trying to update them afterwards (sending in 50 item lines at a time as anything above 70 can be hit or miss and anything close to 100 lines just fails)

when I send the first 50 the order is created fine, try sending the next 50 along with the previous 50 and the request fails. frustration does not come close to where I am at with this at the moment