# Error updating order with new items

**URL:** <https://developer-forum.veeqo.com/t/error-updating-order-with-new-items/331>\
**Category:** API Queries (How To)\
**Created:** [January 27, 2021, 12:31am UTC](https://developer-forum.veeqo.com/t/error-updating-order-with-new-items/331 "2021-01-27T00:31:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ben](https://avatars.discourse-cdn.com/v4/letter/b/018950/32.png) [@ben](https://developer-forum.veeqo.com/u/ben)\
**Post date:** [January 27, 2021, 12:31am UTC](https://developer-forum.veeqo.com/t/error-updating-order-with-new-items/331/1 "2021-01-27T00:31:37Z")

</div>

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”  
> }  
> ]  
> }  
> }

---

<div class="post-metadata">

**Author:** ![DazOG](https://avatars.discourse-cdn.com/v4/letter/d/9B8BFF/32.png) [@DazOG](https://developer-forum.veeqo.com/u/DazOG)\
**Post date:** [February 4, 2021, 8:40pm UTC](https://developer-forum.veeqo.com/t/error-updating-order-with-new-items/331/2 "2021-02-04T20:40:29Z")

</div>

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. ☹

---

<div class="post-metadata">

**Author:** ![ben](https://avatars.discourse-cdn.com/v4/letter/b/018950/32.png) [@ben](https://developer-forum.veeqo.com/u/ben)\
**Post date:** [February 4, 2021, 8:42pm UTC](https://developer-forum.veeqo.com/t/error-updating-order-with-new-items/331/3 "2021-02-04T20:42:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![DazOG](https://avatars.discourse-cdn.com/v4/letter/d/9B8BFF/32.png) [@DazOG](https://developer-forum.veeqo.com/u/DazOG)\
**Post date:** [February 4, 2021, 8:43pm UTC](https://developer-forum.veeqo.com/t/error-updating-order-with-new-items/331/4 "2021-02-04T20:43:17Z")

</div>

Sorry I meant `price_per_unit`, but I guess you knew that 🙂

---

<div class="post-metadata">

**Author:** ![ben](https://avatars.discourse-cdn.com/v4/letter/b/018950/32.png) [@ben](https://developer-forum.veeqo.com/u/ben)\
**Post date:** [February 5, 2021, 12:44am UTC](https://developer-forum.veeqo.com/t/error-updating-order-with-new-items/331/5 "2021-02-05T00:44:40Z")

</div>

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
