curl --request POST \
--url https://api.sandbox.usenash.com/v1/zones \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"externalId": "<string>",
"name": "Zone 1",
"coverageAreaId": "<string>",
"polygon": [
[
37.7749,
-122.4194
],
[
37.8049,
-122.4194
],
[
37.8049,
-122.3894
],
[
37.7749,
-122.3894
],
[
37.7749,
-122.4194
]
],
"storeLocationIds": [
"stl_01234567890123456789",
"stl_01234567890123456789"
],
"storeLocationAssociations": [
{
"end_date": "2025-01-01",
"start_date": "2024-01-01",
"store_location_id": "stl_01234567890123456789"
}
],
"tags": "['service:rapid', 'service:express', 'franchise_location']",
"zoneMetadata": {
"key": "value"
}
}
EOFimport requests
url = "https://api.sandbox.usenash.com/v1/zones"
payload = {
"externalId": "<string>",
"name": "Zone 1",
"coverageAreaId": "<string>",
"polygon": [[37.7749, -122.4194], [37.8049, -122.4194], [37.8049, -122.3894], [37.7749, -122.3894], [37.7749, -122.4194]],
"storeLocationIds": ["stl_01234567890123456789", "stl_01234567890123456789"],
"storeLocationAssociations": [
{
"end_date": "2025-01-01",
"start_date": "2024-01-01",
"store_location_id": "stl_01234567890123456789"
}
],
"tags": "['service:rapid', 'service:express', 'franchise_location']",
"zoneMetadata": { "key": "value" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
externalId: '<string>',
name: 'Zone 1',
coverageAreaId: '<string>',
polygon: [
[37.7749, -122.4194],
[37.8049, -122.4194],
[37.8049, -122.3894],
[37.7749, -122.3894],
[37.7749, -122.4194]
],
storeLocationIds: ['stl_01234567890123456789', 'stl_01234567890123456789'],
storeLocationAssociations: [
{
end_date: '2025-01-01',
start_date: '2024-01-01',
store_location_id: 'stl_01234567890123456789'
}
],
tags: '[\'service:rapid\', \'service:express\', \'franchise_location\']',
zoneMetadata: {key: 'value'}
})
};
fetch('https://api.sandbox.usenash.com/v1/zones', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.usenash.com/v1/zones",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'externalId' => '<string>',
'name' => 'Zone 1',
'coverageAreaId' => '<string>',
'polygon' => [
[
37.7749,
-122.4194
],
[
37.8049,
-122.4194
],
[
37.8049,
-122.3894
],
[
37.7749,
-122.3894
],
[
37.7749,
-122.4194
]
],
'storeLocationIds' => [
'stl_01234567890123456789',
'stl_01234567890123456789'
],
'storeLocationAssociations' => [
[
'end_date' => '2025-01-01',
'start_date' => '2024-01-01',
'store_location_id' => 'stl_01234567890123456789'
]
],
'tags' => '[\'service:rapid\', \'service:express\', \'franchise_location\']',
'zoneMetadata' => [
'key' => 'value'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.usenash.com/v1/zones"
payload := strings.NewReader("{\n \"externalId\": \"<string>\",\n \"name\": \"Zone 1\",\n \"coverageAreaId\": \"<string>\",\n \"polygon\": [\n [\n 37.7749,\n -122.4194\n ],\n [\n 37.8049,\n -122.4194\n ],\n [\n 37.8049,\n -122.3894\n ],\n [\n 37.7749,\n -122.3894\n ],\n [\n 37.7749,\n -122.4194\n ]\n ],\n \"storeLocationIds\": [\n \"stl_01234567890123456789\",\n \"stl_01234567890123456789\"\n ],\n \"storeLocationAssociations\": [\n {\n \"end_date\": \"2025-01-01\",\n \"start_date\": \"2024-01-01\",\n \"store_location_id\": \"stl_01234567890123456789\"\n }\n ],\n \"tags\": \"['service:rapid', 'service:express', 'franchise_location']\",\n \"zoneMetadata\": {\n \"key\": \"value\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sandbox.usenash.com/v1/zones")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"externalId\": \"<string>\",\n \"name\": \"Zone 1\",\n \"coverageAreaId\": \"<string>\",\n \"polygon\": [\n [\n 37.7749,\n -122.4194\n ],\n [\n 37.8049,\n -122.4194\n ],\n [\n 37.8049,\n -122.3894\n ],\n [\n 37.7749,\n -122.3894\n ],\n [\n 37.7749,\n -122.4194\n ]\n ],\n \"storeLocationIds\": [\n \"stl_01234567890123456789\",\n \"stl_01234567890123456789\"\n ],\n \"storeLocationAssociations\": [\n {\n \"end_date\": \"2025-01-01\",\n \"start_date\": \"2024-01-01\",\n \"store_location_id\": \"stl_01234567890123456789\"\n }\n ],\n \"tags\": \"['service:rapid', 'service:express', 'franchise_location']\",\n \"zoneMetadata\": {\n \"key\": \"value\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.usenash.com/v1/zones")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"externalId\": \"<string>\",\n \"name\": \"Zone 1\",\n \"coverageAreaId\": \"<string>\",\n \"polygon\": [\n [\n 37.7749,\n -122.4194\n ],\n [\n 37.8049,\n -122.4194\n ],\n [\n 37.8049,\n -122.3894\n ],\n [\n 37.7749,\n -122.3894\n ],\n [\n 37.7749,\n -122.4194\n ]\n ],\n \"storeLocationIds\": [\n \"stl_01234567890123456789\",\n \"stl_01234567890123456789\"\n ],\n \"storeLocationAssociations\": [\n {\n \"end_date\": \"2025-01-01\",\n \"start_date\": \"2024-01-01\",\n \"store_location_id\": \"stl_01234567890123456789\"\n }\n ],\n \"tags\": \"['service:rapid', 'service:express', 'franchise_location']\",\n \"zoneMetadata\": {\n \"key\": \"value\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "zone_01234567890123456789",
"name": "Zone 1",
"externalId": "ext_01234567890123456789",
"portalUrl": "https://portal.usenash.com/settings/zones/zone_01234567890123456789",
"coverageArea": {
"cities": [
"San Francisco"
],
"cityZipcodes": [],
"countries": [],
"id": "coa_01234567890123456789",
"states": [],
"zipCodes": [
"94114"
]
},
"storeLocations": [
{
"blackoutDates": [],
"email": "",
"externalId": "ext_01234567890123456789",
"firstName": "Steve",
"id": "stl_01234567890123456789",
"lastName": "Kerr",
"location": {
"address": "120 E 34th St, New York, NY 10016, USA",
"addressCity": "New York",
"addressCountry": "US",
"addressFirstLine": "120 E 34th St",
"addressSecondarynumber": null,
"addressState": "NY",
"addressZip": "10016",
"lat": 40.7463656,
"lng": -73.9803215
},
"name": "10392",
"operatingHours": {
"friday": {
"active": true,
"shifts": []
},
"monday": {
"active": true,
"shifts": []
},
"saturday": {
"active": true,
"shifts": []
},
"sunday": {
"active": true,
"shifts": []
},
"thursday": {
"active": true,
"shifts": []
},
"tuesday": {
"active": true,
"shifts": []
},
"wednesday": {
"active": true,
"shifts": []
}
},
"phoneNumber": "+16132525710",
"pickupInstructions": "",
"prepTimeMinutes": null,
"tags": []
}
],
"storeLocationAssociations": [
{
"endDate": "2025-01-01",
"startDate": "2024-01-01",
"storeLocationId": "stl_01234567890123456789"
}
],
"zoneRestrictions": [
{
"id": "res_01234567890123456789",
"name": "Zone Restriction 1"
}
],
"tags": [
"service:rapid",
"franchise_location"
],
"zoneMetadata": {
"key": "value"
},
"isDeleted": false
}[
{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"response_status": "<string>",
"RequestID": "<string>"
}
]Create a zone
Create a geographic zone defined by a polygon boundary. Zones are used to define delivery areas for store locations and apply zone-based restrictions.
curl --request POST \
--url https://api.sandbox.usenash.com/v1/zones \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"externalId": "<string>",
"name": "Zone 1",
"coverageAreaId": "<string>",
"polygon": [
[
37.7749,
-122.4194
],
[
37.8049,
-122.4194
],
[
37.8049,
-122.3894
],
[
37.7749,
-122.3894
],
[
37.7749,
-122.4194
]
],
"storeLocationIds": [
"stl_01234567890123456789",
"stl_01234567890123456789"
],
"storeLocationAssociations": [
{
"end_date": "2025-01-01",
"start_date": "2024-01-01",
"store_location_id": "stl_01234567890123456789"
}
],
"tags": "['service:rapid', 'service:express', 'franchise_location']",
"zoneMetadata": {
"key": "value"
}
}
EOFimport requests
url = "https://api.sandbox.usenash.com/v1/zones"
payload = {
"externalId": "<string>",
"name": "Zone 1",
"coverageAreaId": "<string>",
"polygon": [[37.7749, -122.4194], [37.8049, -122.4194], [37.8049, -122.3894], [37.7749, -122.3894], [37.7749, -122.4194]],
"storeLocationIds": ["stl_01234567890123456789", "stl_01234567890123456789"],
"storeLocationAssociations": [
{
"end_date": "2025-01-01",
"start_date": "2024-01-01",
"store_location_id": "stl_01234567890123456789"
}
],
"tags": "['service:rapid', 'service:express', 'franchise_location']",
"zoneMetadata": { "key": "value" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
externalId: '<string>',
name: 'Zone 1',
coverageAreaId: '<string>',
polygon: [
[37.7749, -122.4194],
[37.8049, -122.4194],
[37.8049, -122.3894],
[37.7749, -122.3894],
[37.7749, -122.4194]
],
storeLocationIds: ['stl_01234567890123456789', 'stl_01234567890123456789'],
storeLocationAssociations: [
{
end_date: '2025-01-01',
start_date: '2024-01-01',
store_location_id: 'stl_01234567890123456789'
}
],
tags: '[\'service:rapid\', \'service:express\', \'franchise_location\']',
zoneMetadata: {key: 'value'}
})
};
fetch('https://api.sandbox.usenash.com/v1/zones', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.usenash.com/v1/zones",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'externalId' => '<string>',
'name' => 'Zone 1',
'coverageAreaId' => '<string>',
'polygon' => [
[
37.7749,
-122.4194
],
[
37.8049,
-122.4194
],
[
37.8049,
-122.3894
],
[
37.7749,
-122.3894
],
[
37.7749,
-122.4194
]
],
'storeLocationIds' => [
'stl_01234567890123456789',
'stl_01234567890123456789'
],
'storeLocationAssociations' => [
[
'end_date' => '2025-01-01',
'start_date' => '2024-01-01',
'store_location_id' => 'stl_01234567890123456789'
]
],
'tags' => '[\'service:rapid\', \'service:express\', \'franchise_location\']',
'zoneMetadata' => [
'key' => 'value'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.usenash.com/v1/zones"
payload := strings.NewReader("{\n \"externalId\": \"<string>\",\n \"name\": \"Zone 1\",\n \"coverageAreaId\": \"<string>\",\n \"polygon\": [\n [\n 37.7749,\n -122.4194\n ],\n [\n 37.8049,\n -122.4194\n ],\n [\n 37.8049,\n -122.3894\n ],\n [\n 37.7749,\n -122.3894\n ],\n [\n 37.7749,\n -122.4194\n ]\n ],\n \"storeLocationIds\": [\n \"stl_01234567890123456789\",\n \"stl_01234567890123456789\"\n ],\n \"storeLocationAssociations\": [\n {\n \"end_date\": \"2025-01-01\",\n \"start_date\": \"2024-01-01\",\n \"store_location_id\": \"stl_01234567890123456789\"\n }\n ],\n \"tags\": \"['service:rapid', 'service:express', 'franchise_location']\",\n \"zoneMetadata\": {\n \"key\": \"value\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sandbox.usenash.com/v1/zones")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"externalId\": \"<string>\",\n \"name\": \"Zone 1\",\n \"coverageAreaId\": \"<string>\",\n \"polygon\": [\n [\n 37.7749,\n -122.4194\n ],\n [\n 37.8049,\n -122.4194\n ],\n [\n 37.8049,\n -122.3894\n ],\n [\n 37.7749,\n -122.3894\n ],\n [\n 37.7749,\n -122.4194\n ]\n ],\n \"storeLocationIds\": [\n \"stl_01234567890123456789\",\n \"stl_01234567890123456789\"\n ],\n \"storeLocationAssociations\": [\n {\n \"end_date\": \"2025-01-01\",\n \"start_date\": \"2024-01-01\",\n \"store_location_id\": \"stl_01234567890123456789\"\n }\n ],\n \"tags\": \"['service:rapid', 'service:express', 'franchise_location']\",\n \"zoneMetadata\": {\n \"key\": \"value\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.usenash.com/v1/zones")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"externalId\": \"<string>\",\n \"name\": \"Zone 1\",\n \"coverageAreaId\": \"<string>\",\n \"polygon\": [\n [\n 37.7749,\n -122.4194\n ],\n [\n 37.8049,\n -122.4194\n ],\n [\n 37.8049,\n -122.3894\n ],\n [\n 37.7749,\n -122.3894\n ],\n [\n 37.7749,\n -122.4194\n ]\n ],\n \"storeLocationIds\": [\n \"stl_01234567890123456789\",\n \"stl_01234567890123456789\"\n ],\n \"storeLocationAssociations\": [\n {\n \"end_date\": \"2025-01-01\",\n \"start_date\": \"2024-01-01\",\n \"store_location_id\": \"stl_01234567890123456789\"\n }\n ],\n \"tags\": \"['service:rapid', 'service:express', 'franchise_location']\",\n \"zoneMetadata\": {\n \"key\": \"value\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "zone_01234567890123456789",
"name": "Zone 1",
"externalId": "ext_01234567890123456789",
"portalUrl": "https://portal.usenash.com/settings/zones/zone_01234567890123456789",
"coverageArea": {
"cities": [
"San Francisco"
],
"cityZipcodes": [],
"countries": [],
"id": "coa_01234567890123456789",
"states": [],
"zipCodes": [
"94114"
]
},
"storeLocations": [
{
"blackoutDates": [],
"email": "",
"externalId": "ext_01234567890123456789",
"firstName": "Steve",
"id": "stl_01234567890123456789",
"lastName": "Kerr",
"location": {
"address": "120 E 34th St, New York, NY 10016, USA",
"addressCity": "New York",
"addressCountry": "US",
"addressFirstLine": "120 E 34th St",
"addressSecondarynumber": null,
"addressState": "NY",
"addressZip": "10016",
"lat": 40.7463656,
"lng": -73.9803215
},
"name": "10392",
"operatingHours": {
"friday": {
"active": true,
"shifts": []
},
"monday": {
"active": true,
"shifts": []
},
"saturday": {
"active": true,
"shifts": []
},
"sunday": {
"active": true,
"shifts": []
},
"thursday": {
"active": true,
"shifts": []
},
"tuesday": {
"active": true,
"shifts": []
},
"wednesday": {
"active": true,
"shifts": []
}
},
"phoneNumber": "+16132525710",
"pickupInstructions": "",
"prepTimeMinutes": null,
"tags": []
}
],
"storeLocationAssociations": [
{
"endDate": "2025-01-01",
"startDate": "2024-01-01",
"storeLocationId": "stl_01234567890123456789"
}
],
"zoneRestrictions": [
{
"id": "res_01234567890123456789",
"name": "Zone Restriction 1"
}
],
"tags": [
"service:rapid",
"franchise_location"
],
"zoneMetadata": {
"key": "value"
},
"isDeleted": false
}[
{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"response_status": "<string>",
"RequestID": "<string>"
}
]Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Expected payload for creating a zone.
Zone unique identifier from an external system.
The name of the zone.
"Zone 1"
The coverage area id to associate with the zone.
The zone boundary, as a single closed ring of [latitude, longitude] coordinate pairs. The first and last point must be identical to close the ring. Setting this creates a coverage area for the zone (or replaces the polygon on its existing coverage area).
[
[37.7749, -122.4194],
[37.8049, -122.4194],
[37.8049, -122.3894],
[37.7749, -122.3894],
[37.7749, -122.4194]
]
The store location ids to associate with the zone.
[
"stl_01234567890123456789",
"stl_01234567890123456789"
]
The store location associations to associate with the zone.
[
{
"end_date": "2025-01-01",
"start_date": "2024-01-01",
"store_location_id": "stl_01234567890123456789"
}
]
Free form tags specific to the location.
"['service:rapid', 'service:express', 'franchise_location']"
The metadata of the zone.
{ "key": "value" }
Response
OK
Response for zone.
The ID of the zone.
"zone_01234567890123456789"
The name of the zone.
"Zone 1"
The external ID of the zone.
"ext_01234567890123456789"
The portal URL of the zone.
"https://portal.usenash.com/settings/zones/zone_01234567890123456789"
The coverage area of the zone.
{
"cities": ["San Francisco"],
"cityZipcodes": [],
"countries": [],
"id": "coa_01234567890123456789",
"states": [],
"zipCodes": ["94114"]
}
The store locations of the zone.
Show child attributes
Show child attributes
[
{
"blackoutDates": [],
"email": "",
"externalId": "ext_01234567890123456789",
"firstName": "Steve",
"id": "stl_01234567890123456789",
"lastName": "Kerr",
"location": {
"address": "120 E 34th St, New York, NY 10016, USA",
"addressCity": "New York",
"addressCountry": "US",
"addressFirstLine": "120 E 34th St",
"addressSecondarynumber": null,
"addressState": "NY",
"addressZip": "10016",
"lat": 40.7463656,
"lng": -73.9803215
},
"name": "10392",
"operatingHours": {
"friday": { "active": true, "shifts": [] },
"monday": { "active": true, "shifts": [] },
"saturday": { "active": true, "shifts": [] },
"sunday": { "active": true, "shifts": [] },
"thursday": { "active": true, "shifts": [] },
"tuesday": { "active": true, "shifts": [] },
"wednesday": { "active": true, "shifts": [] }
},
"phoneNumber": "+16132525710",
"pickupInstructions": "",
"prepTimeMinutes": null,
"tags": []
}
]
The store location associations of the zone.
[
{
"endDate": "2025-01-01",
"startDate": "2024-01-01",
"storeLocationId": "stl_01234567890123456789"
}
]
The zone restrictions of the zone.
Show child attributes
Show child attributes
[
{
"id": "res_01234567890123456789",
"name": "Zone Restriction 1"
}
]
The tags of the zone.
["service:rapid", "franchise_location"]
The metadata of the zone.
{ "key": "value" }
Whether the zone is deleted.
false
Was this page helpful?