Shipment Tracking API

The WooCommerce REST API enable external apps use a set of API endpoints to read and write various parts of WooCommerce data. The AST plugin extends the WooCommerce Rest API and adds Shipment Tracking endpoints that allows to create, view, and delete shipment tracking information in orders.

To use the Shipment Tracking endpoint, you’ll need to generate a Rest API Key for your WooCommerce store. These API keys are the permission for external systems to connect with your store’s API.

The Shipment Tracking endpoint support the following methods:

  • Add tracking information and fulfil orders (Shipped)
  • Get shipping providers list and
  • Delete tracking numbers from orders

Endpoint URL:

https://yourdomaon.com/wp-json/wc-ast/v3/orders/<order_id>/shipment-trackings

The The Shipment Tracking PRO endpoint support the same methods plus it adds the option to add tracking per item, to orders:

  • Add tracking information per item and fulfil orders (Partially Shipped/Shipped)

Endpoint URL:

https://yourdomaon.com/wp-json/wc-ast-pro/v3/orders/<order_id>/shipment-trackings

Please noteThe shipment tracking endpoint works with WooCommerce API v1, v2, and v3. In the documentation, only v1 is shown. We are also compatible with official WooCommerce Shipment Tracking plugin REST API endpoint – wc-shipment-tracking/v3.

Shipment Tracking Properties

These are the available meta field that can be used when updating the Shipment Tracking API:

API date format – in the plugin’s general settings you can select the date format that is received from the external service, (DD/MM/YYYY or MM/DD/YYYY)

Add Shipment tracking

With this endpoint you can add new tracking info to orders:

Add Tracking Per Item

Tracking per item with the API
If you use the Tracking Per Item Add-on, you can add tracking to the API endpoint to specific line items (products) using the product SKU and the quantity shipped properties.

For example, if you received an order of 5 items and want to send them in s packages with different tracking numbers:

Package 1 – tracking number – 123456
Products:

  • t-shirt x 1
  • blue-jeans x 1

Package 2 – tracking number – 456789

  • t-shirt x 1
  • blue-jeans x 2

Get shipment tracking

With this endpoint you can list all tracking info added to an order. You will need to pass order id and you’ll get respond with array of tracking numbers added to that order,

Delete Shipment Tracking

You can delete tracking numbers from orders, you will need to pass the order id and the tracking_id for this tracking number:

Postman example 

Please check screenshot for setup in postman.

Create new request and set method Post. Insert URL and in the Body section insert all the tracking information.

blank

Than go to the Authorization section and select Type Basic Auth. Use REST API Consumer key and consumer secret in the username and password field and click on Send.

blank