Create Product Zone
Creates a new product zone. Use it to show only, or hide, certain product groups for shoppers in a country, a set of states or a set of ZIP codes.
HTTP Request
- URL:
/ProductZone - Method:
POST - Headers:
accessToken: Required. Your API access token.Content-Type:application/json
- Required scope:
READ_WRITE_PRODUCT
Request Body
Send the product zone as a JSON object.
| Field | Type | Required | Description |
|---|---|---|---|
name | String | Yes | Name of the product zone. Must be unique. |
type | String | Yes | What the zone matches on: country, state or zipcode. |
country | Object | Yes | The zone's country. See Country Object. |
states | Array | No | States in the zone, each with name and stateCode. Use when type is state. |
zipcodes | Array | No | ZIP codes in the zone, each with zipcode. Use when type is zipcode. |
productGroups | Object | No | The product groups the zone applies to. See Product Groups Object. |
active | Boolean | No | Whether the zone is active. Default is true. |
Country Object
| Field | Type | Required | Description |
|---|---|---|---|
name | String | Yes | Country name, for example United States. |
countryCode | String | Yes | Country code, for example US. |
Product Groups Object
| Field | Type | Required | Description |
|---|---|---|---|
type | String | No | include to show only these product groups, or exclude to hide them. Default is include. |
productGroups | Array | No | IDs of the product groups. See Product Groups. |
cURL Example
curl --location '<BASE_URL>/ProductZone' \
--header 'accessToken: <ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"name": "West Coast",
"type": "state",
"active": true,
"country": { "name": "United States", "countryCode": "US" },
"states": [
{ "name": "California", "stateCode": "CA" },
{ "name": "Oregon", "stateCode": "OR" }
],
"productGroups": {
"type": "exclude",
"productGroups": ["66f0a9d8c7b6a5f4e3d2c1b0"]
}
}'
Response
- 200 OK: The product zone was created successfully.
- 400 Bad Request: The access token is missing or invalid, a required field is missing, a value is not valid, or a zone with the same name already exists.
Sample JSON Response
{
"success": true,
"message": "ProductZone added Successfully",
"data": {
"_id": "6705c1a2b3c4d5e6f7a8b9c0",
"name": "West Coast",
"active": true,
"type": "state",
"country": { "name": "United States", "countryCode": "US" },
"states": [
{ "_id": "6705c1a2b3c4d5e6f7a8b9c1", "name": "California", "stateCode": "CA" },
{ "_id": "6705c1a2b3c4d5e6f7a8b9c2", "name": "Oregon", "stateCode": "OR" }
],
"zipcodes": [],
"productGroups": {
"_id": "6705c1a2b3c4d5e6f7a8b9c3",
"type": "exclude",
"productGroups": ["66f0a9d8c7b6a5f4e3d2c1b0"]
},
"createdAt": "2025-10-09T06:14:58.210Z",
"updatedAt": "2025-10-09T06:14:58.210Z"
}
}
Response Details
| Field | Type | Description |
|---|---|---|
success | Boolean | true when the product zone was created. |
message | String | Confirmation message. |
data | Object | The new product zone. Its ID is returned as _id. For all fields, see Get All Product Zones. |
Notes
- Every zone belongs to one country. To cover several countries, create one zone per country.