Skip to main content

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.

FieldTypeRequiredDescription
nameStringYesName of the product zone. Must be unique.
typeStringYesWhat the zone matches on: country, state or zipcode.
countryObjectYesThe zone's country. See Country Object.
statesArrayNoStates in the zone, each with name and stateCode. Use when type is state.
zipcodesArrayNoZIP codes in the zone, each with zipcode. Use when type is zipcode.
productGroupsObjectNoThe product groups the zone applies to. See Product Groups Object.
activeBooleanNoWhether the zone is active. Default is true.

Country Object​

FieldTypeRequiredDescription
nameStringYesCountry name, for example United States.
countryCodeStringYesCountry code, for example US.

Product Groups Object​

FieldTypeRequiredDescription
typeStringNoinclude to show only these product groups, or exclude to hide them. Default is include.
productGroupsArrayNoIDs 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​

FieldTypeDescription
successBooleantrue when the product zone was created.
messageStringConfirmation message.
dataObjectThe 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.