Use this endpoint to query and/or manage shipments. You might want to create shipments to an order or update a shipment’s tracking number.
List shipments
GET: /wp-json/wc/v3/shipments/
Scope under which the request is made; determines fields present in response. Options: view
Current page of the collection. Default is 1
Maximum number of items to be returned in result set. Default is 10
Limit results to those matching a string.
Offset the result set by a specific number of items.
Order sort attribute ascending or descending. Options: desc
Sort collection by object attribute. Options: date_created
Limit result set to shipments belonging to a certain order id.
Limit result set to shipments having a certain status. Options:
Limit result set to shipments of a certain type. Options: simple
Example
This is an example request which retrieves shipments associated with a certain order.
curl https://example.com/wp-json/wc/v3/shipments/?order_id=<order_id>
Manage shipments
Retrieve, update or delete a shipment.
GET|POST|PUT|PATCH|DELETE: /wp-json/wc/v3/shipments/<id>
Properties
Shipment ID.
Shipment number.
Shipment order id.
Shipment order number.
Shipment status. Options:
Shipment tracking id.
Shipment tracking url.
Shipment shipping provider.
The date the shipment was created, in the site’s timezone.
The date the shipment was created, as GMT.
The date the shipment was sent, in the site’s timezone.
The date the shipment was sent, as GMT.
The estimated delivery date of the shipment, in the site’s timezone.
The estimated delivery date of the shipment, as GMT.
Shipment type, e.g. simple or return. Options:
Return shipment is requested by customer.
Return sender address.
Shipment weight.
Shipment content weight.
Shipment content dimensions.
Shipment weight unit. Default is kg
Shipment packaging id.
Shipment packaging weight.
Shipment total.
Shipment subtotal.
Shipment additional total.
Shipment version.
Shipment shipping method.
Shipment dimensions.
Shipment package dimensions.
Shipment dimension unit. Default is cm
Shipping address.
Meta data.
Shipment items.
sender_address properties
First name.
Last name.
Company name.
Address line 1.
Address line 2.
City name.
ISO code or name of the state, province or district.
Postal code.
Country code in ISO 3166-1 alpha-2 format.
Customs reference number.
content_dimensions properties
Shipment content length.
Shipment content width.
Shipment content height.
dimensions properties
Item length.
Item width.
Item height.
package_dimensions properties
Shipment package length.
Shipment package width.
Shipment package height.
address properties
First name.
Last name.
Company name.
Address line 1.
Address line 2.
City name.
ISO code or name of the state, province or district.
Postal code.
Country code in ISO 3166-1 alpha-2 format.
Customs reference number.
meta_data properties
Meta ID.
Meta key.
Meta value.
items properties
Item ID.
Item name.
Order Item ID.
Product ID.
Quantity.
Item weight.
Item SKU.
Item total.
Item subtotal.
Item HS Code.
Item customs description.
Item parent id, e.g. the return item’s parent.
The parent item id inside the current shipment.
Item country of manufacture in ISO 3166-1 alpha-2 format.
Item dimensions.
Item attributes.
Shipment item meta data.
attributes properties
Attribute key.
Attribute value.
Attribute label.
Order item meta id.
Create a shipment
Create a shipment to an order and pass a custom tracking number. By default (e.g. not provided during request) items and shipment data is determined based on the underlying order. You may of course pass custom data too.
curl -L -X POST 'https://example.com/wp-json/wc/v3/shipments' \ -H 'Authorization: Basic your_key' \ -H 'Content-Type: application/json' \ -d '{ "tracking_id": "123456", "order_id": "3780" }'
Create a label
You may want to create/download a label for a certain shipment. By default, e.g. passing no arguments to the request, the default label configuration (based on your packaging chosen for the shipment) will be used. You might explicitly pass certain arguments on a per shipping provider level but you’ll need to find out about the services available and IDs yourself by looking at the manual label creation (XHR) request via your Browser tools.
curl -L -X POST 'http://example.com/wp-json/wc/v3/shipments/690/label' \ -H 'Authorization: Basic your_key'
Retrieve a label
You may retrieve a label for a certain shipment which contains the actual label as base64 encoded file.
curl -L 'http://example.com/wp-json/wc/v3/shipments/690/label' \ -H 'Authorization: Basic your_key'