curl --request POST \
--url https://api.sandbox.usenash.com/v1/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"orders": [
{
"externalId": "<string>",
"pickupAddress": "<string>",
"pickupPlaceId": "<string>",
"pickupPhoneNumber": "<string>",
"pickupBusinessName": "<string>",
"pickupFirstName": "<string>",
"pickupLastName": "<string>",
"pickupInstructions": "<string>",
"pickupStoreLocationId": "<string>",
"pickupExternalStoreLocationId": "<string>",
"pickupStoreLocationIds": [
"<string>"
],
"pickupZoneIds": [
"<string>"
],
"pickupBarcodes": [
"<string>"
],
"pickupEmail": "<string>",
"dropoffAddress": "<string>",
"dropoffPlaceId": "<string>",
"dropoffPhoneNumber": "<string>",
"dropoffBusinessName": "<string>",
"dropoffFirstName": "<string>",
"dropoffLastName": "<string>",
"dropoffInstructions": "<string>",
"dropoffBarcodes": [
"<string>"
],
"dropoffEmail": "<string>",
"deliveryMode": "<string>",
"pickupStartTime": "2023-11-07T05:31:56Z",
"pickupEndTime": "2023-11-07T05:31:56Z",
"dropoffStartTime": "2023-11-07T05:31:56Z",
"dropoffEndTime": "2023-11-07T05:31:56Z",
"deliveryWindowId": "<string>",
"description": "<string>",
"itemsCount": 123,
"currency": "<string>",
"valueCents": 123,
"tipAmountCents": 123,
"requirements": [
"photo_proof_of_delivery",
"age_verification_on_delivery"
],
"minimumVehicleSize": "car",
"dispatchStrategyId": "<string>",
"orderMetadata": {},
"tags": [
"<string>"
],
"referenceId": "<string>",
"pickupAddressNumber": "<string>",
"pickupAddressSecondarynumber": "<string>",
"pickupAddressFormattedStreet": "<string>",
"pickupAddressCity": "<string>",
"pickupAddressCounty": "<string>",
"pickupAddressState": "<string>",
"pickupAddressZip": "<string>",
"pickupAddressCountry": "<string>",
"pickupLat": 123,
"pickupLng": 123,
"dropoffAddressNumber": "<string>",
"dropoffAddressSecondarynumber": "<string>",
"dropoffAddressFormattedStreet": "<string>",
"dropoffAddressCity": "<string>",
"dropoffAddressCounty": "<string>",
"dropoffAddressState": "<string>",
"dropoffAddressZip": "<string>",
"dropoffAddressCountry": "<string>",
"dropoffLat": 123,
"dropoffLng": 123,
"weight": 123,
"height": 123,
"width": 123,
"depth": 123,
"items": [
{
"id": "abc-123",
"description": "A box of books",
"count": 2,
"dimensions": {
"depth": 14,
"height": 10,
"width": 12
},
"weight": 1.5,
"valueCents": 1000,
"requirements": [
"age_verification_on_delivery"
],
"category": "<string>",
"barcode": "0199312650999998913643M221872801002010908",
"metadata": {
"packaging_type": "CTN"
},
"subItems": [
{
"id": "abc-123",
"description": "A box of books",
"count": 2,
"dimensions": {
"depth": 14,
"height": 10,
"width": 12
},
"weight": 1.5,
"valueCents": 1000,
"requirements": [
"age_verification_on_delivery"
],
"category": "<string>",
"barcode": "0199312650999998913643M221872801002010908",
"metadata": {
"packaging_type": "CTN"
},
"sku": "<string>",
"substitution": {
"preference": "<string>",
"source": "<string>",
"substituteItems": [
{
"id": "<string>",
"sku": "<string>",
"quantity": 123
}
]
},
"subItems": "<unknown>"
}
]
}
],
"optimizationParameters": {
"pickupDoorstepTimeSeconds": 90,
"dropoffDoorstepTimeSeconds": 180,
"costsByMetric": {
"distance": 10,
"weight": 200
},
"clusterLabel": "<string>",
"mxLabel": "<string>",
"assignmentPriority": 1,
"sequencePriority": 249,
"sequenceGroup": "<string>"
},
"pickupPayment": {
"barcode": {
"type": "CODE128",
"value": "1234567890"
},
"providerCard": true
},
"reapplyAutomations": true,
"maxDeliveryFeeCents": 123
}
]
}
'import requests
url = "https://api.sandbox.usenash.com/v1/orders"
payload = { "orders": [
{
"externalId": "<string>",
"pickupAddress": "<string>",
"pickupPlaceId": "<string>",
"pickupPhoneNumber": "<string>",
"pickupBusinessName": "<string>",
"pickupFirstName": "<string>",
"pickupLastName": "<string>",
"pickupInstructions": "<string>",
"pickupStoreLocationId": "<string>",
"pickupExternalStoreLocationId": "<string>",
"pickupStoreLocationIds": ["<string>"],
"pickupZoneIds": ["<string>"],
"pickupBarcodes": ["<string>"],
"pickupEmail": "<string>",
"dropoffAddress": "<string>",
"dropoffPlaceId": "<string>",
"dropoffPhoneNumber": "<string>",
"dropoffBusinessName": "<string>",
"dropoffFirstName": "<string>",
"dropoffLastName": "<string>",
"dropoffInstructions": "<string>",
"dropoffBarcodes": ["<string>"],
"dropoffEmail": "<string>",
"deliveryMode": "<string>",
"pickupStartTime": "2023-11-07T05:31:56Z",
"pickupEndTime": "2023-11-07T05:31:56Z",
"dropoffStartTime": "2023-11-07T05:31:56Z",
"dropoffEndTime": "2023-11-07T05:31:56Z",
"deliveryWindowId": "<string>",
"description": "<string>",
"itemsCount": 123,
"currency": "<string>",
"valueCents": 123,
"tipAmountCents": 123,
"requirements": ["photo_proof_of_delivery", "age_verification_on_delivery"],
"minimumVehicleSize": "car",
"dispatchStrategyId": "<string>",
"orderMetadata": {},
"tags": ["<string>"],
"referenceId": "<string>",
"pickupAddressNumber": "<string>",
"pickupAddressSecondarynumber": "<string>",
"pickupAddressFormattedStreet": "<string>",
"pickupAddressCity": "<string>",
"pickupAddressCounty": "<string>",
"pickupAddressState": "<string>",
"pickupAddressZip": "<string>",
"pickupAddressCountry": "<string>",
"pickupLat": 123,
"pickupLng": 123,
"dropoffAddressNumber": "<string>",
"dropoffAddressSecondarynumber": "<string>",
"dropoffAddressFormattedStreet": "<string>",
"dropoffAddressCity": "<string>",
"dropoffAddressCounty": "<string>",
"dropoffAddressState": "<string>",
"dropoffAddressZip": "<string>",
"dropoffAddressCountry": "<string>",
"dropoffLat": 123,
"dropoffLng": 123,
"weight": 123,
"height": 123,
"width": 123,
"depth": 123,
"items": [
{
"id": "abc-123",
"description": "A box of books",
"count": 2,
"dimensions": {
"depth": 14,
"height": 10,
"width": 12
},
"weight": 1.5,
"valueCents": 1000,
"requirements": ["age_verification_on_delivery"],
"category": "<string>",
"barcode": "0199312650999998913643M221872801002010908",
"metadata": { "packaging_type": "CTN" },
"subItems": [
{
"id": "abc-123",
"description": "A box of books",
"count": 2,
"dimensions": {
"depth": 14,
"height": 10,
"width": 12
},
"weight": 1.5,
"valueCents": 1000,
"requirements": ["age_verification_on_delivery"],
"category": "<string>",
"barcode": "0199312650999998913643M221872801002010908",
"metadata": { "packaging_type": "CTN" },
"sku": "<string>",
"substitution": {
"preference": "<string>",
"source": "<string>",
"substituteItems": [
{
"id": "<string>",
"sku": "<string>",
"quantity": 123
}
]
},
"subItems": "<unknown>"
}
]
}
],
"optimizationParameters": {
"pickupDoorstepTimeSeconds": 90,
"dropoffDoorstepTimeSeconds": 180,
"costsByMetric": {
"distance": 10,
"weight": 200
},
"clusterLabel": "<string>",
"mxLabel": "<string>",
"assignmentPriority": 1,
"sequencePriority": 249,
"sequenceGroup": "<string>"
},
"pickupPayment": {
"barcode": {
"type": "CODE128",
"value": "1234567890"
},
"providerCard": True
},
"reapplyAutomations": True,
"maxDeliveryFeeCents": 123
}
] }
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({
orders: [
{
externalId: '<string>',
pickupAddress: '<string>',
pickupPlaceId: '<string>',
pickupPhoneNumber: '<string>',
pickupBusinessName: '<string>',
pickupFirstName: '<string>',
pickupLastName: '<string>',
pickupInstructions: '<string>',
pickupStoreLocationId: '<string>',
pickupExternalStoreLocationId: '<string>',
pickupStoreLocationIds: ['<string>'],
pickupZoneIds: ['<string>'],
pickupBarcodes: ['<string>'],
pickupEmail: '<string>',
dropoffAddress: '<string>',
dropoffPlaceId: '<string>',
dropoffPhoneNumber: '<string>',
dropoffBusinessName: '<string>',
dropoffFirstName: '<string>',
dropoffLastName: '<string>',
dropoffInstructions: '<string>',
dropoffBarcodes: ['<string>'],
dropoffEmail: '<string>',
deliveryMode: '<string>',
pickupStartTime: '2023-11-07T05:31:56Z',
pickupEndTime: '2023-11-07T05:31:56Z',
dropoffStartTime: '2023-11-07T05:31:56Z',
dropoffEndTime: '2023-11-07T05:31:56Z',
deliveryWindowId: '<string>',
description: '<string>',
itemsCount: 123,
currency: '<string>',
valueCents: 123,
tipAmountCents: 123,
requirements: ['photo_proof_of_delivery', 'age_verification_on_delivery'],
minimumVehicleSize: 'car',
dispatchStrategyId: '<string>',
orderMetadata: {},
tags: ['<string>'],
referenceId: '<string>',
pickupAddressNumber: '<string>',
pickupAddressSecondarynumber: '<string>',
pickupAddressFormattedStreet: '<string>',
pickupAddressCity: '<string>',
pickupAddressCounty: '<string>',
pickupAddressState: '<string>',
pickupAddressZip: '<string>',
pickupAddressCountry: '<string>',
pickupLat: 123,
pickupLng: 123,
dropoffAddressNumber: '<string>',
dropoffAddressSecondarynumber: '<string>',
dropoffAddressFormattedStreet: '<string>',
dropoffAddressCity: '<string>',
dropoffAddressCounty: '<string>',
dropoffAddressState: '<string>',
dropoffAddressZip: '<string>',
dropoffAddressCountry: '<string>',
dropoffLat: 123,
dropoffLng: 123,
weight: 123,
height: 123,
width: 123,
depth: 123,
items: [
{
id: 'abc-123',
description: 'A box of books',
count: 2,
dimensions: {depth: 14, height: 10, width: 12},
weight: 1.5,
valueCents: 1000,
requirements: ['age_verification_on_delivery'],
category: '<string>',
barcode: '0199312650999998913643M221872801002010908',
metadata: {packaging_type: 'CTN'},
subItems: [
{
id: 'abc-123',
description: 'A box of books',
count: 2,
dimensions: {depth: 14, height: 10, width: 12},
weight: 1.5,
valueCents: 1000,
requirements: ['age_verification_on_delivery'],
category: '<string>',
barcode: '0199312650999998913643M221872801002010908',
metadata: {packaging_type: 'CTN'},
sku: '<string>',
substitution: {
preference: '<string>',
source: '<string>',
substituteItems: [{id: '<string>', sku: '<string>', quantity: 123}]
},
subItems: '<unknown>'
}
]
}
],
optimizationParameters: {
pickupDoorstepTimeSeconds: 90,
dropoffDoorstepTimeSeconds: 180,
costsByMetric: {distance: 10, weight: 200},
clusterLabel: '<string>',
mxLabel: '<string>',
assignmentPriority: 1,
sequencePriority: 249,
sequenceGroup: '<string>'
},
pickupPayment: {barcode: {type: 'CODE128', value: '1234567890'}, providerCard: true},
reapplyAutomations: true,
maxDeliveryFeeCents: 123
}
]
})
};
fetch('https://api.sandbox.usenash.com/v1/orders', 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/orders",
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([
'orders' => [
[
'externalId' => '<string>',
'pickupAddress' => '<string>',
'pickupPlaceId' => '<string>',
'pickupPhoneNumber' => '<string>',
'pickupBusinessName' => '<string>',
'pickupFirstName' => '<string>',
'pickupLastName' => '<string>',
'pickupInstructions' => '<string>',
'pickupStoreLocationId' => '<string>',
'pickupExternalStoreLocationId' => '<string>',
'pickupStoreLocationIds' => [
'<string>'
],
'pickupZoneIds' => [
'<string>'
],
'pickupBarcodes' => [
'<string>'
],
'pickupEmail' => '<string>',
'dropoffAddress' => '<string>',
'dropoffPlaceId' => '<string>',
'dropoffPhoneNumber' => '<string>',
'dropoffBusinessName' => '<string>',
'dropoffFirstName' => '<string>',
'dropoffLastName' => '<string>',
'dropoffInstructions' => '<string>',
'dropoffBarcodes' => [
'<string>'
],
'dropoffEmail' => '<string>',
'deliveryMode' => '<string>',
'pickupStartTime' => '2023-11-07T05:31:56Z',
'pickupEndTime' => '2023-11-07T05:31:56Z',
'dropoffStartTime' => '2023-11-07T05:31:56Z',
'dropoffEndTime' => '2023-11-07T05:31:56Z',
'deliveryWindowId' => '<string>',
'description' => '<string>',
'itemsCount' => 123,
'currency' => '<string>',
'valueCents' => 123,
'tipAmountCents' => 123,
'requirements' => [
'photo_proof_of_delivery',
'age_verification_on_delivery'
],
'minimumVehicleSize' => 'car',
'dispatchStrategyId' => '<string>',
'orderMetadata' => [
],
'tags' => [
'<string>'
],
'referenceId' => '<string>',
'pickupAddressNumber' => '<string>',
'pickupAddressSecondarynumber' => '<string>',
'pickupAddressFormattedStreet' => '<string>',
'pickupAddressCity' => '<string>',
'pickupAddressCounty' => '<string>',
'pickupAddressState' => '<string>',
'pickupAddressZip' => '<string>',
'pickupAddressCountry' => '<string>',
'pickupLat' => 123,
'pickupLng' => 123,
'dropoffAddressNumber' => '<string>',
'dropoffAddressSecondarynumber' => '<string>',
'dropoffAddressFormattedStreet' => '<string>',
'dropoffAddressCity' => '<string>',
'dropoffAddressCounty' => '<string>',
'dropoffAddressState' => '<string>',
'dropoffAddressZip' => '<string>',
'dropoffAddressCountry' => '<string>',
'dropoffLat' => 123,
'dropoffLng' => 123,
'weight' => 123,
'height' => 123,
'width' => 123,
'depth' => 123,
'items' => [
[
'id' => 'abc-123',
'description' => 'A box of books',
'count' => 2,
'dimensions' => [
'depth' => 14,
'height' => 10,
'width' => 12
],
'weight' => 1.5,
'valueCents' => 1000,
'requirements' => [
'age_verification_on_delivery'
],
'category' => '<string>',
'barcode' => '0199312650999998913643M221872801002010908',
'metadata' => [
'packaging_type' => 'CTN'
],
'subItems' => [
[
'id' => 'abc-123',
'description' => 'A box of books',
'count' => 2,
'dimensions' => [
'depth' => 14,
'height' => 10,
'width' => 12
],
'weight' => 1.5,
'valueCents' => 1000,
'requirements' => [
'age_verification_on_delivery'
],
'category' => '<string>',
'barcode' => '0199312650999998913643M221872801002010908',
'metadata' => [
'packaging_type' => 'CTN'
],
'sku' => '<string>',
'substitution' => [
'preference' => '<string>',
'source' => '<string>',
'substituteItems' => [
[
'id' => '<string>',
'sku' => '<string>',
'quantity' => 123
]
]
],
'subItems' => '<unknown>'
]
]
]
],
'optimizationParameters' => [
'pickupDoorstepTimeSeconds' => 90,
'dropoffDoorstepTimeSeconds' => 180,
'costsByMetric' => [
'distance' => 10,
'weight' => 200
],
'clusterLabel' => '<string>',
'mxLabel' => '<string>',
'assignmentPriority' => 1,
'sequencePriority' => 249,
'sequenceGroup' => '<string>'
],
'pickupPayment' => [
'barcode' => [
'type' => 'CODE128',
'value' => '1234567890'
],
'providerCard' => true
],
'reapplyAutomations' => true,
'maxDeliveryFeeCents' => 123
]
]
]),
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/orders"
payload := strings.NewReader("{\n \"orders\": [\n {\n \"externalId\": \"<string>\",\n \"pickupAddress\": \"<string>\",\n \"pickupPlaceId\": \"<string>\",\n \"pickupPhoneNumber\": \"<string>\",\n \"pickupBusinessName\": \"<string>\",\n \"pickupFirstName\": \"<string>\",\n \"pickupLastName\": \"<string>\",\n \"pickupInstructions\": \"<string>\",\n \"pickupStoreLocationId\": \"<string>\",\n \"pickupExternalStoreLocationId\": \"<string>\",\n \"pickupStoreLocationIds\": [\n \"<string>\"\n ],\n \"pickupZoneIds\": [\n \"<string>\"\n ],\n \"pickupBarcodes\": [\n \"<string>\"\n ],\n \"pickupEmail\": \"<string>\",\n \"dropoffAddress\": \"<string>\",\n \"dropoffPlaceId\": \"<string>\",\n \"dropoffPhoneNumber\": \"<string>\",\n \"dropoffBusinessName\": \"<string>\",\n \"dropoffFirstName\": \"<string>\",\n \"dropoffLastName\": \"<string>\",\n \"dropoffInstructions\": \"<string>\",\n \"dropoffBarcodes\": [\n \"<string>\"\n ],\n \"dropoffEmail\": \"<string>\",\n \"deliveryMode\": \"<string>\",\n \"pickupStartTime\": \"2023-11-07T05:31:56Z\",\n \"pickupEndTime\": \"2023-11-07T05:31:56Z\",\n \"dropoffStartTime\": \"2023-11-07T05:31:56Z\",\n \"dropoffEndTime\": \"2023-11-07T05:31:56Z\",\n \"deliveryWindowId\": \"<string>\",\n \"description\": \"<string>\",\n \"itemsCount\": 123,\n \"currency\": \"<string>\",\n \"valueCents\": 123,\n \"tipAmountCents\": 123,\n \"requirements\": [\n \"photo_proof_of_delivery\",\n \"age_verification_on_delivery\"\n ],\n \"minimumVehicleSize\": \"car\",\n \"dispatchStrategyId\": \"<string>\",\n \"orderMetadata\": {},\n \"tags\": [\n \"<string>\"\n ],\n \"referenceId\": \"<string>\",\n \"pickupAddressNumber\": \"<string>\",\n \"pickupAddressSecondarynumber\": \"<string>\",\n \"pickupAddressFormattedStreet\": \"<string>\",\n \"pickupAddressCity\": \"<string>\",\n \"pickupAddressCounty\": \"<string>\",\n \"pickupAddressState\": \"<string>\",\n \"pickupAddressZip\": \"<string>\",\n \"pickupAddressCountry\": \"<string>\",\n \"pickupLat\": 123,\n \"pickupLng\": 123,\n \"dropoffAddressNumber\": \"<string>\",\n \"dropoffAddressSecondarynumber\": \"<string>\",\n \"dropoffAddressFormattedStreet\": \"<string>\",\n \"dropoffAddressCity\": \"<string>\",\n \"dropoffAddressCounty\": \"<string>\",\n \"dropoffAddressState\": \"<string>\",\n \"dropoffAddressZip\": \"<string>\",\n \"dropoffAddressCountry\": \"<string>\",\n \"dropoffLat\": 123,\n \"dropoffLng\": 123,\n \"weight\": 123,\n \"height\": 123,\n \"width\": 123,\n \"depth\": 123,\n \"items\": [\n {\n \"id\": \"abc-123\",\n \"description\": \"A box of books\",\n \"count\": 2,\n \"dimensions\": {\n \"depth\": 14,\n \"height\": 10,\n \"width\": 12\n },\n \"weight\": 1.5,\n \"valueCents\": 1000,\n \"requirements\": [\n \"age_verification_on_delivery\"\n ],\n \"category\": \"<string>\",\n \"barcode\": \"0199312650999998913643M221872801002010908\",\n \"metadata\": {\n \"packaging_type\": \"CTN\"\n },\n \"subItems\": [\n {\n \"id\": \"abc-123\",\n \"description\": \"A box of books\",\n \"count\": 2,\n \"dimensions\": {\n \"depth\": 14,\n \"height\": 10,\n \"width\": 12\n },\n \"weight\": 1.5,\n \"valueCents\": 1000,\n \"requirements\": [\n \"age_verification_on_delivery\"\n ],\n \"category\": \"<string>\",\n \"barcode\": \"0199312650999998913643M221872801002010908\",\n \"metadata\": {\n \"packaging_type\": \"CTN\"\n },\n \"sku\": \"<string>\",\n \"substitution\": {\n \"preference\": \"<string>\",\n \"source\": \"<string>\",\n \"substituteItems\": [\n {\n \"id\": \"<string>\",\n \"sku\": \"<string>\",\n \"quantity\": 123\n }\n ]\n },\n \"subItems\": \"<unknown>\"\n }\n ]\n }\n ],\n \"optimizationParameters\": {\n \"pickupDoorstepTimeSeconds\": 90,\n \"dropoffDoorstepTimeSeconds\": 180,\n \"costsByMetric\": {\n \"distance\": 10,\n \"weight\": 200\n },\n \"clusterLabel\": \"<string>\",\n \"mxLabel\": \"<string>\",\n \"assignmentPriority\": 1,\n \"sequencePriority\": 249,\n \"sequenceGroup\": \"<string>\"\n },\n \"pickupPayment\": {\n \"barcode\": {\n \"type\": \"CODE128\",\n \"value\": \"1234567890\"\n },\n \"providerCard\": true\n },\n \"reapplyAutomations\": true,\n \"maxDeliveryFeeCents\": 123\n }\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/orders")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"orders\": [\n {\n \"externalId\": \"<string>\",\n \"pickupAddress\": \"<string>\",\n \"pickupPlaceId\": \"<string>\",\n \"pickupPhoneNumber\": \"<string>\",\n \"pickupBusinessName\": \"<string>\",\n \"pickupFirstName\": \"<string>\",\n \"pickupLastName\": \"<string>\",\n \"pickupInstructions\": \"<string>\",\n \"pickupStoreLocationId\": \"<string>\",\n \"pickupExternalStoreLocationId\": \"<string>\",\n \"pickupStoreLocationIds\": [\n \"<string>\"\n ],\n \"pickupZoneIds\": [\n \"<string>\"\n ],\n \"pickupBarcodes\": [\n \"<string>\"\n ],\n \"pickupEmail\": \"<string>\",\n \"dropoffAddress\": \"<string>\",\n \"dropoffPlaceId\": \"<string>\",\n \"dropoffPhoneNumber\": \"<string>\",\n \"dropoffBusinessName\": \"<string>\",\n \"dropoffFirstName\": \"<string>\",\n \"dropoffLastName\": \"<string>\",\n \"dropoffInstructions\": \"<string>\",\n \"dropoffBarcodes\": [\n \"<string>\"\n ],\n \"dropoffEmail\": \"<string>\",\n \"deliveryMode\": \"<string>\",\n \"pickupStartTime\": \"2023-11-07T05:31:56Z\",\n \"pickupEndTime\": \"2023-11-07T05:31:56Z\",\n \"dropoffStartTime\": \"2023-11-07T05:31:56Z\",\n \"dropoffEndTime\": \"2023-11-07T05:31:56Z\",\n \"deliveryWindowId\": \"<string>\",\n \"description\": \"<string>\",\n \"itemsCount\": 123,\n \"currency\": \"<string>\",\n \"valueCents\": 123,\n \"tipAmountCents\": 123,\n \"requirements\": [\n \"photo_proof_of_delivery\",\n \"age_verification_on_delivery\"\n ],\n \"minimumVehicleSize\": \"car\",\n \"dispatchStrategyId\": \"<string>\",\n \"orderMetadata\": {},\n \"tags\": [\n \"<string>\"\n ],\n \"referenceId\": \"<string>\",\n \"pickupAddressNumber\": \"<string>\",\n \"pickupAddressSecondarynumber\": \"<string>\",\n \"pickupAddressFormattedStreet\": \"<string>\",\n \"pickupAddressCity\": \"<string>\",\n \"pickupAddressCounty\": \"<string>\",\n \"pickupAddressState\": \"<string>\",\n \"pickupAddressZip\": \"<string>\",\n \"pickupAddressCountry\": \"<string>\",\n \"pickupLat\": 123,\n \"pickupLng\": 123,\n \"dropoffAddressNumber\": \"<string>\",\n \"dropoffAddressSecondarynumber\": \"<string>\",\n \"dropoffAddressFormattedStreet\": \"<string>\",\n \"dropoffAddressCity\": \"<string>\",\n \"dropoffAddressCounty\": \"<string>\",\n \"dropoffAddressState\": \"<string>\",\n \"dropoffAddressZip\": \"<string>\",\n \"dropoffAddressCountry\": \"<string>\",\n \"dropoffLat\": 123,\n \"dropoffLng\": 123,\n \"weight\": 123,\n \"height\": 123,\n \"width\": 123,\n \"depth\": 123,\n \"items\": [\n {\n \"id\": \"abc-123\",\n \"description\": \"A box of books\",\n \"count\": 2,\n \"dimensions\": {\n \"depth\": 14,\n \"height\": 10,\n \"width\": 12\n },\n \"weight\": 1.5,\n \"valueCents\": 1000,\n \"requirements\": [\n \"age_verification_on_delivery\"\n ],\n \"category\": \"<string>\",\n \"barcode\": \"0199312650999998913643M221872801002010908\",\n \"metadata\": {\n \"packaging_type\": \"CTN\"\n },\n \"subItems\": [\n {\n \"id\": \"abc-123\",\n \"description\": \"A box of books\",\n \"count\": 2,\n \"dimensions\": {\n \"depth\": 14,\n \"height\": 10,\n \"width\": 12\n },\n \"weight\": 1.5,\n \"valueCents\": 1000,\n \"requirements\": [\n \"age_verification_on_delivery\"\n ],\n \"category\": \"<string>\",\n \"barcode\": \"0199312650999998913643M221872801002010908\",\n \"metadata\": {\n \"packaging_type\": \"CTN\"\n },\n \"sku\": \"<string>\",\n \"substitution\": {\n \"preference\": \"<string>\",\n \"source\": \"<string>\",\n \"substituteItems\": [\n {\n \"id\": \"<string>\",\n \"sku\": \"<string>\",\n \"quantity\": 123\n }\n ]\n },\n \"subItems\": \"<unknown>\"\n }\n ]\n }\n ],\n \"optimizationParameters\": {\n \"pickupDoorstepTimeSeconds\": 90,\n \"dropoffDoorstepTimeSeconds\": 180,\n \"costsByMetric\": {\n \"distance\": 10,\n \"weight\": 200\n },\n \"clusterLabel\": \"<string>\",\n \"mxLabel\": \"<string>\",\n \"assignmentPriority\": 1,\n \"sequencePriority\": 249,\n \"sequenceGroup\": \"<string>\"\n },\n \"pickupPayment\": {\n \"barcode\": {\n \"type\": \"CODE128\",\n \"value\": \"1234567890\"\n },\n \"providerCard\": true\n },\n \"reapplyAutomations\": true,\n \"maxDeliveryFeeCents\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.usenash.com/v1/orders")
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 \"orders\": [\n {\n \"externalId\": \"<string>\",\n \"pickupAddress\": \"<string>\",\n \"pickupPlaceId\": \"<string>\",\n \"pickupPhoneNumber\": \"<string>\",\n \"pickupBusinessName\": \"<string>\",\n \"pickupFirstName\": \"<string>\",\n \"pickupLastName\": \"<string>\",\n \"pickupInstructions\": \"<string>\",\n \"pickupStoreLocationId\": \"<string>\",\n \"pickupExternalStoreLocationId\": \"<string>\",\n \"pickupStoreLocationIds\": [\n \"<string>\"\n ],\n \"pickupZoneIds\": [\n \"<string>\"\n ],\n \"pickupBarcodes\": [\n \"<string>\"\n ],\n \"pickupEmail\": \"<string>\",\n \"dropoffAddress\": \"<string>\",\n \"dropoffPlaceId\": \"<string>\",\n \"dropoffPhoneNumber\": \"<string>\",\n \"dropoffBusinessName\": \"<string>\",\n \"dropoffFirstName\": \"<string>\",\n \"dropoffLastName\": \"<string>\",\n \"dropoffInstructions\": \"<string>\",\n \"dropoffBarcodes\": [\n \"<string>\"\n ],\n \"dropoffEmail\": \"<string>\",\n \"deliveryMode\": \"<string>\",\n \"pickupStartTime\": \"2023-11-07T05:31:56Z\",\n \"pickupEndTime\": \"2023-11-07T05:31:56Z\",\n \"dropoffStartTime\": \"2023-11-07T05:31:56Z\",\n \"dropoffEndTime\": \"2023-11-07T05:31:56Z\",\n \"deliveryWindowId\": \"<string>\",\n \"description\": \"<string>\",\n \"itemsCount\": 123,\n \"currency\": \"<string>\",\n \"valueCents\": 123,\n \"tipAmountCents\": 123,\n \"requirements\": [\n \"photo_proof_of_delivery\",\n \"age_verification_on_delivery\"\n ],\n \"minimumVehicleSize\": \"car\",\n \"dispatchStrategyId\": \"<string>\",\n \"orderMetadata\": {},\n \"tags\": [\n \"<string>\"\n ],\n \"referenceId\": \"<string>\",\n \"pickupAddressNumber\": \"<string>\",\n \"pickupAddressSecondarynumber\": \"<string>\",\n \"pickupAddressFormattedStreet\": \"<string>\",\n \"pickupAddressCity\": \"<string>\",\n \"pickupAddressCounty\": \"<string>\",\n \"pickupAddressState\": \"<string>\",\n \"pickupAddressZip\": \"<string>\",\n \"pickupAddressCountry\": \"<string>\",\n \"pickupLat\": 123,\n \"pickupLng\": 123,\n \"dropoffAddressNumber\": \"<string>\",\n \"dropoffAddressSecondarynumber\": \"<string>\",\n \"dropoffAddressFormattedStreet\": \"<string>\",\n \"dropoffAddressCity\": \"<string>\",\n \"dropoffAddressCounty\": \"<string>\",\n \"dropoffAddressState\": \"<string>\",\n \"dropoffAddressZip\": \"<string>\",\n \"dropoffAddressCountry\": \"<string>\",\n \"dropoffLat\": 123,\n \"dropoffLng\": 123,\n \"weight\": 123,\n \"height\": 123,\n \"width\": 123,\n \"depth\": 123,\n \"items\": [\n {\n \"id\": \"abc-123\",\n \"description\": \"A box of books\",\n \"count\": 2,\n \"dimensions\": {\n \"depth\": 14,\n \"height\": 10,\n \"width\": 12\n },\n \"weight\": 1.5,\n \"valueCents\": 1000,\n \"requirements\": [\n \"age_verification_on_delivery\"\n ],\n \"category\": \"<string>\",\n \"barcode\": \"0199312650999998913643M221872801002010908\",\n \"metadata\": {\n \"packaging_type\": \"CTN\"\n },\n \"subItems\": [\n {\n \"id\": \"abc-123\",\n \"description\": \"A box of books\",\n \"count\": 2,\n \"dimensions\": {\n \"depth\": 14,\n \"height\": 10,\n \"width\": 12\n },\n \"weight\": 1.5,\n \"valueCents\": 1000,\n \"requirements\": [\n \"age_verification_on_delivery\"\n ],\n \"category\": \"<string>\",\n \"barcode\": \"0199312650999998913643M221872801002010908\",\n \"metadata\": {\n \"packaging_type\": \"CTN\"\n },\n \"sku\": \"<string>\",\n \"substitution\": {\n \"preference\": \"<string>\",\n \"source\": \"<string>\",\n \"substituteItems\": [\n {\n \"id\": \"<string>\",\n \"sku\": \"<string>\",\n \"quantity\": 123\n }\n ]\n },\n \"subItems\": \"<unknown>\"\n }\n ]\n }\n ],\n \"optimizationParameters\": {\n \"pickupDoorstepTimeSeconds\": 90,\n \"dropoffDoorstepTimeSeconds\": 180,\n \"costsByMetric\": {\n \"distance\": 10,\n \"weight\": 200\n },\n \"clusterLabel\": \"<string>\",\n \"mxLabel\": \"<string>\",\n \"assignmentPriority\": 1,\n \"sequencePriority\": 249,\n \"sequenceGroup\": \"<string>\"\n },\n \"pickupPayment\": {\n \"barcode\": {\n \"type\": \"CODE128\",\n \"value\": \"1234567890\"\n },\n \"providerCard\": true\n },\n \"reapplyAutomations\": true,\n \"maxDeliveryFeeCents\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body[
{
"id": "ord_1234567890",
"createdAt": "2023-08-29T19:17:46.264523",
"portalUrl": "https://portal.dev.usenash.com/orders/ord_1234567890",
"publicTrackingUrl": "https://tracking.dev.usenash.com/ord_1234567890",
"status": "needs_attention",
"tags": [
"REST_API"
],
"externalId": "1234567890",
"externalGroupId": "1234567890",
"referenceId": "1234567890",
"orderMetadata": {
"key": "value"
},
"pickupAddress": "185 University Ave, Palo Alto, CA 94301",
"pickupPlaceId": "ChIJd8BlQJq3t4kRUKhH43CQ",
"pickupAddressNumber": "185",
"pickupAddressSecondarynumber": "<string>",
"pickupAddressFormattedStreet": "University Ave",
"pickupAddressCity": "Palo Alto",
"pickupAddressCounty": "Santa Clara",
"pickupAddressState": "CA",
"pickupAddressZip": "94301",
"pickupAddressCountry": "US",
"pickupLat": 37.422222,
"pickupLng": -122.139776,
"pickupPhoneNumber": "+15555555555",
"pickupFirstName": "Manager",
"pickupLastName": "Manager",
"pickupBusinessName": "Store ABC",
"pickupInstructions": "Leave at the front door",
"pickupStoreLocationId": "stl_VwpoPJaaqWiPGnXEhWfX",
"pickupExternalStoreLocationId": "0021112",
"pickupZoneIds": [
"<string>"
],
"pickupBarcodes": [
"1234567890",
"0987654321"
],
"pickupPayment": {
"barcode": {
"type": "CODE128",
"value": "1234567890"
},
"providerCard": false
},
"dropoffAddress": "401 San Antonio Rd, Mountain View, CA 94040",
"dropoffPlaceId": "ChIJd8BlQJq3t4kRUKhH43CQ",
"dropoffAddressNumber": "401",
"dropoffAddressSecondarynumber": "<string>",
"dropoffAddressFormattedStreet": "San Antonio Rd",
"dropoffAddressCity": "Mountain View",
"dropoffAddressCounty": "Santa Clara",
"dropoffAddressState": "CA",
"dropoffAddressZip": "94040",
"dropoffAddressCountry": "US",
"dropoffLat": 37.422222,
"dropoffLng": -122.139776,
"dropoffPhoneNumber": "+15555555556",
"dropoffFirstName": "Quote",
"dropoffLastName": "Request",
"dropoffBusinessName": "<string>",
"dropoffInstructions": "Leave at the front door",
"dropoffStoreLocationId": "<string>",
"dropoffBarcodes": [
"<string>"
],
"deliveryMode": "scheduled",
"pickupStartTime": "2024-08-22T23:54:08Z",
"pickupEndTime": "2024-08-22T23:54:08Z",
"dropoffStartTime": "2024-08-22T23:54:08Z",
"dropoffEndTime": "2024-08-22T23:54:08Z",
"description": "Order description",
"itemsCount": "1",
"requirements": [
"photo_proof_of_delivery"
],
"minimumVehicleSize": "car",
"currency": "USD",
"valueCents": "10000",
"tipAmountCents": "1000",
"width": "100",
"depth": "100",
"height": "100",
"volume": "<string>",
"weight": "100",
"items": [
{
"id": "abc-123",
"description": "A box of books",
"count": 2,
"dimensions": {
"depth": 14,
"height": 10,
"width": 12
},
"weight": 1.5,
"valueCents": 1000,
"requirements": [
"age_verification_on_delivery"
],
"category": "<string>",
"barcode": "0199312650999998913643M221872801002010908",
"metadata": {
"packaging_type": "CTN"
},
"subItems": [
{
"id": "abc-123",
"description": "A box of books",
"count": 2,
"dimensions": {
"depth": 14,
"height": 10,
"width": 12
},
"weight": 1.5,
"valueCents": 1000,
"requirements": [
"age_verification_on_delivery"
],
"category": "<string>",
"barcode": "0199312650999998913643M221872801002010908",
"metadata": {
"packaging_type": "CTN"
},
"sku": "<string>",
"substitution": {
"preference": "<string>",
"source": "<string>",
"substituteItems": [
{
"id": "<string>",
"sku": "<string>",
"quantity": 123
}
]
},
"subItems": "<unknown>"
}
]
}
],
"dispatchStrategyId": "dss_1234567890",
"maxDeliveryFeeCents": "1000",
"documents": [
{
"contentType": "application/pdf",
"data": "SGVsbG8gd29ybGQ=",
"id": "doc_1234567890",
"type": "shipping_label",
"url": "https://example.com/document.pdf"
}
],
"validationErrors": {
"pickupStartTime": "Time is in the past"
},
"quotes": [
{
"costSplitBusinessCents": null,
"costSplitCustomerCents": null,
"createdTime": "2024-09-03T20:43:45.899094",
"currency": "USD",
"dropoffEta": "2024-09-03T22:20:47.569000",
"expireTime": "2024-09-03T21:43:45.899102",
"id": "qot_2oWASjGxMtucwGgu6A7BYC",
"insuranceFeeCents": 0,
"nashFeeCents": 300,
"pickupWindow": null,
"priceCents": 100,
"providerId": "dispatch_partner",
"providerIsInternal": false,
"providerLogo": "https://nash-provider-logos.s3.amazonaws.com/dispatchit-logo.jpg",
"providerName": "Dispatch",
"tags": null,
"taxAmountCents": null,
"tollFeeCents": 0,
"totalPriceBreakdown": {
"priceCents": 100
},
"totalPriceCents": 100,
"type": "LOCAL"
}
],
"failedQuotes": [
"quote_1234567890",
"quote_0987654321"
]
}
][
{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"response_status": "<string>",
"RequestID": "<string>"
}
]Create Orders
Create multiple pre-dispatch orders in a single request. Each order is created independently with its own pickup and dropoff details.
curl --request POST \
--url https://api.sandbox.usenash.com/v1/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"orders": [
{
"externalId": "<string>",
"pickupAddress": "<string>",
"pickupPlaceId": "<string>",
"pickupPhoneNumber": "<string>",
"pickupBusinessName": "<string>",
"pickupFirstName": "<string>",
"pickupLastName": "<string>",
"pickupInstructions": "<string>",
"pickupStoreLocationId": "<string>",
"pickupExternalStoreLocationId": "<string>",
"pickupStoreLocationIds": [
"<string>"
],
"pickupZoneIds": [
"<string>"
],
"pickupBarcodes": [
"<string>"
],
"pickupEmail": "<string>",
"dropoffAddress": "<string>",
"dropoffPlaceId": "<string>",
"dropoffPhoneNumber": "<string>",
"dropoffBusinessName": "<string>",
"dropoffFirstName": "<string>",
"dropoffLastName": "<string>",
"dropoffInstructions": "<string>",
"dropoffBarcodes": [
"<string>"
],
"dropoffEmail": "<string>",
"deliveryMode": "<string>",
"pickupStartTime": "2023-11-07T05:31:56Z",
"pickupEndTime": "2023-11-07T05:31:56Z",
"dropoffStartTime": "2023-11-07T05:31:56Z",
"dropoffEndTime": "2023-11-07T05:31:56Z",
"deliveryWindowId": "<string>",
"description": "<string>",
"itemsCount": 123,
"currency": "<string>",
"valueCents": 123,
"tipAmountCents": 123,
"requirements": [
"photo_proof_of_delivery",
"age_verification_on_delivery"
],
"minimumVehicleSize": "car",
"dispatchStrategyId": "<string>",
"orderMetadata": {},
"tags": [
"<string>"
],
"referenceId": "<string>",
"pickupAddressNumber": "<string>",
"pickupAddressSecondarynumber": "<string>",
"pickupAddressFormattedStreet": "<string>",
"pickupAddressCity": "<string>",
"pickupAddressCounty": "<string>",
"pickupAddressState": "<string>",
"pickupAddressZip": "<string>",
"pickupAddressCountry": "<string>",
"pickupLat": 123,
"pickupLng": 123,
"dropoffAddressNumber": "<string>",
"dropoffAddressSecondarynumber": "<string>",
"dropoffAddressFormattedStreet": "<string>",
"dropoffAddressCity": "<string>",
"dropoffAddressCounty": "<string>",
"dropoffAddressState": "<string>",
"dropoffAddressZip": "<string>",
"dropoffAddressCountry": "<string>",
"dropoffLat": 123,
"dropoffLng": 123,
"weight": 123,
"height": 123,
"width": 123,
"depth": 123,
"items": [
{
"id": "abc-123",
"description": "A box of books",
"count": 2,
"dimensions": {
"depth": 14,
"height": 10,
"width": 12
},
"weight": 1.5,
"valueCents": 1000,
"requirements": [
"age_verification_on_delivery"
],
"category": "<string>",
"barcode": "0199312650999998913643M221872801002010908",
"metadata": {
"packaging_type": "CTN"
},
"subItems": [
{
"id": "abc-123",
"description": "A box of books",
"count": 2,
"dimensions": {
"depth": 14,
"height": 10,
"width": 12
},
"weight": 1.5,
"valueCents": 1000,
"requirements": [
"age_verification_on_delivery"
],
"category": "<string>",
"barcode": "0199312650999998913643M221872801002010908",
"metadata": {
"packaging_type": "CTN"
},
"sku": "<string>",
"substitution": {
"preference": "<string>",
"source": "<string>",
"substituteItems": [
{
"id": "<string>",
"sku": "<string>",
"quantity": 123
}
]
},
"subItems": "<unknown>"
}
]
}
],
"optimizationParameters": {
"pickupDoorstepTimeSeconds": 90,
"dropoffDoorstepTimeSeconds": 180,
"costsByMetric": {
"distance": 10,
"weight": 200
},
"clusterLabel": "<string>",
"mxLabel": "<string>",
"assignmentPriority": 1,
"sequencePriority": 249,
"sequenceGroup": "<string>"
},
"pickupPayment": {
"barcode": {
"type": "CODE128",
"value": "1234567890"
},
"providerCard": true
},
"reapplyAutomations": true,
"maxDeliveryFeeCents": 123
}
]
}
'import requests
url = "https://api.sandbox.usenash.com/v1/orders"
payload = { "orders": [
{
"externalId": "<string>",
"pickupAddress": "<string>",
"pickupPlaceId": "<string>",
"pickupPhoneNumber": "<string>",
"pickupBusinessName": "<string>",
"pickupFirstName": "<string>",
"pickupLastName": "<string>",
"pickupInstructions": "<string>",
"pickupStoreLocationId": "<string>",
"pickupExternalStoreLocationId": "<string>",
"pickupStoreLocationIds": ["<string>"],
"pickupZoneIds": ["<string>"],
"pickupBarcodes": ["<string>"],
"pickupEmail": "<string>",
"dropoffAddress": "<string>",
"dropoffPlaceId": "<string>",
"dropoffPhoneNumber": "<string>",
"dropoffBusinessName": "<string>",
"dropoffFirstName": "<string>",
"dropoffLastName": "<string>",
"dropoffInstructions": "<string>",
"dropoffBarcodes": ["<string>"],
"dropoffEmail": "<string>",
"deliveryMode": "<string>",
"pickupStartTime": "2023-11-07T05:31:56Z",
"pickupEndTime": "2023-11-07T05:31:56Z",
"dropoffStartTime": "2023-11-07T05:31:56Z",
"dropoffEndTime": "2023-11-07T05:31:56Z",
"deliveryWindowId": "<string>",
"description": "<string>",
"itemsCount": 123,
"currency": "<string>",
"valueCents": 123,
"tipAmountCents": 123,
"requirements": ["photo_proof_of_delivery", "age_verification_on_delivery"],
"minimumVehicleSize": "car",
"dispatchStrategyId": "<string>",
"orderMetadata": {},
"tags": ["<string>"],
"referenceId": "<string>",
"pickupAddressNumber": "<string>",
"pickupAddressSecondarynumber": "<string>",
"pickupAddressFormattedStreet": "<string>",
"pickupAddressCity": "<string>",
"pickupAddressCounty": "<string>",
"pickupAddressState": "<string>",
"pickupAddressZip": "<string>",
"pickupAddressCountry": "<string>",
"pickupLat": 123,
"pickupLng": 123,
"dropoffAddressNumber": "<string>",
"dropoffAddressSecondarynumber": "<string>",
"dropoffAddressFormattedStreet": "<string>",
"dropoffAddressCity": "<string>",
"dropoffAddressCounty": "<string>",
"dropoffAddressState": "<string>",
"dropoffAddressZip": "<string>",
"dropoffAddressCountry": "<string>",
"dropoffLat": 123,
"dropoffLng": 123,
"weight": 123,
"height": 123,
"width": 123,
"depth": 123,
"items": [
{
"id": "abc-123",
"description": "A box of books",
"count": 2,
"dimensions": {
"depth": 14,
"height": 10,
"width": 12
},
"weight": 1.5,
"valueCents": 1000,
"requirements": ["age_verification_on_delivery"],
"category": "<string>",
"barcode": "0199312650999998913643M221872801002010908",
"metadata": { "packaging_type": "CTN" },
"subItems": [
{
"id": "abc-123",
"description": "A box of books",
"count": 2,
"dimensions": {
"depth": 14,
"height": 10,
"width": 12
},
"weight": 1.5,
"valueCents": 1000,
"requirements": ["age_verification_on_delivery"],
"category": "<string>",
"barcode": "0199312650999998913643M221872801002010908",
"metadata": { "packaging_type": "CTN" },
"sku": "<string>",
"substitution": {
"preference": "<string>",
"source": "<string>",
"substituteItems": [
{
"id": "<string>",
"sku": "<string>",
"quantity": 123
}
]
},
"subItems": "<unknown>"
}
]
}
],
"optimizationParameters": {
"pickupDoorstepTimeSeconds": 90,
"dropoffDoorstepTimeSeconds": 180,
"costsByMetric": {
"distance": 10,
"weight": 200
},
"clusterLabel": "<string>",
"mxLabel": "<string>",
"assignmentPriority": 1,
"sequencePriority": 249,
"sequenceGroup": "<string>"
},
"pickupPayment": {
"barcode": {
"type": "CODE128",
"value": "1234567890"
},
"providerCard": True
},
"reapplyAutomations": True,
"maxDeliveryFeeCents": 123
}
] }
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({
orders: [
{
externalId: '<string>',
pickupAddress: '<string>',
pickupPlaceId: '<string>',
pickupPhoneNumber: '<string>',
pickupBusinessName: '<string>',
pickupFirstName: '<string>',
pickupLastName: '<string>',
pickupInstructions: '<string>',
pickupStoreLocationId: '<string>',
pickupExternalStoreLocationId: '<string>',
pickupStoreLocationIds: ['<string>'],
pickupZoneIds: ['<string>'],
pickupBarcodes: ['<string>'],
pickupEmail: '<string>',
dropoffAddress: '<string>',
dropoffPlaceId: '<string>',
dropoffPhoneNumber: '<string>',
dropoffBusinessName: '<string>',
dropoffFirstName: '<string>',
dropoffLastName: '<string>',
dropoffInstructions: '<string>',
dropoffBarcodes: ['<string>'],
dropoffEmail: '<string>',
deliveryMode: '<string>',
pickupStartTime: '2023-11-07T05:31:56Z',
pickupEndTime: '2023-11-07T05:31:56Z',
dropoffStartTime: '2023-11-07T05:31:56Z',
dropoffEndTime: '2023-11-07T05:31:56Z',
deliveryWindowId: '<string>',
description: '<string>',
itemsCount: 123,
currency: '<string>',
valueCents: 123,
tipAmountCents: 123,
requirements: ['photo_proof_of_delivery', 'age_verification_on_delivery'],
minimumVehicleSize: 'car',
dispatchStrategyId: '<string>',
orderMetadata: {},
tags: ['<string>'],
referenceId: '<string>',
pickupAddressNumber: '<string>',
pickupAddressSecondarynumber: '<string>',
pickupAddressFormattedStreet: '<string>',
pickupAddressCity: '<string>',
pickupAddressCounty: '<string>',
pickupAddressState: '<string>',
pickupAddressZip: '<string>',
pickupAddressCountry: '<string>',
pickupLat: 123,
pickupLng: 123,
dropoffAddressNumber: '<string>',
dropoffAddressSecondarynumber: '<string>',
dropoffAddressFormattedStreet: '<string>',
dropoffAddressCity: '<string>',
dropoffAddressCounty: '<string>',
dropoffAddressState: '<string>',
dropoffAddressZip: '<string>',
dropoffAddressCountry: '<string>',
dropoffLat: 123,
dropoffLng: 123,
weight: 123,
height: 123,
width: 123,
depth: 123,
items: [
{
id: 'abc-123',
description: 'A box of books',
count: 2,
dimensions: {depth: 14, height: 10, width: 12},
weight: 1.5,
valueCents: 1000,
requirements: ['age_verification_on_delivery'],
category: '<string>',
barcode: '0199312650999998913643M221872801002010908',
metadata: {packaging_type: 'CTN'},
subItems: [
{
id: 'abc-123',
description: 'A box of books',
count: 2,
dimensions: {depth: 14, height: 10, width: 12},
weight: 1.5,
valueCents: 1000,
requirements: ['age_verification_on_delivery'],
category: '<string>',
barcode: '0199312650999998913643M221872801002010908',
metadata: {packaging_type: 'CTN'},
sku: '<string>',
substitution: {
preference: '<string>',
source: '<string>',
substituteItems: [{id: '<string>', sku: '<string>', quantity: 123}]
},
subItems: '<unknown>'
}
]
}
],
optimizationParameters: {
pickupDoorstepTimeSeconds: 90,
dropoffDoorstepTimeSeconds: 180,
costsByMetric: {distance: 10, weight: 200},
clusterLabel: '<string>',
mxLabel: '<string>',
assignmentPriority: 1,
sequencePriority: 249,
sequenceGroup: '<string>'
},
pickupPayment: {barcode: {type: 'CODE128', value: '1234567890'}, providerCard: true},
reapplyAutomations: true,
maxDeliveryFeeCents: 123
}
]
})
};
fetch('https://api.sandbox.usenash.com/v1/orders', 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/orders",
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([
'orders' => [
[
'externalId' => '<string>',
'pickupAddress' => '<string>',
'pickupPlaceId' => '<string>',
'pickupPhoneNumber' => '<string>',
'pickupBusinessName' => '<string>',
'pickupFirstName' => '<string>',
'pickupLastName' => '<string>',
'pickupInstructions' => '<string>',
'pickupStoreLocationId' => '<string>',
'pickupExternalStoreLocationId' => '<string>',
'pickupStoreLocationIds' => [
'<string>'
],
'pickupZoneIds' => [
'<string>'
],
'pickupBarcodes' => [
'<string>'
],
'pickupEmail' => '<string>',
'dropoffAddress' => '<string>',
'dropoffPlaceId' => '<string>',
'dropoffPhoneNumber' => '<string>',
'dropoffBusinessName' => '<string>',
'dropoffFirstName' => '<string>',
'dropoffLastName' => '<string>',
'dropoffInstructions' => '<string>',
'dropoffBarcodes' => [
'<string>'
],
'dropoffEmail' => '<string>',
'deliveryMode' => '<string>',
'pickupStartTime' => '2023-11-07T05:31:56Z',
'pickupEndTime' => '2023-11-07T05:31:56Z',
'dropoffStartTime' => '2023-11-07T05:31:56Z',
'dropoffEndTime' => '2023-11-07T05:31:56Z',
'deliveryWindowId' => '<string>',
'description' => '<string>',
'itemsCount' => 123,
'currency' => '<string>',
'valueCents' => 123,
'tipAmountCents' => 123,
'requirements' => [
'photo_proof_of_delivery',
'age_verification_on_delivery'
],
'minimumVehicleSize' => 'car',
'dispatchStrategyId' => '<string>',
'orderMetadata' => [
],
'tags' => [
'<string>'
],
'referenceId' => '<string>',
'pickupAddressNumber' => '<string>',
'pickupAddressSecondarynumber' => '<string>',
'pickupAddressFormattedStreet' => '<string>',
'pickupAddressCity' => '<string>',
'pickupAddressCounty' => '<string>',
'pickupAddressState' => '<string>',
'pickupAddressZip' => '<string>',
'pickupAddressCountry' => '<string>',
'pickupLat' => 123,
'pickupLng' => 123,
'dropoffAddressNumber' => '<string>',
'dropoffAddressSecondarynumber' => '<string>',
'dropoffAddressFormattedStreet' => '<string>',
'dropoffAddressCity' => '<string>',
'dropoffAddressCounty' => '<string>',
'dropoffAddressState' => '<string>',
'dropoffAddressZip' => '<string>',
'dropoffAddressCountry' => '<string>',
'dropoffLat' => 123,
'dropoffLng' => 123,
'weight' => 123,
'height' => 123,
'width' => 123,
'depth' => 123,
'items' => [
[
'id' => 'abc-123',
'description' => 'A box of books',
'count' => 2,
'dimensions' => [
'depth' => 14,
'height' => 10,
'width' => 12
],
'weight' => 1.5,
'valueCents' => 1000,
'requirements' => [
'age_verification_on_delivery'
],
'category' => '<string>',
'barcode' => '0199312650999998913643M221872801002010908',
'metadata' => [
'packaging_type' => 'CTN'
],
'subItems' => [
[
'id' => 'abc-123',
'description' => 'A box of books',
'count' => 2,
'dimensions' => [
'depth' => 14,
'height' => 10,
'width' => 12
],
'weight' => 1.5,
'valueCents' => 1000,
'requirements' => [
'age_verification_on_delivery'
],
'category' => '<string>',
'barcode' => '0199312650999998913643M221872801002010908',
'metadata' => [
'packaging_type' => 'CTN'
],
'sku' => '<string>',
'substitution' => [
'preference' => '<string>',
'source' => '<string>',
'substituteItems' => [
[
'id' => '<string>',
'sku' => '<string>',
'quantity' => 123
]
]
],
'subItems' => '<unknown>'
]
]
]
],
'optimizationParameters' => [
'pickupDoorstepTimeSeconds' => 90,
'dropoffDoorstepTimeSeconds' => 180,
'costsByMetric' => [
'distance' => 10,
'weight' => 200
],
'clusterLabel' => '<string>',
'mxLabel' => '<string>',
'assignmentPriority' => 1,
'sequencePriority' => 249,
'sequenceGroup' => '<string>'
],
'pickupPayment' => [
'barcode' => [
'type' => 'CODE128',
'value' => '1234567890'
],
'providerCard' => true
],
'reapplyAutomations' => true,
'maxDeliveryFeeCents' => 123
]
]
]),
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/orders"
payload := strings.NewReader("{\n \"orders\": [\n {\n \"externalId\": \"<string>\",\n \"pickupAddress\": \"<string>\",\n \"pickupPlaceId\": \"<string>\",\n \"pickupPhoneNumber\": \"<string>\",\n \"pickupBusinessName\": \"<string>\",\n \"pickupFirstName\": \"<string>\",\n \"pickupLastName\": \"<string>\",\n \"pickupInstructions\": \"<string>\",\n \"pickupStoreLocationId\": \"<string>\",\n \"pickupExternalStoreLocationId\": \"<string>\",\n \"pickupStoreLocationIds\": [\n \"<string>\"\n ],\n \"pickupZoneIds\": [\n \"<string>\"\n ],\n \"pickupBarcodes\": [\n \"<string>\"\n ],\n \"pickupEmail\": \"<string>\",\n \"dropoffAddress\": \"<string>\",\n \"dropoffPlaceId\": \"<string>\",\n \"dropoffPhoneNumber\": \"<string>\",\n \"dropoffBusinessName\": \"<string>\",\n \"dropoffFirstName\": \"<string>\",\n \"dropoffLastName\": \"<string>\",\n \"dropoffInstructions\": \"<string>\",\n \"dropoffBarcodes\": [\n \"<string>\"\n ],\n \"dropoffEmail\": \"<string>\",\n \"deliveryMode\": \"<string>\",\n \"pickupStartTime\": \"2023-11-07T05:31:56Z\",\n \"pickupEndTime\": \"2023-11-07T05:31:56Z\",\n \"dropoffStartTime\": \"2023-11-07T05:31:56Z\",\n \"dropoffEndTime\": \"2023-11-07T05:31:56Z\",\n \"deliveryWindowId\": \"<string>\",\n \"description\": \"<string>\",\n \"itemsCount\": 123,\n \"currency\": \"<string>\",\n \"valueCents\": 123,\n \"tipAmountCents\": 123,\n \"requirements\": [\n \"photo_proof_of_delivery\",\n \"age_verification_on_delivery\"\n ],\n \"minimumVehicleSize\": \"car\",\n \"dispatchStrategyId\": \"<string>\",\n \"orderMetadata\": {},\n \"tags\": [\n \"<string>\"\n ],\n \"referenceId\": \"<string>\",\n \"pickupAddressNumber\": \"<string>\",\n \"pickupAddressSecondarynumber\": \"<string>\",\n \"pickupAddressFormattedStreet\": \"<string>\",\n \"pickupAddressCity\": \"<string>\",\n \"pickupAddressCounty\": \"<string>\",\n \"pickupAddressState\": \"<string>\",\n \"pickupAddressZip\": \"<string>\",\n \"pickupAddressCountry\": \"<string>\",\n \"pickupLat\": 123,\n \"pickupLng\": 123,\n \"dropoffAddressNumber\": \"<string>\",\n \"dropoffAddressSecondarynumber\": \"<string>\",\n \"dropoffAddressFormattedStreet\": \"<string>\",\n \"dropoffAddressCity\": \"<string>\",\n \"dropoffAddressCounty\": \"<string>\",\n \"dropoffAddressState\": \"<string>\",\n \"dropoffAddressZip\": \"<string>\",\n \"dropoffAddressCountry\": \"<string>\",\n \"dropoffLat\": 123,\n \"dropoffLng\": 123,\n \"weight\": 123,\n \"height\": 123,\n \"width\": 123,\n \"depth\": 123,\n \"items\": [\n {\n \"id\": \"abc-123\",\n \"description\": \"A box of books\",\n \"count\": 2,\n \"dimensions\": {\n \"depth\": 14,\n \"height\": 10,\n \"width\": 12\n },\n \"weight\": 1.5,\n \"valueCents\": 1000,\n \"requirements\": [\n \"age_verification_on_delivery\"\n ],\n \"category\": \"<string>\",\n \"barcode\": \"0199312650999998913643M221872801002010908\",\n \"metadata\": {\n \"packaging_type\": \"CTN\"\n },\n \"subItems\": [\n {\n \"id\": \"abc-123\",\n \"description\": \"A box of books\",\n \"count\": 2,\n \"dimensions\": {\n \"depth\": 14,\n \"height\": 10,\n \"width\": 12\n },\n \"weight\": 1.5,\n \"valueCents\": 1000,\n \"requirements\": [\n \"age_verification_on_delivery\"\n ],\n \"category\": \"<string>\",\n \"barcode\": \"0199312650999998913643M221872801002010908\",\n \"metadata\": {\n \"packaging_type\": \"CTN\"\n },\n \"sku\": \"<string>\",\n \"substitution\": {\n \"preference\": \"<string>\",\n \"source\": \"<string>\",\n \"substituteItems\": [\n {\n \"id\": \"<string>\",\n \"sku\": \"<string>\",\n \"quantity\": 123\n }\n ]\n },\n \"subItems\": \"<unknown>\"\n }\n ]\n }\n ],\n \"optimizationParameters\": {\n \"pickupDoorstepTimeSeconds\": 90,\n \"dropoffDoorstepTimeSeconds\": 180,\n \"costsByMetric\": {\n \"distance\": 10,\n \"weight\": 200\n },\n \"clusterLabel\": \"<string>\",\n \"mxLabel\": \"<string>\",\n \"assignmentPriority\": 1,\n \"sequencePriority\": 249,\n \"sequenceGroup\": \"<string>\"\n },\n \"pickupPayment\": {\n \"barcode\": {\n \"type\": \"CODE128\",\n \"value\": \"1234567890\"\n },\n \"providerCard\": true\n },\n \"reapplyAutomations\": true,\n \"maxDeliveryFeeCents\": 123\n }\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/orders")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"orders\": [\n {\n \"externalId\": \"<string>\",\n \"pickupAddress\": \"<string>\",\n \"pickupPlaceId\": \"<string>\",\n \"pickupPhoneNumber\": \"<string>\",\n \"pickupBusinessName\": \"<string>\",\n \"pickupFirstName\": \"<string>\",\n \"pickupLastName\": \"<string>\",\n \"pickupInstructions\": \"<string>\",\n \"pickupStoreLocationId\": \"<string>\",\n \"pickupExternalStoreLocationId\": \"<string>\",\n \"pickupStoreLocationIds\": [\n \"<string>\"\n ],\n \"pickupZoneIds\": [\n \"<string>\"\n ],\n \"pickupBarcodes\": [\n \"<string>\"\n ],\n \"pickupEmail\": \"<string>\",\n \"dropoffAddress\": \"<string>\",\n \"dropoffPlaceId\": \"<string>\",\n \"dropoffPhoneNumber\": \"<string>\",\n \"dropoffBusinessName\": \"<string>\",\n \"dropoffFirstName\": \"<string>\",\n \"dropoffLastName\": \"<string>\",\n \"dropoffInstructions\": \"<string>\",\n \"dropoffBarcodes\": [\n \"<string>\"\n ],\n \"dropoffEmail\": \"<string>\",\n \"deliveryMode\": \"<string>\",\n \"pickupStartTime\": \"2023-11-07T05:31:56Z\",\n \"pickupEndTime\": \"2023-11-07T05:31:56Z\",\n \"dropoffStartTime\": \"2023-11-07T05:31:56Z\",\n \"dropoffEndTime\": \"2023-11-07T05:31:56Z\",\n \"deliveryWindowId\": \"<string>\",\n \"description\": \"<string>\",\n \"itemsCount\": 123,\n \"currency\": \"<string>\",\n \"valueCents\": 123,\n \"tipAmountCents\": 123,\n \"requirements\": [\n \"photo_proof_of_delivery\",\n \"age_verification_on_delivery\"\n ],\n \"minimumVehicleSize\": \"car\",\n \"dispatchStrategyId\": \"<string>\",\n \"orderMetadata\": {},\n \"tags\": [\n \"<string>\"\n ],\n \"referenceId\": \"<string>\",\n \"pickupAddressNumber\": \"<string>\",\n \"pickupAddressSecondarynumber\": \"<string>\",\n \"pickupAddressFormattedStreet\": \"<string>\",\n \"pickupAddressCity\": \"<string>\",\n \"pickupAddressCounty\": \"<string>\",\n \"pickupAddressState\": \"<string>\",\n \"pickupAddressZip\": \"<string>\",\n \"pickupAddressCountry\": \"<string>\",\n \"pickupLat\": 123,\n \"pickupLng\": 123,\n \"dropoffAddressNumber\": \"<string>\",\n \"dropoffAddressSecondarynumber\": \"<string>\",\n \"dropoffAddressFormattedStreet\": \"<string>\",\n \"dropoffAddressCity\": \"<string>\",\n \"dropoffAddressCounty\": \"<string>\",\n \"dropoffAddressState\": \"<string>\",\n \"dropoffAddressZip\": \"<string>\",\n \"dropoffAddressCountry\": \"<string>\",\n \"dropoffLat\": 123,\n \"dropoffLng\": 123,\n \"weight\": 123,\n \"height\": 123,\n \"width\": 123,\n \"depth\": 123,\n \"items\": [\n {\n \"id\": \"abc-123\",\n \"description\": \"A box of books\",\n \"count\": 2,\n \"dimensions\": {\n \"depth\": 14,\n \"height\": 10,\n \"width\": 12\n },\n \"weight\": 1.5,\n \"valueCents\": 1000,\n \"requirements\": [\n \"age_verification_on_delivery\"\n ],\n \"category\": \"<string>\",\n \"barcode\": \"0199312650999998913643M221872801002010908\",\n \"metadata\": {\n \"packaging_type\": \"CTN\"\n },\n \"subItems\": [\n {\n \"id\": \"abc-123\",\n \"description\": \"A box of books\",\n \"count\": 2,\n \"dimensions\": {\n \"depth\": 14,\n \"height\": 10,\n \"width\": 12\n },\n \"weight\": 1.5,\n \"valueCents\": 1000,\n \"requirements\": [\n \"age_verification_on_delivery\"\n ],\n \"category\": \"<string>\",\n \"barcode\": \"0199312650999998913643M221872801002010908\",\n \"metadata\": {\n \"packaging_type\": \"CTN\"\n },\n \"sku\": \"<string>\",\n \"substitution\": {\n \"preference\": \"<string>\",\n \"source\": \"<string>\",\n \"substituteItems\": [\n {\n \"id\": \"<string>\",\n \"sku\": \"<string>\",\n \"quantity\": 123\n }\n ]\n },\n \"subItems\": \"<unknown>\"\n }\n ]\n }\n ],\n \"optimizationParameters\": {\n \"pickupDoorstepTimeSeconds\": 90,\n \"dropoffDoorstepTimeSeconds\": 180,\n \"costsByMetric\": {\n \"distance\": 10,\n \"weight\": 200\n },\n \"clusterLabel\": \"<string>\",\n \"mxLabel\": \"<string>\",\n \"assignmentPriority\": 1,\n \"sequencePriority\": 249,\n \"sequenceGroup\": \"<string>\"\n },\n \"pickupPayment\": {\n \"barcode\": {\n \"type\": \"CODE128\",\n \"value\": \"1234567890\"\n },\n \"providerCard\": true\n },\n \"reapplyAutomations\": true,\n \"maxDeliveryFeeCents\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.usenash.com/v1/orders")
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 \"orders\": [\n {\n \"externalId\": \"<string>\",\n \"pickupAddress\": \"<string>\",\n \"pickupPlaceId\": \"<string>\",\n \"pickupPhoneNumber\": \"<string>\",\n \"pickupBusinessName\": \"<string>\",\n \"pickupFirstName\": \"<string>\",\n \"pickupLastName\": \"<string>\",\n \"pickupInstructions\": \"<string>\",\n \"pickupStoreLocationId\": \"<string>\",\n \"pickupExternalStoreLocationId\": \"<string>\",\n \"pickupStoreLocationIds\": [\n \"<string>\"\n ],\n \"pickupZoneIds\": [\n \"<string>\"\n ],\n \"pickupBarcodes\": [\n \"<string>\"\n ],\n \"pickupEmail\": \"<string>\",\n \"dropoffAddress\": \"<string>\",\n \"dropoffPlaceId\": \"<string>\",\n \"dropoffPhoneNumber\": \"<string>\",\n \"dropoffBusinessName\": \"<string>\",\n \"dropoffFirstName\": \"<string>\",\n \"dropoffLastName\": \"<string>\",\n \"dropoffInstructions\": \"<string>\",\n \"dropoffBarcodes\": [\n \"<string>\"\n ],\n \"dropoffEmail\": \"<string>\",\n \"deliveryMode\": \"<string>\",\n \"pickupStartTime\": \"2023-11-07T05:31:56Z\",\n \"pickupEndTime\": \"2023-11-07T05:31:56Z\",\n \"dropoffStartTime\": \"2023-11-07T05:31:56Z\",\n \"dropoffEndTime\": \"2023-11-07T05:31:56Z\",\n \"deliveryWindowId\": \"<string>\",\n \"description\": \"<string>\",\n \"itemsCount\": 123,\n \"currency\": \"<string>\",\n \"valueCents\": 123,\n \"tipAmountCents\": 123,\n \"requirements\": [\n \"photo_proof_of_delivery\",\n \"age_verification_on_delivery\"\n ],\n \"minimumVehicleSize\": \"car\",\n \"dispatchStrategyId\": \"<string>\",\n \"orderMetadata\": {},\n \"tags\": [\n \"<string>\"\n ],\n \"referenceId\": \"<string>\",\n \"pickupAddressNumber\": \"<string>\",\n \"pickupAddressSecondarynumber\": \"<string>\",\n \"pickupAddressFormattedStreet\": \"<string>\",\n \"pickupAddressCity\": \"<string>\",\n \"pickupAddressCounty\": \"<string>\",\n \"pickupAddressState\": \"<string>\",\n \"pickupAddressZip\": \"<string>\",\n \"pickupAddressCountry\": \"<string>\",\n \"pickupLat\": 123,\n \"pickupLng\": 123,\n \"dropoffAddressNumber\": \"<string>\",\n \"dropoffAddressSecondarynumber\": \"<string>\",\n \"dropoffAddressFormattedStreet\": \"<string>\",\n \"dropoffAddressCity\": \"<string>\",\n \"dropoffAddressCounty\": \"<string>\",\n \"dropoffAddressState\": \"<string>\",\n \"dropoffAddressZip\": \"<string>\",\n \"dropoffAddressCountry\": \"<string>\",\n \"dropoffLat\": 123,\n \"dropoffLng\": 123,\n \"weight\": 123,\n \"height\": 123,\n \"width\": 123,\n \"depth\": 123,\n \"items\": [\n {\n \"id\": \"abc-123\",\n \"description\": \"A box of books\",\n \"count\": 2,\n \"dimensions\": {\n \"depth\": 14,\n \"height\": 10,\n \"width\": 12\n },\n \"weight\": 1.5,\n \"valueCents\": 1000,\n \"requirements\": [\n \"age_verification_on_delivery\"\n ],\n \"category\": \"<string>\",\n \"barcode\": \"0199312650999998913643M221872801002010908\",\n \"metadata\": {\n \"packaging_type\": \"CTN\"\n },\n \"subItems\": [\n {\n \"id\": \"abc-123\",\n \"description\": \"A box of books\",\n \"count\": 2,\n \"dimensions\": {\n \"depth\": 14,\n \"height\": 10,\n \"width\": 12\n },\n \"weight\": 1.5,\n \"valueCents\": 1000,\n \"requirements\": [\n \"age_verification_on_delivery\"\n ],\n \"category\": \"<string>\",\n \"barcode\": \"0199312650999998913643M221872801002010908\",\n \"metadata\": {\n \"packaging_type\": \"CTN\"\n },\n \"sku\": \"<string>\",\n \"substitution\": {\n \"preference\": \"<string>\",\n \"source\": \"<string>\",\n \"substituteItems\": [\n {\n \"id\": \"<string>\",\n \"sku\": \"<string>\",\n \"quantity\": 123\n }\n ]\n },\n \"subItems\": \"<unknown>\"\n }\n ]\n }\n ],\n \"optimizationParameters\": {\n \"pickupDoorstepTimeSeconds\": 90,\n \"dropoffDoorstepTimeSeconds\": 180,\n \"costsByMetric\": {\n \"distance\": 10,\n \"weight\": 200\n },\n \"clusterLabel\": \"<string>\",\n \"mxLabel\": \"<string>\",\n \"assignmentPriority\": 1,\n \"sequencePriority\": 249,\n \"sequenceGroup\": \"<string>\"\n },\n \"pickupPayment\": {\n \"barcode\": {\n \"type\": \"CODE128\",\n \"value\": \"1234567890\"\n },\n \"providerCard\": true\n },\n \"reapplyAutomations\": true,\n \"maxDeliveryFeeCents\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body[
{
"id": "ord_1234567890",
"createdAt": "2023-08-29T19:17:46.264523",
"portalUrl": "https://portal.dev.usenash.com/orders/ord_1234567890",
"publicTrackingUrl": "https://tracking.dev.usenash.com/ord_1234567890",
"status": "needs_attention",
"tags": [
"REST_API"
],
"externalId": "1234567890",
"externalGroupId": "1234567890",
"referenceId": "1234567890",
"orderMetadata": {
"key": "value"
},
"pickupAddress": "185 University Ave, Palo Alto, CA 94301",
"pickupPlaceId": "ChIJd8BlQJq3t4kRUKhH43CQ",
"pickupAddressNumber": "185",
"pickupAddressSecondarynumber": "<string>",
"pickupAddressFormattedStreet": "University Ave",
"pickupAddressCity": "Palo Alto",
"pickupAddressCounty": "Santa Clara",
"pickupAddressState": "CA",
"pickupAddressZip": "94301",
"pickupAddressCountry": "US",
"pickupLat": 37.422222,
"pickupLng": -122.139776,
"pickupPhoneNumber": "+15555555555",
"pickupFirstName": "Manager",
"pickupLastName": "Manager",
"pickupBusinessName": "Store ABC",
"pickupInstructions": "Leave at the front door",
"pickupStoreLocationId": "stl_VwpoPJaaqWiPGnXEhWfX",
"pickupExternalStoreLocationId": "0021112",
"pickupZoneIds": [
"<string>"
],
"pickupBarcodes": [
"1234567890",
"0987654321"
],
"pickupPayment": {
"barcode": {
"type": "CODE128",
"value": "1234567890"
},
"providerCard": false
},
"dropoffAddress": "401 San Antonio Rd, Mountain View, CA 94040",
"dropoffPlaceId": "ChIJd8BlQJq3t4kRUKhH43CQ",
"dropoffAddressNumber": "401",
"dropoffAddressSecondarynumber": "<string>",
"dropoffAddressFormattedStreet": "San Antonio Rd",
"dropoffAddressCity": "Mountain View",
"dropoffAddressCounty": "Santa Clara",
"dropoffAddressState": "CA",
"dropoffAddressZip": "94040",
"dropoffAddressCountry": "US",
"dropoffLat": 37.422222,
"dropoffLng": -122.139776,
"dropoffPhoneNumber": "+15555555556",
"dropoffFirstName": "Quote",
"dropoffLastName": "Request",
"dropoffBusinessName": "<string>",
"dropoffInstructions": "Leave at the front door",
"dropoffStoreLocationId": "<string>",
"dropoffBarcodes": [
"<string>"
],
"deliveryMode": "scheduled",
"pickupStartTime": "2024-08-22T23:54:08Z",
"pickupEndTime": "2024-08-22T23:54:08Z",
"dropoffStartTime": "2024-08-22T23:54:08Z",
"dropoffEndTime": "2024-08-22T23:54:08Z",
"description": "Order description",
"itemsCount": "1",
"requirements": [
"photo_proof_of_delivery"
],
"minimumVehicleSize": "car",
"currency": "USD",
"valueCents": "10000",
"tipAmountCents": "1000",
"width": "100",
"depth": "100",
"height": "100",
"volume": "<string>",
"weight": "100",
"items": [
{
"id": "abc-123",
"description": "A box of books",
"count": 2,
"dimensions": {
"depth": 14,
"height": 10,
"width": 12
},
"weight": 1.5,
"valueCents": 1000,
"requirements": [
"age_verification_on_delivery"
],
"category": "<string>",
"barcode": "0199312650999998913643M221872801002010908",
"metadata": {
"packaging_type": "CTN"
},
"subItems": [
{
"id": "abc-123",
"description": "A box of books",
"count": 2,
"dimensions": {
"depth": 14,
"height": 10,
"width": 12
},
"weight": 1.5,
"valueCents": 1000,
"requirements": [
"age_verification_on_delivery"
],
"category": "<string>",
"barcode": "0199312650999998913643M221872801002010908",
"metadata": {
"packaging_type": "CTN"
},
"sku": "<string>",
"substitution": {
"preference": "<string>",
"source": "<string>",
"substituteItems": [
{
"id": "<string>",
"sku": "<string>",
"quantity": 123
}
]
},
"subItems": "<unknown>"
}
]
}
],
"dispatchStrategyId": "dss_1234567890",
"maxDeliveryFeeCents": "1000",
"documents": [
{
"contentType": "application/pdf",
"data": "SGVsbG8gd29ybGQ=",
"id": "doc_1234567890",
"type": "shipping_label",
"url": "https://example.com/document.pdf"
}
],
"validationErrors": {
"pickupStartTime": "Time is in the past"
},
"quotes": [
{
"costSplitBusinessCents": null,
"costSplitCustomerCents": null,
"createdTime": "2024-09-03T20:43:45.899094",
"currency": "USD",
"dropoffEta": "2024-09-03T22:20:47.569000",
"expireTime": "2024-09-03T21:43:45.899102",
"id": "qot_2oWASjGxMtucwGgu6A7BYC",
"insuranceFeeCents": 0,
"nashFeeCents": 300,
"pickupWindow": null,
"priceCents": 100,
"providerId": "dispatch_partner",
"providerIsInternal": false,
"providerLogo": "https://nash-provider-logos.s3.amazonaws.com/dispatchit-logo.jpg",
"providerName": "Dispatch",
"tags": null,
"taxAmountCents": null,
"tollFeeCents": 0,
"totalPriceBreakdown": {
"priceCents": 100
},
"totalPriceCents": 100,
"type": "LOCAL"
}
],
"failedQuotes": [
"quote_1234567890",
"quote_0987654321"
]
}
][
{
"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
List of orders to create
Show child attributes
Show child attributes
Response
OK
The id of the order
"ord_1234567890"
The date and time when the order was created
"2023-08-29T19:17:46.264523"
The URL of the order in the Nash portal
"https://portal.dev.usenash.com/orders/ord_1234567890"
The URL of the order in the public tracking system
"https://tracking.dev.usenash.com/ord_1234567890"
The status of the order
"needs_attention"
The tags of the order
["REST_API"]
The external id of the order
"1234567890"
The external group id of the order
"1234567890"
A non-unique identifier for orders, visible to the courier if supported by the provider.
"1234567890"
Key-value data to attach to Nash Jobs.
{ "key": "value" }
The pickup address of the order
"185 University Ave, Palo Alto, CA 94301"
Google place id for the pickup location.
"ChIJd8BlQJq3t4kRUKhH43CQ"
The number on a house.
"185"
Secondary number on an address e.g. an apartment building.
The street of the address.
"University Ave"
The city of the pickup address.
"Palo Alto"
The county associated with the pickup address.
"Santa Clara"
The state of the pickup address.
"CA"
The zip or postal code of the pickup address.
"94301"
The ISO 3166-1 alpha-2 country code of the pickup address.
"US"
The pickup latitude coordinate.
37.422222
The pickup longitude coordinate.
-122.139776
The phone number to contact at the pickup location in the form: '+15555555555'
"+15555555555"
First name of the person to pickup from. If unknown pass 'Manager'. Limited to 80 characters.
"Manager"
Last name of the person to pickup from. If unknown pass 'Manager'. Limited to 80 characters.
"Manager"
Pickup business name at the origin.
"Store ABC"
Any special instructions for pickup.
"Leave at the front door"
A unique identifier for store location created in Nash.
"stl_VwpoPJaaqWiPGnXEhWfX"
The external identifier used for your store.
"0021112"
A list of zone IDs to consider for the Order. The pickup store location will be selected later via selected delivery window.
Array containing barcode values that are required to be scanned at the pickup waypoint.
["1234567890", "0987654321"]
How the courier should pay for the order at pickup (e.g. a barcode or provider card).
Show child attributes
Show child attributes
{
"barcode": { "type": "CODE128", "value": "1234567890" },
"providerCard": false
}
The dropoff address of the order
"401 San Antonio Rd, Mountain View, CA 94040"
Google place id for the dropoff location.
"ChIJd8BlQJq3t4kRUKhH43CQ"
The number on a house.
"401"
Secondary number on an address e.g. an apartment building.
The street of the address.
"San Antonio Rd"
The city of the dropoff address.
"Mountain View"
The county associated with the dropoff address.
"Santa Clara"
The state of the dropoff address.
"CA"
The zip or postal code of the dropoff address.
"94040"
The ISO 3166-1 alpha-2 country code of the dropoff address.
"US"
The dropoff latitude coordinate.
37.422222
The dropoff longitude coordinate.
-122.139776
The phone number to contact at the dropoff location in the form: '+15555555555'
"+15555555556"
First name of the contact at the destination.
"Quote"
Last name of the contact at the destination.
"Request"
Dropoff business name at the destination.
Any special instructions for dropoff.
"Leave at the front door"
A unique identifier for store location created in Nash.
Array containing barcode values that are required to be scanned at the dropoff waypoint.
The delivery mode of the order
"scheduled"
The start time of the pickup window.
"2024-08-22T23:54:08Z"
The end time of the pickup window.
"2024-08-22T23:54:08Z"
The start time of the dropoff window.
"2024-08-22T23:54:08Z"
The end time of the dropoff window.
"2024-08-22T23:54:08Z"
The description of the order
"Order description"
The number of items in the order
"1"
The requirements of the order
["photo_proof_of_delivery"]
The requested minimum vehicle size. Allowed values: ['any', 'bike', 'motorbike', 'cargobike', 'sedan', 'car', 'suv', 'pickup_truck', 'pickup', 'van', 'large_van', 'extra_large_van', 'truck']
any, bike, motorbike, cargobike, sedan, car, suv, pickup_truck, pickup, van, large_van, extra_large_van, truck "car"
The currency of the order
"USD"
The value of the order in cents
"10000"
The tip amount of the order in cents
"1000"
The width of the order in cm
"100"
The depth of the order in cm
"100"
The height of the order in cm
"100"
The volume of the order in cm^3
The weight of the order in kg
"100"
The items of the order
Show child attributes
Show child attributes
The dispatch strategy id (or option group id) to be associated with the order. Note: It is the best practice to allow automations to control dispatch strategy and not send the dispatch strategy id in the request.
"dss_1234567890"
The max delivery fee of the order in cents
"1000"
The documents of the order
Show child attributes
Show child attributes
[
{
"contentType": "application/pdf",
"data": "SGVsbG8gd29ybGQ=",
"id": "doc_1234567890",
"type": "shipping_label",
"url": "https://example.com/document.pdf"
}
]
The validation errors of the order
Show child attributes
Show child attributes
{ "pickupStartTime": "Time is in the past" }
The quotes of the order
Show child attributes
Show child attributes
[
{
"costSplitBusinessCents": null,
"costSplitCustomerCents": null,
"createdTime": "2024-09-03T20:43:45.899094",
"currency": "USD",
"dropoffEta": "2024-09-03T22:20:47.569000",
"expireTime": "2024-09-03T21:43:45.899102",
"id": "qot_2oWASjGxMtucwGgu6A7BYC",
"insuranceFeeCents": 0,
"nashFeeCents": 300,
"pickupWindow": null,
"priceCents": 100,
"providerId": "dispatch_partner",
"providerIsInternal": false,
"providerLogo": "https://nash-provider-logos.s3.amazonaws.com/dispatchit-logo.jpg",
"providerName": "Dispatch",
"tags": null,
"taxAmountCents": null,
"tollFeeCents": 0,
"totalPriceBreakdown": { "priceCents": 100 },
"totalPriceCents": 100,
"type": "LOCAL"
}
]
The failed quotes of the order
["quote_1234567890", "quote_0987654321"]
Was this page helpful?