Skip to main content

Shipping zone methods

The shipping zone methods API allows you to create, view, update, and delete individual methods of a shipping zone.

Shipping method properties

AttributeTypeDescription
instance_idintegerShipping method instance ID. READ-ONLY
titlestringShipping method customer facing title. READ-ONLY
orderintegerShipping method sort order.
enabledbooleanShipping method enabled status.
method_idstringShipping method ID. READ-ONLY MANDATORY
method_titlestringShipping method title. READ-ONLY
method_descriptionstringShipping method description. READ-ONLY
settingsobjectShipping method settings. See Shipping method - Settings properties

Shipping method - Settings properties

AttributeTypeDescription
idstringA unique identifier for the setting. READ-ONLY
labelstringA human readable label for the setting used in interfaces. READ-ONLY
descriptionstringA human readable description for the setting used in interfaces. READ-ONLY
typestringType of setting. Options: text, email, number, color, password, textarea, select, multiselect, radio, image_width and checkbox. READ-ONLY
valuestringSetting value.
defaultstringDefault value for the setting. READ-ONLY
tipstringAdditional help text shown to the user about the setting. READ-ONLY
placeholderstringPlaceholder text to be displayed in text inputs. READ-ONLY

Include a shipping method to a shipping zone

This API helps you to create a new shipping method to a shipping zone.

POST /wp-json/wc/v2/shipping/zones/<id>/methods
curl -X POST https://example.com/wp-json/wc/v2/shipping/zones/5/methods \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"method_id": "flat_rate"
}'

Retrieve a shipping method from a shipping zone

This API lets you retrieve and view a specific shipping method from a shipping zone by ID.

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

List all shipping methods from a shipping zone

This API helps you to view all the shipping methods from a shipping zone.

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

Update a shipping method of a shipping zone

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

PUT /wp-json/wc/v2/shipping/zones/<zone_id>/methods/<id>
curl -X PUT https://example.com/wp-json/wc/v2/shipping/zones/5/methods/26 \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"settings": {
"cost": "20.00"
}
}'

Delete a shipping method from a shipping zone

This API helps you delete a shipping method from a shipping zone.

DELETE /wp-json/wc/v2/shipping/zones/<zone_id>/methods/<id>
curl -X DELETE https://example.com/wp-json/wc/v2/shipping/zones/5/methods/26?force=true \
-u consumer_key:consumer_secret

Available parameters

ParameterTypeDescription
forcestringRequired to be true, as resource does not support trashing.