Reference API Reference Shipments This section describes the shipment functions for the Shipitor API.
User actions
Get Shipments
Get all shipments
GET
https://api.shipitor.com/shipments/usa
View all your shipments in the USA.
200 Successfully Listed Shipments 401: Unauthorized Authentication or Server error 500: Internal Server Error Server error and there was some other error.
Copy {
"success": true,
"shipments": [
{
"sender": "XXXXX",
"recipient": "XXXXX",
"sender_phone": "XXXXX",
"recipient_phone": "XXXXX",
"country": "US",
"service_speed": "UPS Next Day Air Early",
"package_weight": "120",
"description": "Goods",
"tracking": "XXXXX",
"labelPdfUrl": "XXXXX",
"_id": "XXXXX"
}
]
}
Copy {
"success": false,
"error": "Invalid token"
}
Create Shipment
To create a shipment, you must have the senders, recipient, and package information ready.
Notices:
Length (in inches), must be under 30 inches.
Width (in inches), must be under 40 inches.
Height (in inches), must be under 32 inches.
Weight (in pounds), must be under 120 lbs.
For Saturday delivery, the shipment cannot be UPS Next Day Early or UPS Next Day Early Signature
Create a shipment
POST
api.shipitor.com/shipment/usa/create
Create a shipment, requires shipment and package information.
Request Body
Sender or return information
Secondary Address (Apartment, Room, Floor, Box, Suite number)
State of Address (USA only)
Sender's zipcode (five digits)
Company of sender (either company or name is required)
Name of sender (either company or name is required)
10 digit phone number (no spaces or dashes)
Name of recipient (either company or name is required)
Company of recipient (either company or name is required)
Recipient's Primary Address
Secondary Address (Apartment, Room, Floor, Box, Suite number)
State of Address (USA only)
Recipient's zipcode (five digits)
10 digit phone number (no spaces or dashes)
Length (in inches), must be under 30 inches.
Width (in inches), must be under 40 inches.
Height (in inches), must be under 32 inches.
Weight (in pounds), must be under 120 lbs.
Description of item or order information
Leave as is [], or contact for more information.
True or False (allow Saturday delievery at the address).
200 Shipment Created 401: Unauthorized Authentication or Server error 500: Internal Server Error Server error and there was some other error.
Copy {
"success": true,
"tracking": "XXXX",
"labelPdfUrl": "XXX.pdf",
"payload": {
"country": "US",
"service_speed": "UPS Next Day Air Early",
"sender": {
"name": "XXX",
"company": "XXX LLC",
"address1": "XXX Road",
"address2": "",
"city": "XXXX",
"state": "XX",
"postal_code": "XXXXX",
"phone": "XXXXXXXXX"
},
"recipient": {
"name": "XXX",
"company": "XXX LLC",
"address1": "XXX Road",
"address2": "",
"city": "XXXX",
"state": "XX",
"postal_code": "XXXXX",
"phone": "XXXXXXXXX"
},
"package": {
"length": "30",
"width": "40",
"height": "32",
"weight": "120",
"description": "XXXX",
"references": [],
"saturday_delivery": false
}
}
}
Copy {
"success": false,
"error": "Invalid API Key"
}
curl Javascript Python
Copy curl --request POST \
--url http://api.shipitor.com/shipment/usa/create \
--header 'Content-Type: application/json' \
--header 'x-api-key: YOUR API KEY' \
--data '{
"speed": "UPS Next Day Air Early",
"sender": {
"name": "XXX",
"company": "XXX",
"address": "XXX",
"address2": "",
"city": "XXX",
"state": "XX",
"zipcode": "XXX",
"phone": "XXX"
},
"recipient": {
"name": "XXX",
"company": "XXX",
"address": "XXX",
"address2": "",
"city": "XXX",
"state": "XXX",
"zipcode": "XXX",
"phone": "XXX"
},
"package": {
"length": "30",
"width": "40",
"height": "32",
"weight": "120",
"description": "XXX",
"references": [],
"saturday_delivery": false
}
}'
Copy import axios from "axios";
const options = {
method: 'POST',
url: 'http://api.shipitor.com/shipment/usa/create',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR API KEY'
},
data: {
speed: 'UPS Next Day Air Early',
sender: {
name: 'XXX',
company: 'XXX',
address: 'XXX',
address2: '',
city: 'XXX',
state: 'XXX',
zipcode: 'XXX',
phone: 'XXX'
},
recipient: {
name: 'XXX',
company: 'XXX',
address: 'XXX',
address2: '',
city: 'XXX',
state: 'XXX',
zipcode: 'XXX',
phone: 'XXX'
},
package: {
length: '30',
width: '40',
height: '32',
weight: '120',
description: 'XXX',
references: [],
saturday_delivery: false
}
}
};
axios.request(options).then(function (response) {
console.log(response.data);
}).catch(function (error) {
console.error(error);
});
Copy import requests
url = "http://api.shipitor.com/shipment/usa/create"
payload = {
"speed": "UPS Next Day Air Early",
"sender": {
"name": "XXX",
"company": "XXX",
"address": "XXX",
"address2": "",
"city": "XXX",
"state": "XX",
"zipcode": "XXX",
"phone": "XXX"
},
"recipient": {
"name": "XXXX",
"company": "XXXX",
"address": "XXXX Road",
"address2": "",
"city": "XXXX",
"state": "XXXX",
"zipcode": "XXXX",
"phone": "XXXX"
},
"package": {
"length": "30",
"width": "40",
"height": "32",
"weight": "XXX",
"description": "XXXX",
"references": [],
"saturday_delivery": False
}
}
headers = {
"Content-Type": "application/json",
"x-api-key": "YOUR API KEY"
}
response = requests.request("POST", url, json=payload, headers=headers)
print(response.text)
Your shipment will be created and the tracking number provided, as well as a link to download/view your label in PDF format. You can see your shipments with the /shipments/usa API endpoint as long as you provide your API key.