Skip to main content
POST
/
v1
/
zones
/
query
Query zones
curl --request POST \
  --url https://api.sandbox.usenash.com/v1/zones/query \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "externalIds": [
    "7810BBTORQ",
    "7810BBWAUR"
  ],
  "isDeleted": false,
  "offset": 0,
  "size": 100
}
'
import requests

url = "https://api.sandbox.usenash.com/v1/zones/query"

payload = {
    "externalIds": ["7810BBTORQ", "7810BBWAUR"],
    "isDeleted": False,
    "offset": 0,
    "size": 100
}
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({
    externalIds: ['7810BBTORQ', '7810BBWAUR'],
    isDeleted: false,
    offset: 0,
    size: 100
  })
};

fetch('https://api.sandbox.usenash.com/v1/zones/query', 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/query",
  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([
    'externalIds' => [
        '7810BBTORQ',
        '7810BBWAUR'
    ],
    'isDeleted' => false,
    'offset' => 0,
    'size' => 100
  ]),
  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/query"

	payload := strings.NewReader("{\n  \"externalIds\": [\n    \"7810BBTORQ\",\n    \"7810BBWAUR\"\n  ],\n  \"isDeleted\": false,\n  \"offset\": 0,\n  \"size\": 100\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/query")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"externalIds\": [\n    \"7810BBTORQ\",\n    \"7810BBWAUR\"\n  ],\n  \"isDeleted\": false,\n  \"offset\": 0,\n  \"size\": 100\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.sandbox.usenash.com/v1/zones/query")

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  \"externalIds\": [\n    \"7810BBTORQ\",\n    \"7810BBWAUR\"\n  ],\n  \"isDeleted\": false,\n  \"offset\": 0,\n  \"size\": 100\n}"

response = http.request(request)
puts response.read_body
{
  "data": [
    {
      "id": "<string>",
      "name": "<string>",
      "externalId": "<string>",
      "portalUrl": "<string>",
      "coverageArea": {
        "id": "<string>",
        "cityZipcodes": [
          "<string>"
        ],
        "zipCodes": [
          "<string>"
        ],
        "cities": [
          "<string>"
        ],
        "states": [
          "<string>"
        ],
        "countries": [
          "<string>"
        ],
        "polygons": [
          {
            "id": "<string>",
            "polygonData": [
              [
                123
              ]
            ]
          }
        ]
      },
      "storeLocations": [
        {
          "id": "<string>",
          "externalId": "<string>",
          "name": "<string>",
          "firstName": "<string>",
          "lastName": "<string>",
          "phoneNumber": "<string>",
          "email": "<string>",
          "pickupInstructions": "<string>",
          "prepTimeMinutes": 123,
          "blackoutDates": [
            "<string>"
          ],
          "operatingHours": {},
          "tags": [
            "<string>"
          ],
          "location": {
            "address": "<string>",
            "addressFirstLine": "<string>",
            "addressSecondarynumber": "<string>",
            "addressCity": "<string>",
            "addressCountry": "<string>",
            "addressState": "<string>",
            "addressZip": "<string>",
            "lat": 123,
            "lng": 123
          }
        }
      ],
      "storeLocationAssociations": [
        {
          "storeLocationId": "<string>",
          "startDate": "2023-11-07T05:31:56Z",
          "endDate": "2023-11-07T05:31:56Z"
        }
      ],
      "tags": [
        "<string>"
      ],
      "zoneMetadata": {},
      "isDeleted": true
    }
  ],
  "meta": {
    "total": 137,
    "size": 100,
    "offset": 0
  }
}
[
  {
    "error": {
      "code": "<string>",
      "message": "<string>",
      "details": {}
    },
    "response_status": "<string>",
    "RequestID": "<string>"
  }
]

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Body for POST /v1/zones/query.

ids and externalIds are optional and combined with OR. Omit both to page through every zone in the organization; a provided but empty list matches nothing.

ids
string[] | null

Nash zone ids to fetch (max 500). Combined with externalIds using OR. Omit to not filter by id; an empty list matches nothing.

Example:
["zone_BBVtiSryYx34xCskjb2WmA"]
externalIds
string[] | null

Your external zone ids to fetch (max 500). Combined with ids using OR. Omit to not filter by external id; an empty list matches nothing.

Example:
["7810BBTORQ"]
isDeleted
boolean
default:false

When true, return soft-deleted zones instead of active ones.

size
integer
default:100

Page size, 1 to 500. Requests above 500 return a ZONE_BULK_LIMIT_EXCEEDED error.

offset
integer
default:0

Number of zones to skip, for paging through the full result set.

Response

OK

Paginated zones, in created-at order. data items match GET /v1/zones/<id>.

data
ZoneDetailRead · object[]
required

Rows for this page, in a deterministic order.

meta
PageMeta · object
required

Pagination metadata.