Skip to main content

Shipping zone locations

The shipping zone locations API allows you to view and batch update locations of a shipping zone.

Shipping location properties

AttributeTypeDescription
codestringShipping zone location code.
typestringShipping zone location type. Options: postcode, state, country and continent. Default is country.

List all locations of a shipping zone

This API helps you to view all the locations of a shipping zone.

GET /wp-json/wc/v2/shipping/zones/<id>/locations
curl https://example.com/wp-json/wc/v2/shipping/zones/5/locations \
-u consumer_key:consumer_secret

Update a locations of a shipping zone

This API lets you make changes to locations of a shipping zone.

PUT /wp-json/wc/v2/shipping/zones/<id>/locations
curl -X PUT https://example.com/wp-json/wc/v2/shipping/zones/5/locations \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '[
{
"code": "BR:SP",
"type": "state"
},
{
"code": "BR:RJ",
"type": "state"
}
]'