Create a single delivery window
curl --request POST \
--url https://api.sandbox.usenash.com/v1/delivery-window \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"startTime": "2024-01-01T10:00:00Z",
"startTimeLocal": "2024-01-01T10:00:00",
"endTime": "2024-01-01T12:00:00Z",
"endTimeLocal": "2024-01-01T12:00:00",
"cutoffTime": "2024-01-01T10:00:00Z",
"cutoffTimeLocal": "2024-01-01T10:00:00",
"timezoneId": "America/New_York",
"name": "Monday Delivery Window",
"rrule": "RRULE:FREQ=WEEKLY;BYDAY=MO",
"exceptionDates": [
"2024-01-01",
"2024-01-02"
],
"allowedTags": [
"service:rapid",
"service:express",
"franchise_location"
],
"leadTimeMinutes": 60,
"priceCents": 1000,
"minimumOrderValueCents": 1000,
"maximumCapacity": 1000,
"storeLocationId": "stl_01234567890123456789",
"zoneId": "zone_01234567890123456789",
"zoneExternalId": "ext_01234567890123456789",
"windowMetadata": {
"key": "value"
},
"isActive": true,
"isDeleted": false
}
'import requests
url = "https://api.sandbox.usenash.com/v1/delivery-window"
payload = {
"startTime": "2024-01-01T10:00:00Z",
"startTimeLocal": "2024-01-01T10:00:00",
"endTime": "2024-01-01T12:00:00Z",
"endTimeLocal": "2024-01-01T12:00:00",
"cutoffTime": "2024-01-01T10:00:00Z",
"cutoffTimeLocal": "2024-01-01T10:00:00",
"timezoneId": "America/New_York",
"name": "Monday Delivery Window",
"rrule": "RRULE:FREQ=WEEKLY;BYDAY=MO",
"exceptionDates": ["2024-01-01", "2024-01-02"],
"allowedTags": ["service:rapid", "service:express", "franchise_location"],
"leadTimeMinutes": 60,
"priceCents": 1000,
"minimumOrderValueCents": 1000,
"maximumCapacity": 1000,
"storeLocationId": "stl_01234567890123456789",
"zoneId": "zone_01234567890123456789",
"zoneExternalId": "ext_01234567890123456789",
"windowMetadata": { "key": "value" },
"isActive": True,
"isDeleted": False
}
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({
startTime: '2024-01-01T10:00:00Z',
startTimeLocal: '2024-01-01T10:00:00',
endTime: '2024-01-01T12:00:00Z',
endTimeLocal: '2024-01-01T12:00:00',
cutoffTime: '2024-01-01T10:00:00Z',
cutoffTimeLocal: '2024-01-01T10:00:00',
timezoneId: 'America/New_York',
name: 'Monday Delivery Window',
rrule: 'RRULE:FREQ=WEEKLY;BYDAY=MO',
exceptionDates: ['2024-01-01', '2024-01-02'],
allowedTags: ['service:rapid', 'service:express', 'franchise_location'],
leadTimeMinutes: 60,
priceCents: 1000,
minimumOrderValueCents: 1000,
maximumCapacity: 1000,
storeLocationId: 'stl_01234567890123456789',
zoneId: 'zone_01234567890123456789',
zoneExternalId: 'ext_01234567890123456789',
windowMetadata: {key: 'value'},
isActive: true,
isDeleted: false
})
};
fetch('https://api.sandbox.usenash.com/v1/delivery-window', 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/delivery-window",
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([
'startTime' => '2024-01-01T10:00:00Z',
'startTimeLocal' => '2024-01-01T10:00:00',
'endTime' => '2024-01-01T12:00:00Z',
'endTimeLocal' => '2024-01-01T12:00:00',
'cutoffTime' => '2024-01-01T10:00:00Z',
'cutoffTimeLocal' => '2024-01-01T10:00:00',
'timezoneId' => 'America/New_York',
'name' => 'Monday Delivery Window',
'rrule' => 'RRULE:FREQ=WEEKLY;BYDAY=MO',
'exceptionDates' => [
'2024-01-01',
'2024-01-02'
],
'allowedTags' => [
'service:rapid',
'service:express',
'franchise_location'
],
'leadTimeMinutes' => 60,
'priceCents' => 1000,
'minimumOrderValueCents' => 1000,
'maximumCapacity' => 1000,
'storeLocationId' => 'stl_01234567890123456789',
'zoneId' => 'zone_01234567890123456789',
'zoneExternalId' => 'ext_01234567890123456789',
'windowMetadata' => [
'key' => 'value'
],
'isActive' => true,
'isDeleted' => false
]),
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/delivery-window"
payload := strings.NewReader("{\n \"startTime\": \"2024-01-01T10:00:00Z\",\n \"startTimeLocal\": \"2024-01-01T10:00:00\",\n \"endTime\": \"2024-01-01T12:00:00Z\",\n \"endTimeLocal\": \"2024-01-01T12:00:00\",\n \"cutoffTime\": \"2024-01-01T10:00:00Z\",\n \"cutoffTimeLocal\": \"2024-01-01T10:00:00\",\n \"timezoneId\": \"America/New_York\",\n \"name\": \"Monday Delivery Window\",\n \"rrule\": \"RRULE:FREQ=WEEKLY;BYDAY=MO\",\n \"exceptionDates\": [\n \"2024-01-01\",\n \"2024-01-02\"\n ],\n \"allowedTags\": [\n \"service:rapid\",\n \"service:express\",\n \"franchise_location\"\n ],\n \"leadTimeMinutes\": 60,\n \"priceCents\": 1000,\n \"minimumOrderValueCents\": 1000,\n \"maximumCapacity\": 1000,\n \"storeLocationId\": \"stl_01234567890123456789\",\n \"zoneId\": \"zone_01234567890123456789\",\n \"zoneExternalId\": \"ext_01234567890123456789\",\n \"windowMetadata\": {\n \"key\": \"value\"\n },\n \"isActive\": true,\n \"isDeleted\": false\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/delivery-window")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"startTime\": \"2024-01-01T10:00:00Z\",\n \"startTimeLocal\": \"2024-01-01T10:00:00\",\n \"endTime\": \"2024-01-01T12:00:00Z\",\n \"endTimeLocal\": \"2024-01-01T12:00:00\",\n \"cutoffTime\": \"2024-01-01T10:00:00Z\",\n \"cutoffTimeLocal\": \"2024-01-01T10:00:00\",\n \"timezoneId\": \"America/New_York\",\n \"name\": \"Monday Delivery Window\",\n \"rrule\": \"RRULE:FREQ=WEEKLY;BYDAY=MO\",\n \"exceptionDates\": [\n \"2024-01-01\",\n \"2024-01-02\"\n ],\n \"allowedTags\": [\n \"service:rapid\",\n \"service:express\",\n \"franchise_location\"\n ],\n \"leadTimeMinutes\": 60,\n \"priceCents\": 1000,\n \"minimumOrderValueCents\": 1000,\n \"maximumCapacity\": 1000,\n \"storeLocationId\": \"stl_01234567890123456789\",\n \"zoneId\": \"zone_01234567890123456789\",\n \"zoneExternalId\": \"ext_01234567890123456789\",\n \"windowMetadata\": {\n \"key\": \"value\"\n },\n \"isActive\": true,\n \"isDeleted\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.usenash.com/v1/delivery-window")
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 \"startTime\": \"2024-01-01T10:00:00Z\",\n \"startTimeLocal\": \"2024-01-01T10:00:00\",\n \"endTime\": \"2024-01-01T12:00:00Z\",\n \"endTimeLocal\": \"2024-01-01T12:00:00\",\n \"cutoffTime\": \"2024-01-01T10:00:00Z\",\n \"cutoffTimeLocal\": \"2024-01-01T10:00:00\",\n \"timezoneId\": \"America/New_York\",\n \"name\": \"Monday Delivery Window\",\n \"rrule\": \"RRULE:FREQ=WEEKLY;BYDAY=MO\",\n \"exceptionDates\": [\n \"2024-01-01\",\n \"2024-01-02\"\n ],\n \"allowedTags\": [\n \"service:rapid\",\n \"service:express\",\n \"franchise_location\"\n ],\n \"leadTimeMinutes\": 60,\n \"priceCents\": 1000,\n \"minimumOrderValueCents\": 1000,\n \"maximumCapacity\": 1000,\n \"storeLocationId\": \"stl_01234567890123456789\",\n \"zoneId\": \"zone_01234567890123456789\",\n \"zoneExternalId\": \"ext_01234567890123456789\",\n \"windowMetadata\": {\n \"key\": \"value\"\n },\n \"isActive\": true,\n \"isDeleted\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "dw_01234567890123456789",
"name": "Monday Delivery Window",
"startTime": "2024-01-01T10:00:00Z",
"startTimeLocal": "2024-01-01T10:00:00",
"endTime": "2024-01-01T12:00:00Z",
"endTimeLocal": "2024-01-01T12:00:00",
"timezoneId": "America/New_York",
"cutoffTime": "2024-01-01T10:00:00Z",
"cutoffTimeLocal": "2024-01-01T10:00:00",
"rrule": "RRULE:FREQ=WEEKLY;BYDAY=MO",
"exceptionDates": [
"2024-01-01",
"2024-01-02"
],
"allowedTags": [
"service:rapid",
"service:express",
"franchise_location"
],
"leadTimeMinutes": 60,
"priceCents": 1000,
"minimumOrderValueCents": 1000,
"maximumCapacity": 1000,
"storeLocationId": "stl_01234567890123456789",
"zoneId": "zone_01234567890123456789",
"zoneExternalId": "ext_01234567890123456789",
"windowMetadata": {
"key": "value"
},
"isActive": true,
"isDeleted": false
}[
{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"response_status": "<string>",
"RequestID": "<string>"
}
]Create a single delivery window
Create a delivery window defining an available time slot for scheduled deliveries. Delivery windows are associated with a store location and have capacity limits.
POST
/
v1
/
delivery-window
Create a single delivery window
curl --request POST \
--url https://api.sandbox.usenash.com/v1/delivery-window \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"startTime": "2024-01-01T10:00:00Z",
"startTimeLocal": "2024-01-01T10:00:00",
"endTime": "2024-01-01T12:00:00Z",
"endTimeLocal": "2024-01-01T12:00:00",
"cutoffTime": "2024-01-01T10:00:00Z",
"cutoffTimeLocal": "2024-01-01T10:00:00",
"timezoneId": "America/New_York",
"name": "Monday Delivery Window",
"rrule": "RRULE:FREQ=WEEKLY;BYDAY=MO",
"exceptionDates": [
"2024-01-01",
"2024-01-02"
],
"allowedTags": [
"service:rapid",
"service:express",
"franchise_location"
],
"leadTimeMinutes": 60,
"priceCents": 1000,
"minimumOrderValueCents": 1000,
"maximumCapacity": 1000,
"storeLocationId": "stl_01234567890123456789",
"zoneId": "zone_01234567890123456789",
"zoneExternalId": "ext_01234567890123456789",
"windowMetadata": {
"key": "value"
},
"isActive": true,
"isDeleted": false
}
'import requests
url = "https://api.sandbox.usenash.com/v1/delivery-window"
payload = {
"startTime": "2024-01-01T10:00:00Z",
"startTimeLocal": "2024-01-01T10:00:00",
"endTime": "2024-01-01T12:00:00Z",
"endTimeLocal": "2024-01-01T12:00:00",
"cutoffTime": "2024-01-01T10:00:00Z",
"cutoffTimeLocal": "2024-01-01T10:00:00",
"timezoneId": "America/New_York",
"name": "Monday Delivery Window",
"rrule": "RRULE:FREQ=WEEKLY;BYDAY=MO",
"exceptionDates": ["2024-01-01", "2024-01-02"],
"allowedTags": ["service:rapid", "service:express", "franchise_location"],
"leadTimeMinutes": 60,
"priceCents": 1000,
"minimumOrderValueCents": 1000,
"maximumCapacity": 1000,
"storeLocationId": "stl_01234567890123456789",
"zoneId": "zone_01234567890123456789",
"zoneExternalId": "ext_01234567890123456789",
"windowMetadata": { "key": "value" },
"isActive": True,
"isDeleted": False
}
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({
startTime: '2024-01-01T10:00:00Z',
startTimeLocal: '2024-01-01T10:00:00',
endTime: '2024-01-01T12:00:00Z',
endTimeLocal: '2024-01-01T12:00:00',
cutoffTime: '2024-01-01T10:00:00Z',
cutoffTimeLocal: '2024-01-01T10:00:00',
timezoneId: 'America/New_York',
name: 'Monday Delivery Window',
rrule: 'RRULE:FREQ=WEEKLY;BYDAY=MO',
exceptionDates: ['2024-01-01', '2024-01-02'],
allowedTags: ['service:rapid', 'service:express', 'franchise_location'],
leadTimeMinutes: 60,
priceCents: 1000,
minimumOrderValueCents: 1000,
maximumCapacity: 1000,
storeLocationId: 'stl_01234567890123456789',
zoneId: 'zone_01234567890123456789',
zoneExternalId: 'ext_01234567890123456789',
windowMetadata: {key: 'value'},
isActive: true,
isDeleted: false
})
};
fetch('https://api.sandbox.usenash.com/v1/delivery-window', 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/delivery-window",
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([
'startTime' => '2024-01-01T10:00:00Z',
'startTimeLocal' => '2024-01-01T10:00:00',
'endTime' => '2024-01-01T12:00:00Z',
'endTimeLocal' => '2024-01-01T12:00:00',
'cutoffTime' => '2024-01-01T10:00:00Z',
'cutoffTimeLocal' => '2024-01-01T10:00:00',
'timezoneId' => 'America/New_York',
'name' => 'Monday Delivery Window',
'rrule' => 'RRULE:FREQ=WEEKLY;BYDAY=MO',
'exceptionDates' => [
'2024-01-01',
'2024-01-02'
],
'allowedTags' => [
'service:rapid',
'service:express',
'franchise_location'
],
'leadTimeMinutes' => 60,
'priceCents' => 1000,
'minimumOrderValueCents' => 1000,
'maximumCapacity' => 1000,
'storeLocationId' => 'stl_01234567890123456789',
'zoneId' => 'zone_01234567890123456789',
'zoneExternalId' => 'ext_01234567890123456789',
'windowMetadata' => [
'key' => 'value'
],
'isActive' => true,
'isDeleted' => false
]),
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/delivery-window"
payload := strings.NewReader("{\n \"startTime\": \"2024-01-01T10:00:00Z\",\n \"startTimeLocal\": \"2024-01-01T10:00:00\",\n \"endTime\": \"2024-01-01T12:00:00Z\",\n \"endTimeLocal\": \"2024-01-01T12:00:00\",\n \"cutoffTime\": \"2024-01-01T10:00:00Z\",\n \"cutoffTimeLocal\": \"2024-01-01T10:00:00\",\n \"timezoneId\": \"America/New_York\",\n \"name\": \"Monday Delivery Window\",\n \"rrule\": \"RRULE:FREQ=WEEKLY;BYDAY=MO\",\n \"exceptionDates\": [\n \"2024-01-01\",\n \"2024-01-02\"\n ],\n \"allowedTags\": [\n \"service:rapid\",\n \"service:express\",\n \"franchise_location\"\n ],\n \"leadTimeMinutes\": 60,\n \"priceCents\": 1000,\n \"minimumOrderValueCents\": 1000,\n \"maximumCapacity\": 1000,\n \"storeLocationId\": \"stl_01234567890123456789\",\n \"zoneId\": \"zone_01234567890123456789\",\n \"zoneExternalId\": \"ext_01234567890123456789\",\n \"windowMetadata\": {\n \"key\": \"value\"\n },\n \"isActive\": true,\n \"isDeleted\": false\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/delivery-window")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"startTime\": \"2024-01-01T10:00:00Z\",\n \"startTimeLocal\": \"2024-01-01T10:00:00\",\n \"endTime\": \"2024-01-01T12:00:00Z\",\n \"endTimeLocal\": \"2024-01-01T12:00:00\",\n \"cutoffTime\": \"2024-01-01T10:00:00Z\",\n \"cutoffTimeLocal\": \"2024-01-01T10:00:00\",\n \"timezoneId\": \"America/New_York\",\n \"name\": \"Monday Delivery Window\",\n \"rrule\": \"RRULE:FREQ=WEEKLY;BYDAY=MO\",\n \"exceptionDates\": [\n \"2024-01-01\",\n \"2024-01-02\"\n ],\n \"allowedTags\": [\n \"service:rapid\",\n \"service:express\",\n \"franchise_location\"\n ],\n \"leadTimeMinutes\": 60,\n \"priceCents\": 1000,\n \"minimumOrderValueCents\": 1000,\n \"maximumCapacity\": 1000,\n \"storeLocationId\": \"stl_01234567890123456789\",\n \"zoneId\": \"zone_01234567890123456789\",\n \"zoneExternalId\": \"ext_01234567890123456789\",\n \"windowMetadata\": {\n \"key\": \"value\"\n },\n \"isActive\": true,\n \"isDeleted\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.usenash.com/v1/delivery-window")
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 \"startTime\": \"2024-01-01T10:00:00Z\",\n \"startTimeLocal\": \"2024-01-01T10:00:00\",\n \"endTime\": \"2024-01-01T12:00:00Z\",\n \"endTimeLocal\": \"2024-01-01T12:00:00\",\n \"cutoffTime\": \"2024-01-01T10:00:00Z\",\n \"cutoffTimeLocal\": \"2024-01-01T10:00:00\",\n \"timezoneId\": \"America/New_York\",\n \"name\": \"Monday Delivery Window\",\n \"rrule\": \"RRULE:FREQ=WEEKLY;BYDAY=MO\",\n \"exceptionDates\": [\n \"2024-01-01\",\n \"2024-01-02\"\n ],\n \"allowedTags\": [\n \"service:rapid\",\n \"service:express\",\n \"franchise_location\"\n ],\n \"leadTimeMinutes\": 60,\n \"priceCents\": 1000,\n \"minimumOrderValueCents\": 1000,\n \"maximumCapacity\": 1000,\n \"storeLocationId\": \"stl_01234567890123456789\",\n \"zoneId\": \"zone_01234567890123456789\",\n \"zoneExternalId\": \"ext_01234567890123456789\",\n \"windowMetadata\": {\n \"key\": \"value\"\n },\n \"isActive\": true,\n \"isDeleted\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "dw_01234567890123456789",
"name": "Monday Delivery Window",
"startTime": "2024-01-01T10:00:00Z",
"startTimeLocal": "2024-01-01T10:00:00",
"endTime": "2024-01-01T12:00:00Z",
"endTimeLocal": "2024-01-01T12:00:00",
"timezoneId": "America/New_York",
"cutoffTime": "2024-01-01T10:00:00Z",
"cutoffTimeLocal": "2024-01-01T10:00:00",
"rrule": "RRULE:FREQ=WEEKLY;BYDAY=MO",
"exceptionDates": [
"2024-01-01",
"2024-01-02"
],
"allowedTags": [
"service:rapid",
"service:express",
"franchise_location"
],
"leadTimeMinutes": 60,
"priceCents": 1000,
"minimumOrderValueCents": 1000,
"maximumCapacity": 1000,
"storeLocationId": "stl_01234567890123456789",
"zoneId": "zone_01234567890123456789",
"zoneExternalId": "ext_01234567890123456789",
"windowMetadata": {
"key": "value"
},
"isActive": true,
"isDeleted": false
}[
{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"response_status": "<string>",
"RequestID": "<string>"
}
]Authorizations
Body
application/json
Expected payload for creating a delivery window.
Response
OK
Response for a delivery window.
Was this page helpful?