# Removing order allocations

**URL:** <https://developer-forum.veeqo.com/t/removing-order-allocations/68>\
**Category:** API Queries (How To)\
**Created:** [October 11, 2017, 4:06pm UTC](https://developer-forum.veeqo.com/t/removing-order-allocations/68 "2017-10-11T16:06:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andriy](https://yyz1.discourse-cdn.com/flex033/user_avatar/developer-forum.veeqo.com/andriy/32/28_2.png) [@Andriy](https://developer-forum.veeqo.com/u/Andriy)\
**Post date:** [October 11, 2017, 4:06pm UTC](https://developer-forum.veeqo.com/t/removing-order-allocations/68/1 "2017-10-11T16:06:25Z")

</div>

Hello there again,  
I’m trying to cancel order now, but I get 400 error.  
I have the following code used:  
RestClient::Request.execute(method: :delete, url: “[https://api.veeqo.com/orders/#{order[:id]}/allocations/#{alloc\_id}](https://api.veeqo.com/orders/#%7Border%5B:id%5D%7D/allocations/#%7Balloc_id%7D)”,  
headers: { content\_type:“application/json”,x\_api\_key: User.last.veeqo\_token })  
Can you advise me, what I’m doing wrong here? Because it seems that recently this code was working perfectly.  
Thanks a lot 🙂

---

<div class="post-metadata">

**Author:** ![Andriy](https://yyz1.discourse-cdn.com/flex033/user_avatar/developer-forum.veeqo.com/andriy/32/28_2.png) [@Andriy](https://developer-forum.veeqo.com/u/Andriy)\
**Post date:** [October 11, 2017, 4:21pm UTC](https://developer-forum.veeqo.com/t/removing-order-allocations/68/2 "2017-10-11T16:21:42Z")

</div>

Got an answer:  
First I need to delete a shipment.  
Going to check it

---

<div class="post-metadata">

**Author:** ![Andriy](https://yyz1.discourse-cdn.com/flex033/user_avatar/developer-forum.veeqo.com/andriy/32/28_2.png) [@Andriy](https://developer-forum.veeqo.com/u/Andriy)\
**Post date:** [October 11, 2017, 4:46pm UTC](https://developer-forum.veeqo.com/t/removing-order-allocations/68/3 "2017-10-11T16:46:56Z")

</div>

Yeah, that was a shipment. First you need to delete it, than delete allocation 🙂

---

<div class="post-metadata">

**Author:** ![phil](https://yyz1.discourse-cdn.com/flex033/user_avatar/developer-forum.veeqo.com/phil/32/43_2.png) [@phil](https://developer-forum.veeqo.com/u/phil)\
**Post date:** [October 11, 2017, 4:54pm UTC](https://developer-forum.veeqo.com/t/removing-order-allocations/68/4 "2017-10-11T16:54:41Z")

</div>

This.

This is the best sort of support query!

Let me know if you need anything else.
