Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Api And Tracking Number Rate Topic   - - - - -

 
  • Triplets
  • Senior Member
  • Members
  • Join Date: 23-Sep 08
  • 1188 posts

Posted 25 November 2015 - 04:40 PM #1

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?



 
  • galtinbaeva
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 06-Dec 13
  • 3632 posts

Posted 26 November 2015 - 08:19 AM #2

The products item should contatin the 'JSON object with cart item ID as key and its quantity as value' ( http://docs.cs-cart..../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'

Simtech Development | sales@simtechdev.com | www.simtechdev.com
CERTIFIED CS-CART PARTNER | LICENSES | DEVELOPMENT | ADD-ONS | DESIGN | UPGRADE

Google Analytics Enhanced Ecommerce - get advanced ecommerce analytics


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 22839 posts

Posted 26 November 2015 - 09:00 AM #3

 

The products item should contatin the 'JSON object with cart item ID as key and its quantity as value' ( http://docs.cs-cart..../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.


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 1210     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 4025     CS-Cart + YOUPI      USD 1459      Multi-Vendor Ultimate       USD 7500 (6000)


 
  • galtinbaeva
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 06-Dec 13
  • 3632 posts

Posted 26 November 2015 - 09:06 AM #4

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


Simtech Development | sales@simtechdev.com | www.simtechdev.com
CERTIFIED CS-CART PARTNER | LICENSES | DEVELOPMENT | ADD-ONS | DESIGN | UPGRADE

Google Analytics Enhanced Ecommerce - get advanced ecommerce analytics


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 22839 posts

Posted 26 November 2015 - 09:14 AM #5

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


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 1210     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 4025     CS-Cart + YOUPI      USD 1459      Multi-Vendor Ultimate       USD 7500 (6000)


 
  • galtinbaeva
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 06-Dec 13
  • 3632 posts

Posted 26 November 2015 - 09:25 AM #6

We should wait for a response from Triplets :)


Simtech Development | sales@simtechdev.com | www.simtechdev.com
CERTIFIED CS-CART PARTNER | LICENSES | DEVELOPMENT | ADD-ONS | DESIGN | UPGRADE

Google Analytics Enhanced Ecommerce - get advanced ecommerce analytics


 
  • Namrata
  • Newbie
  • Trial users
  • Join Date: 21-Sep 21
  • 1 posts

Posted 22 September 2021 - 12:32 AM #7

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"}