Create a tracking item with the Shipment Tracking REST API

Create a tracking item by sending a POST request to the order’s Shipment Tracking collection endpoint. Use the canonical wc-shipment-tracking/v3 namespace for new integrations.

Note:

Authenticate with a WooCommerce REST API key that can create or edit orders. Keep the consumer secret outside source control and never expose it in browser-side code.

Request example

↑ Back to top

Replace the credentials, site URL, and order ID with values from your store. This request adds a USPS tracking number to order 645.

curl --user consumer_key:consumer_secret \
  --request POST \
  --header "Content-Type: application/json" \
  --data '{
    "tracking_provider": "USPS",
    "tracking_number": "9400111899560000000000",
    "date_shipped": "2026-07-10"
  }' \
  https://example.com/wp-json/wc-shipment-tracking/v3/orders/645/shipment-trackings

Request fields

↑ Back to top
FieldRequiredDescription
tracking_numberYesThe carrier tracking number.
tracking_providerFor predefined providersA provider name from the providers endpoint.
date_shippedNoThe shipped date in YYYY-MM-DD format. The current date is used when omitted.
custom_tracking_providerFor custom providersThe customer-facing carrier name.
custom_tracking_linkFor custom providersA full tracking URL, normally containing %1$s.

Successful response

↑ Back to top

A successful request returns HTTP 201 Created, the created tracking item, and a Location header for the new resource. The response includes a read-only tracking_id that you can use to retrieve or delete the item later.

Shipment Tracking normalizes the predefined provider value before saving it. Use the exact name returned by the providers endpoint to avoid creating an unintended custom-provider item.

Authentication and errors

↑ Back to top

Create REST API credentials in WooCommerce > Settings > Advanced > REST API. See WooCommerce REST API authentication for supported authentication methods.

StatusMeaning
201The tracking item was created.
400The request attempted to provide an existing tracking ID or contained invalid data.
401 or 403The credentials cannot create order resources.
404The order ID does not identify a WooCommerce order.

There is no update endpoint for a tracking item. Delete the incorrect item and create a replacement when a tracking number, provider, or shipped date needs to change.

Related Products

Offer add-ons like gift wrapping, special messages or other special options for your products.

Let customers subscribe to your products or services and pay on a weekly, monthly or annual basis.

Use of your personal data
We and our partners process your personal data (such as browsing data, IP Addresses, cookie information, and other unique identifiers) based on your consent and/or our legitimate interest to optimize our website, marketing activities, and your user experience.