# Shipment creation - 400 bad request

**URL:** <https://developer-forum.veeqo.com/t/shipment-creation-400-bad-request/132>\
**Category:** API Queries (How To)\
**Created:** [July 26, 2018, 2:29pm UTC](https://developer-forum.veeqo.com/t/shipment-creation-400-bad-request/132 "2018-07-26T14:29:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![manojkar](https://avatars.discourse-cdn.com/v4/letter/m/7A66F9/32.png) [@manojkar](https://developer-forum.veeqo.com/u/manojkar)\
**Post date:** [July 26, 2018, 2:29pm UTC](https://developer-forum.veeqo.com/t/shipment-creation-400-bad-request/132/1 "2018-07-26T14:29:56Z")

</div>

Hi,  
I’m trying to create a shipment but get a 400 bad request error. The payload is as below. Can someone pls guide as to what is bad in the request.

[https://api.veeqo.com/shipments](https://api.veeqo.com/shipments)  
payload={ “shipment”: { “tracking\_number\_attributes”: { “tracking\_number”: “2Y0000047095” }, “carrier\_id”: 3, “notify\_customer”: true, “update\_remote\_order”: false }, “allocation\_id”: 13911087, “order\_id”: “18926546”}  
HTTP/1.1 400 Bad Request [Server: Cowboy, Connection: keep-alive, Date: Thu, 26 Jul 2018 14:26:18 GMT, Content-Type: application/json; charset=utf-8, Transfer-Encoding: chunked, X-Frame-Options: SAMEORIGIN, X-Xss-Protection: 1; mode=block, X-Content-Type-Options: nosniff, Cache-Control: no-cache, X-Request-Id: a20ff282-6f3e-4993-843b-df7f5945f9d5, X-Runtime: 0.041430, Vary: Accept-Encoding, X-Kong-Upstream-Latency: 60, X-Kong-Proxy-Latency: 0, Via: kong/0.7.0, 1.1 vegur] org.apache.http.conn.BasicManagedEntity@19b0e33b  
java.lang.RuntimeException: Failed : HTTP error code : 400

---

<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:** [July 27, 2018, 2:32pm UTC](https://developer-forum.veeqo.com/t/shipment-creation-400-bad-request/132/2 "2018-07-27T14:32:23Z")

</div>

Hey,

Please can you check the type of quotes that you are using. I manged to create a shipment in my account using the same request but ensure the quotes are not curly quotes. You can use a tool such as [JSONLint](https://jsonlint.com/) to validate your JSON.

The request below worked for me:

```auto
 {
 	"shipment": {
 		"tracking_number_attributes": {
 			"tracking_number": "2Y0000047095ssss"
 		},
 		"carrier_id": 3,
 		"notify_customer": true,
 		"update_remote_order": false
 	},
 	"allocation_id": 13911130,
 	"order_id": "18926671"
 }

```

For clarity the difference is between curly quotes: **“”** and straight quotes: `""`

It might be the case that the forum has automatically changed the quotes in your request. In order to display a block of code use three back ticks before and after your code. EG ```

If that is the case, they I don’t know what was wrong with your request as it worked for me.

Thanks,

---

<div class="post-metadata">

**Author:** ![manojkar](https://avatars.discourse-cdn.com/v4/letter/m/7A66F9/32.png) [@manojkar](https://developer-forum.veeqo.com/u/manojkar)\
**Post date:** [August 1, 2018, 7:17am UTC](https://developer-forum.veeqo.com/t/shipment-creation-400-bad-request/132/3 "2018-08-01T07:17:07Z")

</div>

what is strange is that the payload works fine if i dont send the tracking info…wondering what is wrong with that snippet?  
“tracking\_number\_attributes”: {  
“tracking\_number”: “2Y0000047095”  
},

I’m using the same quotes in the other parts and they are working fine…  
Can you possibly check what was wrong with this one?  
[https://api.veeqo.com/shipments](https://api.veeqo.com/shipments)  
payload={ “shipment”: { “tracking\_number\_attributes”: {  
“tracking\_number”: “PY0000882385” }, “carrier\_id”: 3, “notify\_customer”: true, “update\_remote\_order”: false }, “allocation\_id”: 14058196,  
“order\_id”: 19084238}  
HTTP/1.1 400 Bad Request [Server: Cowboy, Connection: keep-alive, Date: Wed, 01 Aug 2018 06:05:34 GMT, Content-Type: application/json; charset=utf-8, Transfer-Encoding: chunked, X-Frame-Options: SAMEORIGIN, X-Xss-Protection: 1; mode=block, X-Content-Type-Options: nosniff, Cache-Control: no-cache, X-Request-Id: ae983505-f287-495e-a370-fd97a5e520d8, X-Runtime: 0.045906, Vary: Accept-Encoding, X-Kong-Upstream-Latency: 90, X-Kong-Proxy-Latency: 0, Via: kong/0.7.0, 1.1 vegur] org.apache.http.conn.BasicManagedEntity@27cc7517

---

<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:** [August 1, 2018, 7:25am UTC](https://developer-forum.veeqo.com/t/shipment-creation-400-bad-request/132/4 "2018-08-01T07:25:41Z")

</div>

Does the tracking number already exist in Veeqo?  
Tracking number _must_ be unique.
