Api And Tracking Number

We are using the CS-Cart API to try to update the Tracking number for order on website

Below if request and response – seems to be successful response but the order#106945 is not getting updated with the Tracking information.

PUT http://www.homeschooldiploma.com/cscart43/api/shipments/8 HTTP/1.1

Accept: application/json

Content-Type: application/json

Authorization: Basic am9hbkBjb=

Host: www.homeschooldiploma.com

Content-Length: 188

Expect: 100-continue

Connection: Keep-Alive

[{"shipping":"USPS Priority Mail","shipping_id":"8","carrier":"usps","comments":"Shipped","order_id":"106945","user_id":"1","tracking_number":"158523235","products":{"product_id":"2375"}}]

HTTP/1.1 200 OK

Date: Wed, 25 Nov 2015 11:35:50 GMT

Server: LiteSpeed

Connection: close

X-Powered-By: PHP/5.3.28

Last-Modified: Wed, 25 Nov 2015 11:35:50 GMT

Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0

Pragma: no-cache

Expires: -1

Cache-Control: public, max-age=5

Expires: Wed, 25 Nov 2015 11:35:55 GMT

Content-Type: application/json

Content-Length: 19

Vary: User-Agent

{"shipment_id":"8"}

Any suggestions?

The products item should contatin the 'JSON object with cart item ID as key and its quantity as value' ( http://docs.cs-cart.com/4.1.x/api/entities/shipments.html). But it is not an issue of updating shipments.

You need only 'carrier' and 'tracking_number' when you update the existing shipment. And remove '[]' (square brackets).

You request should look like the following:

curl --user admin@example.com:APIkey --header 'Content-Type: application/json' -d '{"carrier": "usps", "tracking_number":"158523235"}' -X PUT 'http://www.homeschooldiploma.com/cscart43/api/shipments/8'

The products item should contatin the 'JSON object with cart item ID as key and its quantity as value' ( http://docs.cs-cart.com/4.1.x/api/entities/shipments.html). But it is not an issue of updating shipments.

You need only 'carrier' and 'tracking_number' when you update the existing shipment. And remove '[]' (square brackets).

You request should look like the following:

curl --user admin@example.com:APIkey --header 'Content-Type: application/json' -d '{"carrier": "usps", "tracking_number":"158523235"}' -X PUT 'http://www.homeschooldiploma.com/cscart43/api/shipments/8'

But according to the documentation there are 6 required fields for this request. Please advise.

They are required for GET request. If you trace the code, you will find out that it ends up with calling the fn_update_shipment function. Which takes only these 2 parameters if a shipment exists

They are required for GET request. If you trace the code, you will find out that it ends up with calling the fn_update_shipment function. Which takes only these 2 parameters if a shipment exists

They should update API documentation. Thank you

We should wait for a response from Triplets :)

Hello,

I am updatiing existing shipment but its giving me error.

{
"message": "Bad Request: Only the tracking_number and carrier params can be updated",
"messages": [
"Only the tracking_number and carrier params can be updated"
],
"status": 400
}
but I am sending only tracking number and carrier
{"carrier": "usps", "tracking_number":"158523235"}