Skip to content

Instantly share code, notes, and snippets.

@zorem
Last active October 20, 2020 11:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zorem/e43aceb2d69284b29ad67ded63755f85 to your computer and use it in GitHub Desktop.
Save zorem/e43aceb2d69284b29ad67ded63755f85 to your computer and use it in GitHub Desktop.
Endpoint – Create a shipment tracking
//With this endpoint you can add new tracking info to orders:
POST /wp-json/wc-ast/v3/orders/<order_id>/shipment-trackings/
curl -X POST https://your-domain.com/wp-json/wc-ast/v3/orders/<order_id>/shipment-trackings
-u consumer_key:consumer_secret
-H "Content-Type: application/json"
-d '{
"tracking_provider": "Fedex",
"tracking_number": "12345678",
"date_shipped": "2019-03-08",//date_shipped is optional parameter
"status_shipped": 1,//status_shipped is optional parameter
"replace_tracking": 1,//replace_tracking is optional parameter
}'
//response example:
"Tracking ID: fb7170d97d0e628bc3b565999d07c6a9"
@TwelveNights
Copy link

Is there documentation on error responses?

@zorem
Copy link
Author

zorem commented Jun 15, 2020

You will get tracking information in response if successful.
It's a WooCommerce Rest API. You can see documentation on error responses here - https://woocommerce.github.io/woocommerce-rest-api-docs/#errors.

@TwelveNights
Copy link

You will get tracking information in response if successful.
It's a WooCommerce Rest API. You can see documentation on error responses here - https://woocommerce.github.io/woocommerce-rest-api-docs/#errors.

Thank you! Sorry to bother you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment