Get Shipping Zone
This endpoint retrieves detailed information about a specific shipping zone, identified by its unique ID.
Endpoint
- URL:
/shippingZone/{id} - Method:
GET
Replace {id} with the specific shipping zone ID you want to retrieve.
Authentication
- Header:
accessToken - Type: Bearer Token
- Value:
<ACCESS-TOKEN>
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The unique identifier of the shipping zone to fetch. |
Request Headers
| Header | Type | Description |
|---|---|---|
accessToken | string | Access token for authentication. (required) |
Sample Request
curl --location '<BASE-URL>/shippingZone/66d36af6d1fc2890ebc32e0b' \
--header 'accessToken: <ACCESS-TOKEN>'
Response
- Status Code: 200 OK
Sample Response Body
{
"success": true,
"data": {
"name": "CA",
"active": true,
"type": "country",
"country": {
"name": "United States",
"countryCode": "US"
},
"states": [],
"zipcodes": [],
"shippingMethods": [],
"createdAt": "2024-08-31T19:11:50.883Z",
"updatedAt": "2024-08-31T19:12:01.794Z",
"__v": 0,
"id": "66d36af6d1fc2890ebc32e0b"
}
}
Response Fields
| Field | Type | Description |
|---|---|---|
success | boolean | Indicates whether the request was successful. |
data | object | An object containing the details about the shipping zone. See Shipping Zone Details for more information. |
Shipping Zone Details
The data object includes the following fields:
| Field | Type | Description |
|---|---|---|
name | string | Name of the shipping zone. |
active | boolean | Indicates if the shipping zone is active. |
type | string | The type of the zone (e.g., country). |
country | object | Contains details of the country associated with the zone. See Country Object. |
states | array | List of associated states within the zone. |
zipcodes | array | List of associated zip codes within the zone. |
shippingMethods | array | Details of shipping methods available within the zone. |
createdAt | string | Date and time when the zone was created (ISO 8601 format). |
updatedAt | string | Date and time when the zone was last updated (ISO format). |
__v | number | Version key for internal use. |
id | string | Unique identifier of the shipping zone. |
Country Object
The country object within the data field includes:
| Field | Type | Description |
|---|---|---|
name | string | Name of the country. |
countryCode | string | ISO country code. |
Notes
- Ensure the
accessTokenis valid and passed in the header to authorize the request. - This endpoint retrieves information specific to one shipping zone based on the provided ID.
- The
states,zipcodes, andshippingMethodsarrays may be empty if no specific details are associated with the zone at the time of the request.