Last active
September 13, 2021 18:58
-
-
Save zorem/53ebf4fdeb11f528a6ccfb0c62492cac to your computer and use it in GitHub Desktop.
Endpoint – Create a shipment tracking per item using REST API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//With this endpoint you can add new tracking info to orders: | |
POST /wp-json/wc-ast-pro/v3/orders/<order_id>/shipment-trackings/ | |
curl -X POST https://your-domain.com/wp-json/wc-ast-pro/v3/orders/<order_id>/shipment-trackings | |
-u consumer_key:consumer_secret | |
-H "Content-Type: application/json" | |
-d '{ | |
"tracking_provider": "USPS", | |
"tracking_number": "123456", | |
"date_shipped": "2020-01-24",//date_shipped is optional parameter | |
"status_shipped": 1,//status_shipped is optional parameter | |
"sku": t-shirt,blue-jeans //the line item (product) SKU | |
"qty": 1,1 //the line item (product) quantity | |
}' | |
curl -X POST https://your-domain.com/wp-json/wc-ast-pro/v1/orders/<order_id>/shipment-trackings | |
-u consumer_key:consumer_secret | |
-H "Content-Type: application/json" | |
-d '{ | |
"tracking_provider": "USPS", | |
"tracking_number": "456879", | |
"date_shipped": "2020-01-24",//date_shipped is optional parameter | |
"status_shipped": 1,//status_shipped is optional parameter | |
"sku": t-shirt,blue-jeans //the line item (product) SKU | |
"qty": 1,2 //the line item (product) quantity | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This API does not work correctly,
First, it does not update the tracking in line, the same way as you with the widget in word press,
It picks up Sku from the parent rather than from the variation item line
When calling Get Shipment, it does not say which sku was shipped