Create shipment orders
curl --request POST \
--url https://api-stage.orchestro.ai/e1/shipment-orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--data @- <<EOF
{
"callerType": "SHIPPER",
"accounts": [
{
"accountNumber": "TEST_ACCOUNT_1",
"accountType": "SHIPPER"
}
],
"parcels": [
{
"serviceType": "GRD",
"shipFrom": {
"name": "The City Secretary's Office",
"address1": "1500 Marilla Street",
"city": "Dallas",
"state": "TX",
"zip": "75201",
"country": "US",
"company": "Dallas City Hall",
"address2": "",
"phone": "",
"email": "",
"addressType": "B"
},
"shipTo": {
"name": "The City Secretary's Office",
"address1": "1500 Marilla Street",
"city": "Dallas",
"state": "TX",
"zip": "75201",
"country": "US",
"company": "Dallas City Hall",
"address2": "",
"phone": "",
"email": "",
"addressType": "B"
},
"weight": {
"value": 6,
"unit": "lb"
},
"rates": [
{
"zone": 7,
"serviceType": "GRD",
"tnt": 7,
"baseRate": 3.92,
"totalRate": 24.47
}
],
"shipmentDate": "2023-12-22T06:34:00",
"parcelType": "P",
"serviceAttributes": [
{
"code": "AD_SIGN",
"description": "Adult Signature Required",
"rate": 3.98
}
],
"surcharges": [
{
"code": "FUEL",
"description": "Fuel Surcharge",
"rate": 5.98
}
]
}
]
}
EOFimport requests
url = "https://api-stage.orchestro.ai/e1/shipment-orders"
payload = {
"callerType": "SHIPPER",
"accounts": [
{
"accountNumber": "TEST_ACCOUNT_1",
"accountType": "SHIPPER"
}
],
"parcels": [
{
"serviceType": "GRD",
"shipFrom": {
"name": "The City Secretary's Office",
"address1": "1500 Marilla Street",
"city": "Dallas",
"state": "TX",
"zip": "75201",
"country": "US",
"company": "Dallas City Hall",
"address2": "",
"phone": "",
"email": "",
"addressType": "B"
},
"shipTo": {
"name": "The City Secretary's Office",
"address1": "1500 Marilla Street",
"city": "Dallas",
"state": "TX",
"zip": "75201",
"country": "US",
"company": "Dallas City Hall",
"address2": "",
"phone": "",
"email": "",
"addressType": "B"
},
"weight": {
"value": 6,
"unit": "lb"
},
"rates": [
{
"zone": 7,
"serviceType": "GRD",
"tnt": 7,
"baseRate": 3.92,
"totalRate": 24.47
}
],
"shipmentDate": "2023-12-22T06:34:00",
"parcelType": "P",
"serviceAttributes": [
{
"code": "AD_SIGN",
"description": "Adult Signature Required",
"rate": 3.98
}
],
"surcharges": [
{
"code": "FUEL",
"description": "Fuel Surcharge",
"rate": 5.98
}
]
}
]
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: 'Bearer <token>'},
body: JSON.stringify({
callerType: 'SHIPPER',
accounts: [{accountNumber: 'TEST_ACCOUNT_1', accountType: 'SHIPPER'}],
parcels: [
{
serviceType: 'GRD',
shipFrom: {
name: 'The City Secretary\'s Office',
address1: '1500 Marilla Street',
city: 'Dallas',
state: 'TX',
zip: '75201',
country: 'US',
company: 'Dallas City Hall',
address2: '',
phone: '',
email: '',
addressType: 'B'
},
shipTo: {
name: 'The City Secretary\'s Office',
address1: '1500 Marilla Street',
city: 'Dallas',
state: 'TX',
zip: '75201',
country: 'US',
company: 'Dallas City Hall',
address2: '',
phone: '',
email: '',
addressType: 'B'
},
weight: {value: 6, unit: 'lb'},
rates: [{zone: 7, serviceType: 'GRD', tnt: 7, baseRate: 3.92, totalRate: 24.47}],
shipmentDate: '2023-12-22T06:34:00',
parcelType: 'P',
serviceAttributes: [{code: 'AD_SIGN', description: 'Adult Signature Required', rate: 3.98}],
surcharges: [{code: 'FUEL', description: 'Fuel Surcharge', rate: 5.98}]
}
]
})
};
fetch('https://api-stage.orchestro.ai/e1/shipment-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-stage.orchestro.ai/e1/shipment-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([
'callerType' => 'SHIPPER',
'accounts' => [
[
'accountNumber' => 'TEST_ACCOUNT_1',
'accountType' => 'SHIPPER'
]
],
'parcels' => [
[
'serviceType' => 'GRD',
'shipFrom' => [
'name' => 'The City Secretary\'s Office',
'address1' => '1500 Marilla Street',
'city' => 'Dallas',
'state' => 'TX',
'zip' => '75201',
'country' => 'US',
'company' => 'Dallas City Hall',
'address2' => '',
'phone' => '',
'email' => '',
'addressType' => 'B'
],
'shipTo' => [
'name' => 'The City Secretary\'s Office',
'address1' => '1500 Marilla Street',
'city' => 'Dallas',
'state' => 'TX',
'zip' => '75201',
'country' => 'US',
'company' => 'Dallas City Hall',
'address2' => '',
'phone' => '',
'email' => '',
'addressType' => 'B'
],
'weight' => [
'value' => 6,
'unit' => 'lb'
],
'rates' => [
[
'zone' => 7,
'serviceType' => 'GRD',
'tnt' => 7,
'baseRate' => 3.92,
'totalRate' => 24.47
]
],
'shipmentDate' => '2023-12-22T06:34:00',
'parcelType' => 'P',
'serviceAttributes' => [
[
'code' => 'AD_SIGN',
'description' => 'Adult Signature Required',
'rate' => 3.98
]
],
'surcharges' => [
[
'code' => 'FUEL',
'description' => 'Fuel Surcharge',
'rate' => 5.98
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>"
],
]);
$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-stage.orchestro.ai/e1/shipment-orders"
payload := strings.NewReader("{\n \"callerType\": \"SHIPPER\",\n \"accounts\": [\n {\n \"accountNumber\": \"TEST_ACCOUNT_1\",\n \"accountType\": \"SHIPPER\"\n }\n ],\n \"parcels\": [\n {\n \"serviceType\": \"GRD\",\n \"shipFrom\": {\n \"name\": \"The City Secretary's Office\",\n \"address1\": \"1500 Marilla Street\",\n \"city\": \"Dallas\",\n \"state\": \"TX\",\n \"zip\": \"75201\",\n \"country\": \"US\",\n \"company\": \"Dallas City Hall\",\n \"address2\": \"\",\n \"phone\": \"\",\n \"email\": \"\",\n \"addressType\": \"B\"\n },\n \"shipTo\": {\n \"name\": \"The City Secretary's Office\",\n \"address1\": \"1500 Marilla Street\",\n \"city\": \"Dallas\",\n \"state\": \"TX\",\n \"zip\": \"75201\",\n \"country\": \"US\",\n \"company\": \"Dallas City Hall\",\n \"address2\": \"\",\n \"phone\": \"\",\n \"email\": \"\",\n \"addressType\": \"B\"\n },\n \"weight\": {\n \"value\": 6,\n \"unit\": \"lb\"\n },\n \"rates\": [\n {\n \"zone\": 7,\n \"serviceType\": \"GRD\",\n \"tnt\": 7,\n \"baseRate\": 3.92,\n \"totalRate\": 24.47\n }\n ],\n \"shipmentDate\": \"2023-12-22T06:34:00\",\n \"parcelType\": \"P\",\n \"serviceAttributes\": [\n {\n \"code\": \"AD_SIGN\",\n \"description\": \"Adult Signature Required\",\n \"rate\": 3.98\n }\n ],\n \"surcharges\": [\n {\n \"code\": \"FUEL\",\n \"description\": \"Fuel Surcharge\",\n \"rate\": 5.98\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "Bearer <token>")
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-stage.orchestro.ai/e1/shipment-orders")
.header("Content-Type", "<content-type>")
.header("Authorization", "Bearer <token>")
.body("{\n \"callerType\": \"SHIPPER\",\n \"accounts\": [\n {\n \"accountNumber\": \"TEST_ACCOUNT_1\",\n \"accountType\": \"SHIPPER\"\n }\n ],\n \"parcels\": [\n {\n \"serviceType\": \"GRD\",\n \"shipFrom\": {\n \"name\": \"The City Secretary's Office\",\n \"address1\": \"1500 Marilla Street\",\n \"city\": \"Dallas\",\n \"state\": \"TX\",\n \"zip\": \"75201\",\n \"country\": \"US\",\n \"company\": \"Dallas City Hall\",\n \"address2\": \"\",\n \"phone\": \"\",\n \"email\": \"\",\n \"addressType\": \"B\"\n },\n \"shipTo\": {\n \"name\": \"The City Secretary's Office\",\n \"address1\": \"1500 Marilla Street\",\n \"city\": \"Dallas\",\n \"state\": \"TX\",\n \"zip\": \"75201\",\n \"country\": \"US\",\n \"company\": \"Dallas City Hall\",\n \"address2\": \"\",\n \"phone\": \"\",\n \"email\": \"\",\n \"addressType\": \"B\"\n },\n \"weight\": {\n \"value\": 6,\n \"unit\": \"lb\"\n },\n \"rates\": [\n {\n \"zone\": 7,\n \"serviceType\": \"GRD\",\n \"tnt\": 7,\n \"baseRate\": 3.92,\n \"totalRate\": 24.47\n }\n ],\n \"shipmentDate\": \"2023-12-22T06:34:00\",\n \"parcelType\": \"P\",\n \"serviceAttributes\": [\n {\n \"code\": \"AD_SIGN\",\n \"description\": \"Adult Signature Required\",\n \"rate\": 3.98\n }\n ],\n \"surcharges\": [\n {\n \"code\": \"FUEL\",\n \"description\": \"Fuel Surcharge\",\n \"rate\": 5.98\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-stage.orchestro.ai/e1/shipment-orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"callerType\": \"SHIPPER\",\n \"accounts\": [\n {\n \"accountNumber\": \"TEST_ACCOUNT_1\",\n \"accountType\": \"SHIPPER\"\n }\n ],\n \"parcels\": [\n {\n \"serviceType\": \"GRD\",\n \"shipFrom\": {\n \"name\": \"The City Secretary's Office\",\n \"address1\": \"1500 Marilla Street\",\n \"city\": \"Dallas\",\n \"state\": \"TX\",\n \"zip\": \"75201\",\n \"country\": \"US\",\n \"company\": \"Dallas City Hall\",\n \"address2\": \"\",\n \"phone\": \"\",\n \"email\": \"\",\n \"addressType\": \"B\"\n },\n \"shipTo\": {\n \"name\": \"The City Secretary's Office\",\n \"address1\": \"1500 Marilla Street\",\n \"city\": \"Dallas\",\n \"state\": \"TX\",\n \"zip\": \"75201\",\n \"country\": \"US\",\n \"company\": \"Dallas City Hall\",\n \"address2\": \"\",\n \"phone\": \"\",\n \"email\": \"\",\n \"addressType\": \"B\"\n },\n \"weight\": {\n \"value\": 6,\n \"unit\": \"lb\"\n },\n \"rates\": [\n {\n \"zone\": 7,\n \"serviceType\": \"GRD\",\n \"tnt\": 7,\n \"baseRate\": 3.92,\n \"totalRate\": 24.47\n }\n ],\n \"shipmentDate\": \"2023-12-22T06:34:00\",\n \"parcelType\": \"P\",\n \"serviceAttributes\": [\n {\n \"code\": \"AD_SIGN\",\n \"description\": \"Adult Signature Required\",\n \"rate\": 3.98\n }\n ],\n \"surcharges\": [\n {\n \"code\": \"FUEL\",\n \"description\": \"Fuel Surcharge\",\n \"rate\": 5.98\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "SUCCESS"
}{
"errors": [
{
"code": "ERR-3001",
"message": "Shipment Date is required."
},
{
"code": "ERR-3003",
"message": "Total number of parcels should be greater than 0."
}
]
}{
"errors": [
{
"code": "ERR-1000",
"message": "Invalid Token."
}
]
}{
"errors": [
{
"code": "ERR-2025",
"message": "We are having some issue, please resubmit the request."
}
]
}Analytics
Create shipment orders
This endpoint allows users to create a new shipment order with parcel and account details.
POST
/
shipment-orders
Create shipment orders
curl --request POST \
--url https://api-stage.orchestro.ai/e1/shipment-orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--data @- <<EOF
{
"callerType": "SHIPPER",
"accounts": [
{
"accountNumber": "TEST_ACCOUNT_1",
"accountType": "SHIPPER"
}
],
"parcels": [
{
"serviceType": "GRD",
"shipFrom": {
"name": "The City Secretary's Office",
"address1": "1500 Marilla Street",
"city": "Dallas",
"state": "TX",
"zip": "75201",
"country": "US",
"company": "Dallas City Hall",
"address2": "",
"phone": "",
"email": "",
"addressType": "B"
},
"shipTo": {
"name": "The City Secretary's Office",
"address1": "1500 Marilla Street",
"city": "Dallas",
"state": "TX",
"zip": "75201",
"country": "US",
"company": "Dallas City Hall",
"address2": "",
"phone": "",
"email": "",
"addressType": "B"
},
"weight": {
"value": 6,
"unit": "lb"
},
"rates": [
{
"zone": 7,
"serviceType": "GRD",
"tnt": 7,
"baseRate": 3.92,
"totalRate": 24.47
}
],
"shipmentDate": "2023-12-22T06:34:00",
"parcelType": "P",
"serviceAttributes": [
{
"code": "AD_SIGN",
"description": "Adult Signature Required",
"rate": 3.98
}
],
"surcharges": [
{
"code": "FUEL",
"description": "Fuel Surcharge",
"rate": 5.98
}
]
}
]
}
EOFimport requests
url = "https://api-stage.orchestro.ai/e1/shipment-orders"
payload = {
"callerType": "SHIPPER",
"accounts": [
{
"accountNumber": "TEST_ACCOUNT_1",
"accountType": "SHIPPER"
}
],
"parcels": [
{
"serviceType": "GRD",
"shipFrom": {
"name": "The City Secretary's Office",
"address1": "1500 Marilla Street",
"city": "Dallas",
"state": "TX",
"zip": "75201",
"country": "US",
"company": "Dallas City Hall",
"address2": "",
"phone": "",
"email": "",
"addressType": "B"
},
"shipTo": {
"name": "The City Secretary's Office",
"address1": "1500 Marilla Street",
"city": "Dallas",
"state": "TX",
"zip": "75201",
"country": "US",
"company": "Dallas City Hall",
"address2": "",
"phone": "",
"email": "",
"addressType": "B"
},
"weight": {
"value": 6,
"unit": "lb"
},
"rates": [
{
"zone": 7,
"serviceType": "GRD",
"tnt": 7,
"baseRate": 3.92,
"totalRate": 24.47
}
],
"shipmentDate": "2023-12-22T06:34:00",
"parcelType": "P",
"serviceAttributes": [
{
"code": "AD_SIGN",
"description": "Adult Signature Required",
"rate": 3.98
}
],
"surcharges": [
{
"code": "FUEL",
"description": "Fuel Surcharge",
"rate": 5.98
}
]
}
]
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: 'Bearer <token>'},
body: JSON.stringify({
callerType: 'SHIPPER',
accounts: [{accountNumber: 'TEST_ACCOUNT_1', accountType: 'SHIPPER'}],
parcels: [
{
serviceType: 'GRD',
shipFrom: {
name: 'The City Secretary\'s Office',
address1: '1500 Marilla Street',
city: 'Dallas',
state: 'TX',
zip: '75201',
country: 'US',
company: 'Dallas City Hall',
address2: '',
phone: '',
email: '',
addressType: 'B'
},
shipTo: {
name: 'The City Secretary\'s Office',
address1: '1500 Marilla Street',
city: 'Dallas',
state: 'TX',
zip: '75201',
country: 'US',
company: 'Dallas City Hall',
address2: '',
phone: '',
email: '',
addressType: 'B'
},
weight: {value: 6, unit: 'lb'},
rates: [{zone: 7, serviceType: 'GRD', tnt: 7, baseRate: 3.92, totalRate: 24.47}],
shipmentDate: '2023-12-22T06:34:00',
parcelType: 'P',
serviceAttributes: [{code: 'AD_SIGN', description: 'Adult Signature Required', rate: 3.98}],
surcharges: [{code: 'FUEL', description: 'Fuel Surcharge', rate: 5.98}]
}
]
})
};
fetch('https://api-stage.orchestro.ai/e1/shipment-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-stage.orchestro.ai/e1/shipment-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([
'callerType' => 'SHIPPER',
'accounts' => [
[
'accountNumber' => 'TEST_ACCOUNT_1',
'accountType' => 'SHIPPER'
]
],
'parcels' => [
[
'serviceType' => 'GRD',
'shipFrom' => [
'name' => 'The City Secretary\'s Office',
'address1' => '1500 Marilla Street',
'city' => 'Dallas',
'state' => 'TX',
'zip' => '75201',
'country' => 'US',
'company' => 'Dallas City Hall',
'address2' => '',
'phone' => '',
'email' => '',
'addressType' => 'B'
],
'shipTo' => [
'name' => 'The City Secretary\'s Office',
'address1' => '1500 Marilla Street',
'city' => 'Dallas',
'state' => 'TX',
'zip' => '75201',
'country' => 'US',
'company' => 'Dallas City Hall',
'address2' => '',
'phone' => '',
'email' => '',
'addressType' => 'B'
],
'weight' => [
'value' => 6,
'unit' => 'lb'
],
'rates' => [
[
'zone' => 7,
'serviceType' => 'GRD',
'tnt' => 7,
'baseRate' => 3.92,
'totalRate' => 24.47
]
],
'shipmentDate' => '2023-12-22T06:34:00',
'parcelType' => 'P',
'serviceAttributes' => [
[
'code' => 'AD_SIGN',
'description' => 'Adult Signature Required',
'rate' => 3.98
]
],
'surcharges' => [
[
'code' => 'FUEL',
'description' => 'Fuel Surcharge',
'rate' => 5.98
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>"
],
]);
$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-stage.orchestro.ai/e1/shipment-orders"
payload := strings.NewReader("{\n \"callerType\": \"SHIPPER\",\n \"accounts\": [\n {\n \"accountNumber\": \"TEST_ACCOUNT_1\",\n \"accountType\": \"SHIPPER\"\n }\n ],\n \"parcels\": [\n {\n \"serviceType\": \"GRD\",\n \"shipFrom\": {\n \"name\": \"The City Secretary's Office\",\n \"address1\": \"1500 Marilla Street\",\n \"city\": \"Dallas\",\n \"state\": \"TX\",\n \"zip\": \"75201\",\n \"country\": \"US\",\n \"company\": \"Dallas City Hall\",\n \"address2\": \"\",\n \"phone\": \"\",\n \"email\": \"\",\n \"addressType\": \"B\"\n },\n \"shipTo\": {\n \"name\": \"The City Secretary's Office\",\n \"address1\": \"1500 Marilla Street\",\n \"city\": \"Dallas\",\n \"state\": \"TX\",\n \"zip\": \"75201\",\n \"country\": \"US\",\n \"company\": \"Dallas City Hall\",\n \"address2\": \"\",\n \"phone\": \"\",\n \"email\": \"\",\n \"addressType\": \"B\"\n },\n \"weight\": {\n \"value\": 6,\n \"unit\": \"lb\"\n },\n \"rates\": [\n {\n \"zone\": 7,\n \"serviceType\": \"GRD\",\n \"tnt\": 7,\n \"baseRate\": 3.92,\n \"totalRate\": 24.47\n }\n ],\n \"shipmentDate\": \"2023-12-22T06:34:00\",\n \"parcelType\": \"P\",\n \"serviceAttributes\": [\n {\n \"code\": \"AD_SIGN\",\n \"description\": \"Adult Signature Required\",\n \"rate\": 3.98\n }\n ],\n \"surcharges\": [\n {\n \"code\": \"FUEL\",\n \"description\": \"Fuel Surcharge\",\n \"rate\": 5.98\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "Bearer <token>")
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-stage.orchestro.ai/e1/shipment-orders")
.header("Content-Type", "<content-type>")
.header("Authorization", "Bearer <token>")
.body("{\n \"callerType\": \"SHIPPER\",\n \"accounts\": [\n {\n \"accountNumber\": \"TEST_ACCOUNT_1\",\n \"accountType\": \"SHIPPER\"\n }\n ],\n \"parcels\": [\n {\n \"serviceType\": \"GRD\",\n \"shipFrom\": {\n \"name\": \"The City Secretary's Office\",\n \"address1\": \"1500 Marilla Street\",\n \"city\": \"Dallas\",\n \"state\": \"TX\",\n \"zip\": \"75201\",\n \"country\": \"US\",\n \"company\": \"Dallas City Hall\",\n \"address2\": \"\",\n \"phone\": \"\",\n \"email\": \"\",\n \"addressType\": \"B\"\n },\n \"shipTo\": {\n \"name\": \"The City Secretary's Office\",\n \"address1\": \"1500 Marilla Street\",\n \"city\": \"Dallas\",\n \"state\": \"TX\",\n \"zip\": \"75201\",\n \"country\": \"US\",\n \"company\": \"Dallas City Hall\",\n \"address2\": \"\",\n \"phone\": \"\",\n \"email\": \"\",\n \"addressType\": \"B\"\n },\n \"weight\": {\n \"value\": 6,\n \"unit\": \"lb\"\n },\n \"rates\": [\n {\n \"zone\": 7,\n \"serviceType\": \"GRD\",\n \"tnt\": 7,\n \"baseRate\": 3.92,\n \"totalRate\": 24.47\n }\n ],\n \"shipmentDate\": \"2023-12-22T06:34:00\",\n \"parcelType\": \"P\",\n \"serviceAttributes\": [\n {\n \"code\": \"AD_SIGN\",\n \"description\": \"Adult Signature Required\",\n \"rate\": 3.98\n }\n ],\n \"surcharges\": [\n {\n \"code\": \"FUEL\",\n \"description\": \"Fuel Surcharge\",\n \"rate\": 5.98\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-stage.orchestro.ai/e1/shipment-orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"callerType\": \"SHIPPER\",\n \"accounts\": [\n {\n \"accountNumber\": \"TEST_ACCOUNT_1\",\n \"accountType\": \"SHIPPER\"\n }\n ],\n \"parcels\": [\n {\n \"serviceType\": \"GRD\",\n \"shipFrom\": {\n \"name\": \"The City Secretary's Office\",\n \"address1\": \"1500 Marilla Street\",\n \"city\": \"Dallas\",\n \"state\": \"TX\",\n \"zip\": \"75201\",\n \"country\": \"US\",\n \"company\": \"Dallas City Hall\",\n \"address2\": \"\",\n \"phone\": \"\",\n \"email\": \"\",\n \"addressType\": \"B\"\n },\n \"shipTo\": {\n \"name\": \"The City Secretary's Office\",\n \"address1\": \"1500 Marilla Street\",\n \"city\": \"Dallas\",\n \"state\": \"TX\",\n \"zip\": \"75201\",\n \"country\": \"US\",\n \"company\": \"Dallas City Hall\",\n \"address2\": \"\",\n \"phone\": \"\",\n \"email\": \"\",\n \"addressType\": \"B\"\n },\n \"weight\": {\n \"value\": 6,\n \"unit\": \"lb\"\n },\n \"rates\": [\n {\n \"zone\": 7,\n \"serviceType\": \"GRD\",\n \"tnt\": 7,\n \"baseRate\": 3.92,\n \"totalRate\": 24.47\n }\n ],\n \"shipmentDate\": \"2023-12-22T06:34:00\",\n \"parcelType\": \"P\",\n \"serviceAttributes\": [\n {\n \"code\": \"AD_SIGN\",\n \"description\": \"Adult Signature Required\",\n \"rate\": 3.98\n }\n ],\n \"surcharges\": [\n {\n \"code\": \"FUEL\",\n \"description\": \"Fuel Surcharge\",\n \"rate\": 5.98\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": "SUCCESS"
}{
"errors": [
{
"code": "ERR-3001",
"message": "Shipment Date is required."
},
{
"code": "ERR-3003",
"message": "Total number of parcels should be greater than 0."
}
]
}{
"errors": [
{
"code": "ERR-1000",
"message": "Invalid Token."
}
]
}{
"errors": [
{
"code": "ERR-2025",
"message": "We are having some issue, please resubmit the request."
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Example:
"application/json"
Example:
"Bearer token"
Body
application/json
Type of caller initiating the shipment
Available options:
SHIPPER, CARRIER, RSE Example:
"SHIPPER"
List of account details. A minimum of 1 and a maximum of 3 accounts can be provided.
Required array length:
1 - 3 elementsShow child attributes
Show child attributes
Array containing details for each parcel in the shipment. Maximum of 10 parcels allowed.
Required array length:
1 - 10 elementsShow child attributes
Show child attributes
Response
Shipment order created successfully.
Example:
"SUCCESS"
⌘I