API Docs
  • Welcome!
  • Quick Start
  • Reference
    • API Reference
      • Auth
      • Shipments
Powered by GitBook
On this page
  • User actions
  • Get Shipments
  • Get all shipments
  • Create Shipment
  • Create a shipment
  1. Reference
  2. 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.

Headers

Name
Type
Description

x-api-key*

string

API Key

{
	"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"
		}
	]
}
{
	"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.

Headers

Name
Type
Description

x-api-key*

string

API Key

Request Body

Name
Type
Description

speed*

String

Shipping speed and type.

sender*

Object

Sender or return information

address2

String

Secondary Address (Apartment, Room, Floor, Box, Suite number)

state*

String

State of Address (USA only)

zipcode*

String

Sender's zipcode (five digits)

address*

String

Sender's Primary Address

company

String

Company of sender (either company or name is required)

name

String

Name of sender (either company or name is required)

phone*

String

10 digit phone number (no spaces or dashes)

recipient

Object

Recipient information

name

String

Name of recipient (either company or name is required)

company

String

Company of recipient (either company or name is required)

address*

String

Recipient's Primary Address

address2

String

Secondary Address (Apartment, Room, Floor, Box, Suite number)

city*

String

Recipient's City

state*

String

State of Address (USA only)

zipcode*

String

Recipient's zipcode (five digits)

phone*

String

10 digit phone number (no spaces or dashes)

city*

String

Sender's City

package*

Object

Package Information

length*

String

Length (in inches), must be under 30 inches.

width*

String

Width (in inches), must be under 40 inches.

height*

String

Height (in inches), must be under 32 inches.

weight*

String

Weight (in pounds), must be under 120 lbs.

description*

String

Description of item or order information

references*

String

Leave as is [], or contact for more information.

saturday_delivery*

Boolean

True or False (allow Saturday delievery at the address).

{
    "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
        }
    }
}
{
	"success": false,
	"error": "Invalid API Key"
}

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
  }
}'
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);
});
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.

PreviousAuth

Last updated 1 year ago