Shipping Zone API
Shipping zones define geographic regions and the shipping methods available to them. Each zone can have multiple shipping methods with different pricing models.
Endpoints
Create a Shipping Zone
Creates a new shipping zone with a name, country, and optional province restrictions.
Request Schema (application/json)
| Field Name | Field Type | Required |
|---|---|---|
| name | string | Yes |
| country | string | Yes |
| provinces | array of string | No |
POST/api/shippingZones
- cURL
- JavaScript
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
--data-raw '<JSON DATA>'
https://<your domain>/api/shippingZones
fetch('https://<your domain>/api/shippingZones', {
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer <admin JWT token>'
},
body: <JSON DATA>
})
.then(response => response.json())
.then(data => {
if(data.error) {
// Handle the error
} else {
// Handle the data
}
})
.catch(error => {
// Handle the error
});
Sample Of Response
{
"data": {
"shipping_zone_id": 3,
"uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "US West Coast",
"country": "US",
"provinces": ["CA", "OR", "WA"]
}
}
Update a Shipping Zone
Updates an existing shipping zone.
Request Schema (application/json)
| Field Name | Field Type | Required |
|---|---|---|
| name | string | Yes |
| country | string | Yes |
| provinces | array of string | No |
PATCH/api/shippingZones/{id}
- cURL
- JavaScript
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
--data-raw '<JSON DATA>'
https://<your domain>/api/shippingZones/{id}
fetch('https://<your domain>/api/shippingZones/{id}', {
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer <admin JWT token>'
},
body: <JSON DATA>
})
.then(response => response.json())
.then(data => {
if(data.error) {
// Handle the error
} else {
// Handle the data
}
})
.catch(error => {
// Handle the error
});
Sample Of Response
{
"data": {
"shipping_zone_id": 3,
"uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "US West Coast Updated"
}
}
Delete a Shipping Zone
Permanently removes a shipping zone and all its associated methods.
Request Schema (application/json)
No request body requiredDELETE/api/shippingZones/{id}
- cURL
- JavaScript
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
https://<your domain>/api/shippingZones/{id}
fetch('https://<your domain>/api/shippingZones/{id}', {
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer <admin JWT token>'
}
})
.then(response => response.json())
.then(data => {
if(data.error) {
// Handle the error
} else {
// Handle the data
}
})
.catch(error => {
// Handle the error
});
Sample Of Response
{
"data": {
"success": true
}
}
Zone Methods
Add Method to Shipping Zone
Adds a shipping method to a zone with pricing and condition rules.
Request Schema (application/json)
| Field Name | Field Type | Required |
|---|---|---|
| method_id | string | Yes |
| cost | string or number | No |
| is_enabled | integer or string or boolean (0, 1, '0', '1', true, false) | No |
| calculation_type | string (flat_rate, price_based_rate, weight_based_rate, api) | No |
| condition_type | string (weight, price, none) | Yes |
| min | string or number | No |
| max | string or number | No |
POST/api/shippingZones/{id}/methods
- cURL
- JavaScript
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
--data-raw '<JSON DATA>'
https://<your domain>/api/shippingZones/{id}/methods
fetch('https://<your domain>/api/shippingZones/{id}/methods', {
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer <admin JWT token>'
},
body: <JSON DATA>
})
.then(response => response.json())
.then(data => {
if(data.error) {
// Handle the error
} else {
// Handle the data
}
})
.catch(error => {
// Handle the error
});
Sample Of Response
{
"data": {
"method_id": "standard_shipping",
"zone_id": 3,
"cost": 5.99,
"is_enabled": true,
"calculation_type": "flat_rate",
"condition_type": "none"
}
}
Update Zone Method
Updates an existing shipping method within a zone.
Request Schema (application/json)
| Field Name | Field Type | Required |
|---|---|---|
| cost | string or number | No |
| is_enabled | integer or string or boolean (0, 1, '0', '1', true, false) | No |
| calculation_type | string (flat_rate, price_based_rate, weight_based_rate, api) | Yes |
| condition_type | string (weight, price, none) | Yes |
PATCH/api/shippingZones/{zone_id}/methods/{method_id}
- cURL
- JavaScript
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
--data-raw '<JSON DATA>'
https://<your domain>/api/shippingZones/{zone_id}/methods/{method_id}
fetch('https://<your domain>/api/shippingZones/{zone_id}/methods/{method_id}', {
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer <admin JWT token>'
},
body: <JSON DATA>
})
.then(response => response.json())
.then(data => {
if(data.error) {
// Handle the error
} else {
// Handle the data
}
})
.catch(error => {
// Handle the error
});
Sample Of Response
{
"data": {
"method_id": "standard_shipping",
"cost": 7.99
}
}
Delete Zone Method
Removes a shipping method from a zone.
Request Schema (application/json)
No request body requiredDELETE/api/shippingZones/{zone_id}/methods/{method_id}
- cURL
- JavaScript
curl
-H "Accept: application/json"
-H "Authorization: Bearer <admin JWT token>"
https://<your domain>/api/shippingZones/{zone_id}/methods/{method_id}
fetch('https://<your domain>/api/shippingZones/{zone_id}/methods/{method_id}', {
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer <admin JWT token>'
}
})
.then(response => response.json())
.then(data => {
if(data.error) {
// Handle the error
} else {
// Handle the data
}
})
.catch(error => {
// Handle the error
});
Sample Of Response
{
"data": {
"success": true
}
}