curl --request POST \
--url https://{defaultHost}/v1/shipments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"shipment": {
"fulfillment": "d3ac1273-b7cb-4c19-a69e-bfaf41586fcd",
"shipping_provider": "38122bb4-be03-4e15-8410-405c26cd9e0b",
"inherit_weight": false,
"weight": 2,
"weight_unit": "lb",
"dimensions": {
"length": 10,
"width": 8,
"height": 5,
"unit": "in"
},
"shipping_date": "2026-11-04",
"customs_declaration": {
"certify": true,
"certify_signer": "Sender Name",
"contents_type": "MERCHANDISE",
"non_delivery_option": "RETURN",
"eel_pfc": "NOEEI_30_37_a",
"items": [
{
"description": "T-Shirt",
"quantity": 1,
"net_weight": "1",
"mass_unit": "lb",
"value_amount": "20",
"value_currency": "USD",
"origin_country": "US"
}
]
},
"from_contact": {
"name": "Sender Name",
"email": "sender@example.com",
"phone": "555-123-4567",
"address": {
"line_1": "123 Main St",
"city": "New York",
"state": "NY",
"postal_code": "10001",
"country": "US"
}
},
"to_contact": {
"name": "Receiver Name",
"email": "receiver@example.com",
"phone": "555-987-6543",
"address": {
"line_1": "456 Oak Ave",
"city": "Los Angeles",
"state": "CA",
"postal_code": "90001",
"country": "US"
}
}
}
}
'import requests
url = "https://{defaultHost}/v1/shipments"
payload = { "shipment": {
"fulfillment": "d3ac1273-b7cb-4c19-a69e-bfaf41586fcd",
"shipping_provider": "38122bb4-be03-4e15-8410-405c26cd9e0b",
"inherit_weight": False,
"weight": 2,
"weight_unit": "lb",
"dimensions": {
"length": 10,
"width": 8,
"height": 5,
"unit": "in"
},
"shipping_date": "2026-11-04",
"customs_declaration": {
"certify": True,
"certify_signer": "Sender Name",
"contents_type": "MERCHANDISE",
"non_delivery_option": "RETURN",
"eel_pfc": "NOEEI_30_37_a",
"items": [
{
"description": "T-Shirt",
"quantity": 1,
"net_weight": "1",
"mass_unit": "lb",
"value_amount": "20",
"value_currency": "USD",
"origin_country": "US"
}
]
},
"from_contact": {
"name": "Sender Name",
"email": "sender@example.com",
"phone": "555-123-4567",
"address": {
"line_1": "123 Main St",
"city": "New York",
"state": "NY",
"postal_code": "10001",
"country": "US"
}
},
"to_contact": {
"name": "Receiver Name",
"email": "receiver@example.com",
"phone": "555-987-6543",
"address": {
"line_1": "456 Oak Ave",
"city": "Los Angeles",
"state": "CA",
"postal_code": "90001",
"country": "US"
}
}
} }
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({
shipment: {
fulfillment: 'd3ac1273-b7cb-4c19-a69e-bfaf41586fcd',
shipping_provider: '38122bb4-be03-4e15-8410-405c26cd9e0b',
inherit_weight: false,
weight: 2,
weight_unit: 'lb',
dimensions: {length: 10, width: 8, height: 5, unit: 'in'},
shipping_date: '2026-11-04',
customs_declaration: {
certify: true,
certify_signer: 'Sender Name',
contents_type: 'MERCHANDISE',
non_delivery_option: 'RETURN',
eel_pfc: 'NOEEI_30_37_a',
items: [
{
description: 'T-Shirt',
quantity: 1,
net_weight: '1',
mass_unit: 'lb',
value_amount: '20',
value_currency: 'USD',
origin_country: 'US'
}
]
},
from_contact: {
name: 'Sender Name',
email: 'sender@example.com',
phone: '555-123-4567',
address: {
line_1: '123 Main St',
city: 'New York',
state: 'NY',
postal_code: '10001',
country: 'US'
}
},
to_contact: {
name: 'Receiver Name',
email: 'receiver@example.com',
phone: '555-987-6543',
address: {
line_1: '456 Oak Ave',
city: 'Los Angeles',
state: 'CA',
postal_code: '90001',
country: 'US'
}
}
}
})
};
fetch('https://{defaultHost}/v1/shipments', 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://{defaultHost}/v1/shipments",
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([
'shipment' => [
'fulfillment' => 'd3ac1273-b7cb-4c19-a69e-bfaf41586fcd',
'shipping_provider' => '38122bb4-be03-4e15-8410-405c26cd9e0b',
'inherit_weight' => false,
'weight' => 2,
'weight_unit' => 'lb',
'dimensions' => [
'length' => 10,
'width' => 8,
'height' => 5,
'unit' => 'in'
],
'shipping_date' => '2026-11-04',
'customs_declaration' => [
'certify' => true,
'certify_signer' => 'Sender Name',
'contents_type' => 'MERCHANDISE',
'non_delivery_option' => 'RETURN',
'eel_pfc' => 'NOEEI_30_37_a',
'items' => [
[
'description' => 'T-Shirt',
'quantity' => 1,
'net_weight' => '1',
'mass_unit' => 'lb',
'value_amount' => '20',
'value_currency' => 'USD',
'origin_country' => 'US'
]
]
],
'from_contact' => [
'name' => 'Sender Name',
'email' => 'sender@example.com',
'phone' => '555-123-4567',
'address' => [
'line_1' => '123 Main St',
'city' => 'New York',
'state' => 'NY',
'postal_code' => '10001',
'country' => 'US'
]
],
'to_contact' => [
'name' => 'Receiver Name',
'email' => 'receiver@example.com',
'phone' => '555-987-6543',
'address' => [
'line_1' => '456 Oak Ave',
'city' => 'Los Angeles',
'state' => 'CA',
'postal_code' => '90001',
'country' => 'US'
]
]
]
]),
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://{defaultHost}/v1/shipments"
payload := strings.NewReader("{\n \"shipment\": {\n \"fulfillment\": \"d3ac1273-b7cb-4c19-a69e-bfaf41586fcd\",\n \"shipping_provider\": \"38122bb4-be03-4e15-8410-405c26cd9e0b\",\n \"inherit_weight\": false,\n \"weight\": 2,\n \"weight_unit\": \"lb\",\n \"dimensions\": {\n \"length\": 10,\n \"width\": 8,\n \"height\": 5,\n \"unit\": \"in\"\n },\n \"shipping_date\": \"2026-11-04\",\n \"customs_declaration\": {\n \"certify\": true,\n \"certify_signer\": \"Sender Name\",\n \"contents_type\": \"MERCHANDISE\",\n \"non_delivery_option\": \"RETURN\",\n \"eel_pfc\": \"NOEEI_30_37_a\",\n \"items\": [\n {\n \"description\": \"T-Shirt\",\n \"quantity\": 1,\n \"net_weight\": \"1\",\n \"mass_unit\": \"lb\",\n \"value_amount\": \"20\",\n \"value_currency\": \"USD\",\n \"origin_country\": \"US\"\n }\n ]\n },\n \"from_contact\": {\n \"name\": \"Sender Name\",\n \"email\": \"sender@example.com\",\n \"phone\": \"555-123-4567\",\n \"address\": {\n \"line_1\": \"123 Main St\",\n \"city\": \"New York\",\n \"state\": \"NY\",\n \"postal_code\": \"10001\",\n \"country\": \"US\"\n }\n },\n \"to_contact\": {\n \"name\": \"Receiver Name\",\n \"email\": \"receiver@example.com\",\n \"phone\": \"555-987-6543\",\n \"address\": {\n \"line_1\": \"456 Oak Ave\",\n \"city\": \"Los Angeles\",\n \"state\": \"CA\",\n \"postal_code\": \"90001\",\n \"country\": \"US\"\n }\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://{defaultHost}/v1/shipments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"shipment\": {\n \"fulfillment\": \"d3ac1273-b7cb-4c19-a69e-bfaf41586fcd\",\n \"shipping_provider\": \"38122bb4-be03-4e15-8410-405c26cd9e0b\",\n \"inherit_weight\": false,\n \"weight\": 2,\n \"weight_unit\": \"lb\",\n \"dimensions\": {\n \"length\": 10,\n \"width\": 8,\n \"height\": 5,\n \"unit\": \"in\"\n },\n \"shipping_date\": \"2026-11-04\",\n \"customs_declaration\": {\n \"certify\": true,\n \"certify_signer\": \"Sender Name\",\n \"contents_type\": \"MERCHANDISE\",\n \"non_delivery_option\": \"RETURN\",\n \"eel_pfc\": \"NOEEI_30_37_a\",\n \"items\": [\n {\n \"description\": \"T-Shirt\",\n \"quantity\": 1,\n \"net_weight\": \"1\",\n \"mass_unit\": \"lb\",\n \"value_amount\": \"20\",\n \"value_currency\": \"USD\",\n \"origin_country\": \"US\"\n }\n ]\n },\n \"from_contact\": {\n \"name\": \"Sender Name\",\n \"email\": \"sender@example.com\",\n \"phone\": \"555-123-4567\",\n \"address\": {\n \"line_1\": \"123 Main St\",\n \"city\": \"New York\",\n \"state\": \"NY\",\n \"postal_code\": \"10001\",\n \"country\": \"US\"\n }\n },\n \"to_contact\": {\n \"name\": \"Receiver Name\",\n \"email\": \"receiver@example.com\",\n \"phone\": \"555-987-6543\",\n \"address\": {\n \"line_1\": \"456 Oak Ave\",\n \"city\": \"Los Angeles\",\n \"state\": \"CA\",\n \"postal_code\": \"90001\",\n \"country\": \"US\"\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/shipments")
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 \"shipment\": {\n \"fulfillment\": \"d3ac1273-b7cb-4c19-a69e-bfaf41586fcd\",\n \"shipping_provider\": \"38122bb4-be03-4e15-8410-405c26cd9e0b\",\n \"inherit_weight\": false,\n \"weight\": 2,\n \"weight_unit\": \"lb\",\n \"dimensions\": {\n \"length\": 10,\n \"width\": 8,\n \"height\": 5,\n \"unit\": \"in\"\n },\n \"shipping_date\": \"2026-11-04\",\n \"customs_declaration\": {\n \"certify\": true,\n \"certify_signer\": \"Sender Name\",\n \"contents_type\": \"MERCHANDISE\",\n \"non_delivery_option\": \"RETURN\",\n \"eel_pfc\": \"NOEEI_30_37_a\",\n \"items\": [\n {\n \"description\": \"T-Shirt\",\n \"quantity\": 1,\n \"net_weight\": \"1\",\n \"mass_unit\": \"lb\",\n \"value_amount\": \"20\",\n \"value_currency\": \"USD\",\n \"origin_country\": \"US\"\n }\n ]\n },\n \"from_contact\": {\n \"name\": \"Sender Name\",\n \"email\": \"sender@example.com\",\n \"phone\": \"555-123-4567\",\n \"address\": {\n \"line_1\": \"123 Main St\",\n \"city\": \"New York\",\n \"state\": \"NY\",\n \"postal_code\": \"10001\",\n \"country\": \"US\"\n }\n },\n \"to_contact\": {\n \"name\": \"Receiver Name\",\n \"email\": \"receiver@example.com\",\n \"phone\": \"555-987-6543\",\n \"address\": {\n \"line_1\": \"456 Oak Ave\",\n \"city\": \"Los Angeles\",\n \"state\": \"CA\",\n \"postal_code\": \"90001\",\n \"country\": \"US\"\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "1556a10e-bad9-4a13-bd9f-212f2f7c2cf1",
"object": "shipment",
"carrier": null,
"carrier_messages": [
{
"carrier": "UPS",
"messages": [
"Shipment origin is out of service area for UPS Master account from CA",
"Hard: Too Many Requests"
]
},
{
"carrier": "Shippo",
"messages": [
"Carrier account COURIERSPLEASE_SHIPPO_TIER_1 doesn't support one or more shipment options",
"Carrier account shippo_canada_post_master doesn't support one or more shipment options",
"Carrier account shippo_dpd_de_account doesn't support one or more shipment options",
"Carrier account shippo_colissimo_account doesn't support one or more shipment options",
"Carrier account shippo_deutsche_post_account doesn't support one or more shipment options",
"Carrier account shippo_hermes_uk_account doesn't support one or more shipment options",
"Carrier account shippo_dpd_uk_account doesn't support one or more shipment options",
"Carrier account shippo_sendle_account doesn't support one or more shipment options",
"Carrier account shippo_chronopost_account doesn't support one or more shipment options",
"Carrier account shippo_correos_account doesn't support one or more shipment options"
]
},
{
"carrier": "ShippoCommon",
"messages": [
"Shipment origin or destination state is out of the service area for LSO."
]
},
{
"carrier": "DHLExpress",
"messages": [
"Shippo's DHL Express master account doesn't support shipments to inside of the US"
]
}
],
"contact_validations": {
"from_contact": {
"valid": false,
"messages": []
},
"to_contact": {
"valid": false,
"messages": []
}
},
"dimensions": {
"length": 10,
"width": 8,
"height": 5,
"unit": "in"
},
"customs_declaration": {
"certify": true,
"certify_signer": "Sender Name",
"contents_type": "MERCHANDISE",
"non_delivery_option": "RETURN",
"eel_pfc": "NOEEI_30_37_a",
"items": [
{
"description": "T-Shirt",
"quantity": 1,
"net_weight": "1",
"mass_unit": "lb",
"value_amount": "20",
"value_currency": "USD",
"origin_country": "US"
}
]
},
"international": false,
"customs_required": false,
"eta": null,
"inherit_weight": false,
"label_file_type": "PDF",
"label_url": null,
"live_mode": true,
"rates": [
{
"id": "84ce975efab7429088b5c5d15aee74af",
"amount": 1129,
"currency": "usd",
"provider": "USPS",
"service_name": "Ground Advantage",
"estimated_days": 5,
"tags": [
"cheapest",
"bestvalue"
],
"duration_terms": "Delivery in 2 to 5 days.",
"provider_logo_url": "https://shippo-static.s3.amazonaws.com/providers/75/USPS.png"
},
{
"id": "8ba164f7fce04ea6915beef12aab885b",
"amount": 6670,
"currency": "usd",
"provider": "USPS",
"service_name": "Priority Mail Express",
"estimated_days": 1,
"tags": [
"fastest"
],
"duration_terms": "Overnight delivery to most U.S. locations.",
"provider_logo_url": "https://shippo-static.s3.amazonaws.com/providers/75/USPS.png"
},
{
"id": "2d9747593349433898d9a6a0f820a742",
"amount": 1699,
"currency": "usd",
"provider": "USPS",
"service_name": "Priority Mail",
"estimated_days": 3,
"tags": [],
"duration_terms": "Delivery within 1, 2, or 3 days based on where your package started and where it’s being sent.",
"provider_logo_url": "https://shippo-static.s3.amazonaws.com/providers/75/USPS.png"
}
],
"selected_rate": null,
"shipping_date": 1793664000,
"status": "quoted",
"tracking_number": null,
"tracking_status": null,
"tracking_url": null,
"weight": "2.0",
"weight_unit": "lb",
"carrier_parcel_template_token": null,
"from_contact": "e9b86c47-21f3-44b7-98db-e23c6b30da61",
"fulfillment": "d3ac1273-b7cb-4c19-a69e-bfaf41586fcd",
"parcel_template": null,
"shipping_provider": "38122bb4-be03-4e15-8410-405c26cd9e0b",
"to_contact": "be356da6-dd41-410d-b8d9-b912b7266932",
"created_at": 1793796991,
"updated_at": 1793796991
}Create
Creates a new shipment.
curl --request POST \
--url https://{defaultHost}/v1/shipments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"shipment": {
"fulfillment": "d3ac1273-b7cb-4c19-a69e-bfaf41586fcd",
"shipping_provider": "38122bb4-be03-4e15-8410-405c26cd9e0b",
"inherit_weight": false,
"weight": 2,
"weight_unit": "lb",
"dimensions": {
"length": 10,
"width": 8,
"height": 5,
"unit": "in"
},
"shipping_date": "2026-11-04",
"customs_declaration": {
"certify": true,
"certify_signer": "Sender Name",
"contents_type": "MERCHANDISE",
"non_delivery_option": "RETURN",
"eel_pfc": "NOEEI_30_37_a",
"items": [
{
"description": "T-Shirt",
"quantity": 1,
"net_weight": "1",
"mass_unit": "lb",
"value_amount": "20",
"value_currency": "USD",
"origin_country": "US"
}
]
},
"from_contact": {
"name": "Sender Name",
"email": "sender@example.com",
"phone": "555-123-4567",
"address": {
"line_1": "123 Main St",
"city": "New York",
"state": "NY",
"postal_code": "10001",
"country": "US"
}
},
"to_contact": {
"name": "Receiver Name",
"email": "receiver@example.com",
"phone": "555-987-6543",
"address": {
"line_1": "456 Oak Ave",
"city": "Los Angeles",
"state": "CA",
"postal_code": "90001",
"country": "US"
}
}
}
}
'import requests
url = "https://{defaultHost}/v1/shipments"
payload = { "shipment": {
"fulfillment": "d3ac1273-b7cb-4c19-a69e-bfaf41586fcd",
"shipping_provider": "38122bb4-be03-4e15-8410-405c26cd9e0b",
"inherit_weight": False,
"weight": 2,
"weight_unit": "lb",
"dimensions": {
"length": 10,
"width": 8,
"height": 5,
"unit": "in"
},
"shipping_date": "2026-11-04",
"customs_declaration": {
"certify": True,
"certify_signer": "Sender Name",
"contents_type": "MERCHANDISE",
"non_delivery_option": "RETURN",
"eel_pfc": "NOEEI_30_37_a",
"items": [
{
"description": "T-Shirt",
"quantity": 1,
"net_weight": "1",
"mass_unit": "lb",
"value_amount": "20",
"value_currency": "USD",
"origin_country": "US"
}
]
},
"from_contact": {
"name": "Sender Name",
"email": "sender@example.com",
"phone": "555-123-4567",
"address": {
"line_1": "123 Main St",
"city": "New York",
"state": "NY",
"postal_code": "10001",
"country": "US"
}
},
"to_contact": {
"name": "Receiver Name",
"email": "receiver@example.com",
"phone": "555-987-6543",
"address": {
"line_1": "456 Oak Ave",
"city": "Los Angeles",
"state": "CA",
"postal_code": "90001",
"country": "US"
}
}
} }
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({
shipment: {
fulfillment: 'd3ac1273-b7cb-4c19-a69e-bfaf41586fcd',
shipping_provider: '38122bb4-be03-4e15-8410-405c26cd9e0b',
inherit_weight: false,
weight: 2,
weight_unit: 'lb',
dimensions: {length: 10, width: 8, height: 5, unit: 'in'},
shipping_date: '2026-11-04',
customs_declaration: {
certify: true,
certify_signer: 'Sender Name',
contents_type: 'MERCHANDISE',
non_delivery_option: 'RETURN',
eel_pfc: 'NOEEI_30_37_a',
items: [
{
description: 'T-Shirt',
quantity: 1,
net_weight: '1',
mass_unit: 'lb',
value_amount: '20',
value_currency: 'USD',
origin_country: 'US'
}
]
},
from_contact: {
name: 'Sender Name',
email: 'sender@example.com',
phone: '555-123-4567',
address: {
line_1: '123 Main St',
city: 'New York',
state: 'NY',
postal_code: '10001',
country: 'US'
}
},
to_contact: {
name: 'Receiver Name',
email: 'receiver@example.com',
phone: '555-987-6543',
address: {
line_1: '456 Oak Ave',
city: 'Los Angeles',
state: 'CA',
postal_code: '90001',
country: 'US'
}
}
}
})
};
fetch('https://{defaultHost}/v1/shipments', 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://{defaultHost}/v1/shipments",
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([
'shipment' => [
'fulfillment' => 'd3ac1273-b7cb-4c19-a69e-bfaf41586fcd',
'shipping_provider' => '38122bb4-be03-4e15-8410-405c26cd9e0b',
'inherit_weight' => false,
'weight' => 2,
'weight_unit' => 'lb',
'dimensions' => [
'length' => 10,
'width' => 8,
'height' => 5,
'unit' => 'in'
],
'shipping_date' => '2026-11-04',
'customs_declaration' => [
'certify' => true,
'certify_signer' => 'Sender Name',
'contents_type' => 'MERCHANDISE',
'non_delivery_option' => 'RETURN',
'eel_pfc' => 'NOEEI_30_37_a',
'items' => [
[
'description' => 'T-Shirt',
'quantity' => 1,
'net_weight' => '1',
'mass_unit' => 'lb',
'value_amount' => '20',
'value_currency' => 'USD',
'origin_country' => 'US'
]
]
],
'from_contact' => [
'name' => 'Sender Name',
'email' => 'sender@example.com',
'phone' => '555-123-4567',
'address' => [
'line_1' => '123 Main St',
'city' => 'New York',
'state' => 'NY',
'postal_code' => '10001',
'country' => 'US'
]
],
'to_contact' => [
'name' => 'Receiver Name',
'email' => 'receiver@example.com',
'phone' => '555-987-6543',
'address' => [
'line_1' => '456 Oak Ave',
'city' => 'Los Angeles',
'state' => 'CA',
'postal_code' => '90001',
'country' => 'US'
]
]
]
]),
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://{defaultHost}/v1/shipments"
payload := strings.NewReader("{\n \"shipment\": {\n \"fulfillment\": \"d3ac1273-b7cb-4c19-a69e-bfaf41586fcd\",\n \"shipping_provider\": \"38122bb4-be03-4e15-8410-405c26cd9e0b\",\n \"inherit_weight\": false,\n \"weight\": 2,\n \"weight_unit\": \"lb\",\n \"dimensions\": {\n \"length\": 10,\n \"width\": 8,\n \"height\": 5,\n \"unit\": \"in\"\n },\n \"shipping_date\": \"2026-11-04\",\n \"customs_declaration\": {\n \"certify\": true,\n \"certify_signer\": \"Sender Name\",\n \"contents_type\": \"MERCHANDISE\",\n \"non_delivery_option\": \"RETURN\",\n \"eel_pfc\": \"NOEEI_30_37_a\",\n \"items\": [\n {\n \"description\": \"T-Shirt\",\n \"quantity\": 1,\n \"net_weight\": \"1\",\n \"mass_unit\": \"lb\",\n \"value_amount\": \"20\",\n \"value_currency\": \"USD\",\n \"origin_country\": \"US\"\n }\n ]\n },\n \"from_contact\": {\n \"name\": \"Sender Name\",\n \"email\": \"sender@example.com\",\n \"phone\": \"555-123-4567\",\n \"address\": {\n \"line_1\": \"123 Main St\",\n \"city\": \"New York\",\n \"state\": \"NY\",\n \"postal_code\": \"10001\",\n \"country\": \"US\"\n }\n },\n \"to_contact\": {\n \"name\": \"Receiver Name\",\n \"email\": \"receiver@example.com\",\n \"phone\": \"555-987-6543\",\n \"address\": {\n \"line_1\": \"456 Oak Ave\",\n \"city\": \"Los Angeles\",\n \"state\": \"CA\",\n \"postal_code\": \"90001\",\n \"country\": \"US\"\n }\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://{defaultHost}/v1/shipments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"shipment\": {\n \"fulfillment\": \"d3ac1273-b7cb-4c19-a69e-bfaf41586fcd\",\n \"shipping_provider\": \"38122bb4-be03-4e15-8410-405c26cd9e0b\",\n \"inherit_weight\": false,\n \"weight\": 2,\n \"weight_unit\": \"lb\",\n \"dimensions\": {\n \"length\": 10,\n \"width\": 8,\n \"height\": 5,\n \"unit\": \"in\"\n },\n \"shipping_date\": \"2026-11-04\",\n \"customs_declaration\": {\n \"certify\": true,\n \"certify_signer\": \"Sender Name\",\n \"contents_type\": \"MERCHANDISE\",\n \"non_delivery_option\": \"RETURN\",\n \"eel_pfc\": \"NOEEI_30_37_a\",\n \"items\": [\n {\n \"description\": \"T-Shirt\",\n \"quantity\": 1,\n \"net_weight\": \"1\",\n \"mass_unit\": \"lb\",\n \"value_amount\": \"20\",\n \"value_currency\": \"USD\",\n \"origin_country\": \"US\"\n }\n ]\n },\n \"from_contact\": {\n \"name\": \"Sender Name\",\n \"email\": \"sender@example.com\",\n \"phone\": \"555-123-4567\",\n \"address\": {\n \"line_1\": \"123 Main St\",\n \"city\": \"New York\",\n \"state\": \"NY\",\n \"postal_code\": \"10001\",\n \"country\": \"US\"\n }\n },\n \"to_contact\": {\n \"name\": \"Receiver Name\",\n \"email\": \"receiver@example.com\",\n \"phone\": \"555-987-6543\",\n \"address\": {\n \"line_1\": \"456 Oak Ave\",\n \"city\": \"Los Angeles\",\n \"state\": \"CA\",\n \"postal_code\": \"90001\",\n \"country\": \"US\"\n }\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/shipments")
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 \"shipment\": {\n \"fulfillment\": \"d3ac1273-b7cb-4c19-a69e-bfaf41586fcd\",\n \"shipping_provider\": \"38122bb4-be03-4e15-8410-405c26cd9e0b\",\n \"inherit_weight\": false,\n \"weight\": 2,\n \"weight_unit\": \"lb\",\n \"dimensions\": {\n \"length\": 10,\n \"width\": 8,\n \"height\": 5,\n \"unit\": \"in\"\n },\n \"shipping_date\": \"2026-11-04\",\n \"customs_declaration\": {\n \"certify\": true,\n \"certify_signer\": \"Sender Name\",\n \"contents_type\": \"MERCHANDISE\",\n \"non_delivery_option\": \"RETURN\",\n \"eel_pfc\": \"NOEEI_30_37_a\",\n \"items\": [\n {\n \"description\": \"T-Shirt\",\n \"quantity\": 1,\n \"net_weight\": \"1\",\n \"mass_unit\": \"lb\",\n \"value_amount\": \"20\",\n \"value_currency\": \"USD\",\n \"origin_country\": \"US\"\n }\n ]\n },\n \"from_contact\": {\n \"name\": \"Sender Name\",\n \"email\": \"sender@example.com\",\n \"phone\": \"555-123-4567\",\n \"address\": {\n \"line_1\": \"123 Main St\",\n \"city\": \"New York\",\n \"state\": \"NY\",\n \"postal_code\": \"10001\",\n \"country\": \"US\"\n }\n },\n \"to_contact\": {\n \"name\": \"Receiver Name\",\n \"email\": \"receiver@example.com\",\n \"phone\": \"555-987-6543\",\n \"address\": {\n \"line_1\": \"456 Oak Ave\",\n \"city\": \"Los Angeles\",\n \"state\": \"CA\",\n \"postal_code\": \"90001\",\n \"country\": \"US\"\n }\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "1556a10e-bad9-4a13-bd9f-212f2f7c2cf1",
"object": "shipment",
"carrier": null,
"carrier_messages": [
{
"carrier": "UPS",
"messages": [
"Shipment origin is out of service area for UPS Master account from CA",
"Hard: Too Many Requests"
]
},
{
"carrier": "Shippo",
"messages": [
"Carrier account COURIERSPLEASE_SHIPPO_TIER_1 doesn't support one or more shipment options",
"Carrier account shippo_canada_post_master doesn't support one or more shipment options",
"Carrier account shippo_dpd_de_account doesn't support one or more shipment options",
"Carrier account shippo_colissimo_account doesn't support one or more shipment options",
"Carrier account shippo_deutsche_post_account doesn't support one or more shipment options",
"Carrier account shippo_hermes_uk_account doesn't support one or more shipment options",
"Carrier account shippo_dpd_uk_account doesn't support one or more shipment options",
"Carrier account shippo_sendle_account doesn't support one or more shipment options",
"Carrier account shippo_chronopost_account doesn't support one or more shipment options",
"Carrier account shippo_correos_account doesn't support one or more shipment options"
]
},
{
"carrier": "ShippoCommon",
"messages": [
"Shipment origin or destination state is out of the service area for LSO."
]
},
{
"carrier": "DHLExpress",
"messages": [
"Shippo's DHL Express master account doesn't support shipments to inside of the US"
]
}
],
"contact_validations": {
"from_contact": {
"valid": false,
"messages": []
},
"to_contact": {
"valid": false,
"messages": []
}
},
"dimensions": {
"length": 10,
"width": 8,
"height": 5,
"unit": "in"
},
"customs_declaration": {
"certify": true,
"certify_signer": "Sender Name",
"contents_type": "MERCHANDISE",
"non_delivery_option": "RETURN",
"eel_pfc": "NOEEI_30_37_a",
"items": [
{
"description": "T-Shirt",
"quantity": 1,
"net_weight": "1",
"mass_unit": "lb",
"value_amount": "20",
"value_currency": "USD",
"origin_country": "US"
}
]
},
"international": false,
"customs_required": false,
"eta": null,
"inherit_weight": false,
"label_file_type": "PDF",
"label_url": null,
"live_mode": true,
"rates": [
{
"id": "84ce975efab7429088b5c5d15aee74af",
"amount": 1129,
"currency": "usd",
"provider": "USPS",
"service_name": "Ground Advantage",
"estimated_days": 5,
"tags": [
"cheapest",
"bestvalue"
],
"duration_terms": "Delivery in 2 to 5 days.",
"provider_logo_url": "https://shippo-static.s3.amazonaws.com/providers/75/USPS.png"
},
{
"id": "8ba164f7fce04ea6915beef12aab885b",
"amount": 6670,
"currency": "usd",
"provider": "USPS",
"service_name": "Priority Mail Express",
"estimated_days": 1,
"tags": [
"fastest"
],
"duration_terms": "Overnight delivery to most U.S. locations.",
"provider_logo_url": "https://shippo-static.s3.amazonaws.com/providers/75/USPS.png"
},
{
"id": "2d9747593349433898d9a6a0f820a742",
"amount": 1699,
"currency": "usd",
"provider": "USPS",
"service_name": "Priority Mail",
"estimated_days": 3,
"tags": [],
"duration_terms": "Delivery within 1, 2, or 3 days based on where your package started and where it’s being sent.",
"provider_logo_url": "https://shippo-static.s3.amazonaws.com/providers/75/USPS.png"
}
],
"selected_rate": null,
"shipping_date": 1793664000,
"status": "quoted",
"tracking_number": null,
"tracking_status": null,
"tracking_url": null,
"weight": "2.0",
"weight_unit": "lb",
"carrier_parcel_template_token": null,
"from_contact": "e9b86c47-21f3-44b7-98db-e23c6b30da61",
"fulfillment": "d3ac1273-b7cb-4c19-a69e-bfaf41586fcd",
"parcel_template": null,
"shipping_provider": "38122bb4-be03-4e15-8410-405c26cd9e0b",
"to_contact": "be356da6-dd41-410d-b8d9-b912b7266932",
"created_at": 1793796991,
"updated_at": 1793796991
}Authorizations
Response
Success
Expandable – The associated parcel template ID.
The token of a carrier parcel template (e.g. USPS_SmallFlatRateBox), resolved against this shipment's own shipping provider. Defaults to the parcel template's token when parcel_template is set, and can be cleared or overridden by passing it explicitly. When it resolves to a fixed-size package its dimensions are used, and quoted rates cover only that carrier — read the carrier itself from the parcel template, or from the selected rate once one is chosen. Cannot be changed after the label is purchased.
Expandable – The associated fulfillment ID.
Expandable – The associated shipping provider ID.
Expandable – The associated contact ID.
Expandable – The associated contact ID.
Was this page helpful?