Get Shipping Zone
Retrieves the details of a single shipping zone, including the countries, states or postal codes it covers and the shipping methods available in it.
HTTP Request
- URL:
/shippingZone/{id} - Method:
GET - Headers:
accessToken: Required. Your API access token.
- Required scope:
READ_SHIPPINGZONEorREAD_WRITE_SHIPPINGZONE
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | String | The ID of the shipping zone to retrieve. |
cURL Example
curl --location '<BASE_URL>/shippingZone/66d36af6d1fc2890ebc32e0b' \
--header 'accessToken: <ACCESS_TOKEN>'
Response
- 200 OK: The shipping zone was returned successfully.
- 400 Bad Request: The access token is missing or invalid, does not have the required scope, or the shipping zone ID is not valid.
Sample JSON Response
{
"success": true,
"data": {
"id": "66d36af6d1fc2890ebc32e0b",
"name": "Midwest",
"active": true,
"type": "state",
"country": [
{
"_id": "66d36af6d1fc2890ebc32e0c",
"name": "United States",
"countryCode": "US"
}
],
"states": [
{
"_id": "66d36af6d1fc2890ebc32e0d",
"name": "Illinois",
"stateCode": "IL"
},
{
"_id": "66d36af6d1fc2890ebc32e0e",
"name": "Wisconsin",
"stateCode": "WI"
}
],
"zipcodes": [],
"shippingMethods": [
{
"_id": "66d42cc091bfe4160114d152",
"shippingMethod": "663a0afe4587085935a4fa0f",
"type": "flatRate",
"name": "flat_rate",
"label": "Flat Rate",
"active": true,
"connected": true,
"setup": {
"rate": 9.99
},
"metaFields": []
}
],
"createdAt": "2024-08-31T19:11:50.883Z",
"updatedAt": "2024-09-01T08:58:40.202Z"
}
}
Response Details
Shipping Zone Data
| Field | Type | Description |
|---|---|---|
id | String | Unique identifier of the shipping zone. |
name | String | Name of the shipping zone. |
active | Boolean | Whether the shipping zone is active. Default is true. |
type | String | What the zone covers: restOfWorld, country, state, zipCodes or zipcode. |
country | Array | Countries in the zone. See below. |
states | Array | States in the zone, each with name and stateCode. |
zipcodes | Array | Postal codes in the zone, each with zipcode. |
shippingMethods | Array | Shipping methods available in the zone. See below. |
createdAt | String | Date and time the zone was created (ISO 8601). |
updatedAt | String | Date and time the zone was last updated (ISO 8601). |
Country Object
| Field | Type | Description |
|---|---|---|
name | String | Name of the country. |
countryCode | String | Two-letter country code. |
Shipping Method Object
| Field | Type | Description |
|---|---|---|
_id | String | Unique identifier of this shipping method in the zone. |
shippingMethod | String | ID of the shipping method. |
type | String | Type of shipping method. |
name | String | Internal name of the shipping method. |
label | String | Name shown to shoppers. |
active | Boolean | Whether the method is enabled in this zone. Default is true. |
connected | Boolean | Whether the shipping method is connected. Default is false. |
setup | Object | Settings for the shipping method. The fields depend on the method. |
metaFields | Array | Custom field values. See Metafields. |
Notes
- If no shipping zone matches the ID,
datais an empty object.