curl --request PATCH \
--url https://{defaultHost}/v1/shipments/{id}/quote \
--header 'Authorization: Bearer <token>'import requests
url = "https://{defaultHost}/v1/shipments/{id}/quote"
headers = {"Authorization": "Bearer <token>"}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{defaultHost}/v1/shipments/{id}/quote', 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/{id}/quote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{defaultHost}/v1/shipments/{id}/quote"
req, _ := http.NewRequest("PATCH", url, nil)
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.patch("https://{defaultHost}/v1/shipments/{id}/quote")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/shipments/{id}/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "d9eca361-6df5-41bd-8cd6-bb52091bd6fb",
"object": "shipment",
"carrier": null,
"carrier_messages": [
{
"carrier": "Shippo",
"messages": [
"Carrier account shippo_sendle_account doesn't support one or more shipment options",
"Carrier account shippo_correos_account 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_dpd_uk_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_canada_post_master doesn't support one or more shipment options",
"Carrier account COURIERSPLEASE_SHIPPO_TIER_1 doesn't support one or more shipment options",
"Carrier account shippo_chronopost_account doesn't support one or more shipment options",
"Carrier account shippo_hermes_uk_account doesn't support one or more shipment options"
]
},
{
"carrier": "UPS",
"messages": [
"Shipment origin is out of service area for UPS Master account from CA",
"Hard: Too Many Requests"
]
},
{
"carrier": "DHLExpress",
"messages": [
"Shippo's DHL Express master account doesn't support shipments to inside of the US"
]
},
{
"carrier": "ShippoCommon",
"messages": [
"Shipment origin or destination state is out of the service area for LSO."
]
}
],
"contact_validations": {
"from_contact": {
"valid": false,
"messages": []
},
"to_contact": {
"valid": false,
"messages": []
}
},
"dimensions": {
"length": 10,
"width": 8,
"height": 5,
"unit": "in"
},
"customs_declaration": null,
"international": false,
"customs_required": false,
"eta": null,
"inherit_weight": false,
"label_file_type": "PDF",
"label_url": null,
"live_mode": true,
"rates": [
{
"id": "20c81380f19143c2bc35e16dd34f2f5d",
"amount": 644,
"currency": "usd",
"provider": "USPS",
"service_name": "Ground Advantage",
"estimated_days": 2,
"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": "e4456d3eac6d4297a28fa0e2bf3deeab",
"amount": 3015,
"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": "ff4b976edda046ceb3250a07cc9fc763",
"amount": 781,
"currency": "usd",
"provider": "USPS",
"service_name": "Priority Mail",
"estimated_days": 2,
"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": 1793750400,
"status": "quoted",
"tracking_number": null,
"tracking_status": null,
"tracking_url": null,
"weight": "2.0",
"weight_unit": "lb",
"carrier_parcel_template_token": null,
"from_contact": "734b7fc7-1051-4181-acd5-3ccef4681410",
"fulfillment": "76ed8f21-7146-48ed-9e9d-8ecc9f7456fe",
"parcel_template": null,
"shipping_provider": "0be1c37f-ce69-4f84-9818-84ceb35a117a",
"to_contact": "220a4372-d415-4dd6-b9e6-ed7fe40cc850",
"created_at": 1793796994,
"updated_at": 1793796994
}Quote
Fetches shipping rates for a specific shipment.
curl --request PATCH \
--url https://{defaultHost}/v1/shipments/{id}/quote \
--header 'Authorization: Bearer <token>'import requests
url = "https://{defaultHost}/v1/shipments/{id}/quote"
headers = {"Authorization": "Bearer <token>"}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{defaultHost}/v1/shipments/{id}/quote', 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/{id}/quote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{defaultHost}/v1/shipments/{id}/quote"
req, _ := http.NewRequest("PATCH", url, nil)
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.patch("https://{defaultHost}/v1/shipments/{id}/quote")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/shipments/{id}/quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "d9eca361-6df5-41bd-8cd6-bb52091bd6fb",
"object": "shipment",
"carrier": null,
"carrier_messages": [
{
"carrier": "Shippo",
"messages": [
"Carrier account shippo_sendle_account doesn't support one or more shipment options",
"Carrier account shippo_correos_account 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_dpd_uk_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_canada_post_master doesn't support one or more shipment options",
"Carrier account COURIERSPLEASE_SHIPPO_TIER_1 doesn't support one or more shipment options",
"Carrier account shippo_chronopost_account doesn't support one or more shipment options",
"Carrier account shippo_hermes_uk_account doesn't support one or more shipment options"
]
},
{
"carrier": "UPS",
"messages": [
"Shipment origin is out of service area for UPS Master account from CA",
"Hard: Too Many Requests"
]
},
{
"carrier": "DHLExpress",
"messages": [
"Shippo's DHL Express master account doesn't support shipments to inside of the US"
]
},
{
"carrier": "ShippoCommon",
"messages": [
"Shipment origin or destination state is out of the service area for LSO."
]
}
],
"contact_validations": {
"from_contact": {
"valid": false,
"messages": []
},
"to_contact": {
"valid": false,
"messages": []
}
},
"dimensions": {
"length": 10,
"width": 8,
"height": 5,
"unit": "in"
},
"customs_declaration": null,
"international": false,
"customs_required": false,
"eta": null,
"inherit_weight": false,
"label_file_type": "PDF",
"label_url": null,
"live_mode": true,
"rates": [
{
"id": "20c81380f19143c2bc35e16dd34f2f5d",
"amount": 644,
"currency": "usd",
"provider": "USPS",
"service_name": "Ground Advantage",
"estimated_days": 2,
"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": "e4456d3eac6d4297a28fa0e2bf3deeab",
"amount": 3015,
"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": "ff4b976edda046ceb3250a07cc9fc763",
"amount": 781,
"currency": "usd",
"provider": "USPS",
"service_name": "Priority Mail",
"estimated_days": 2,
"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": 1793750400,
"status": "quoted",
"tracking_number": null,
"tracking_status": null,
"tracking_url": null,
"weight": "2.0",
"weight_unit": "lb",
"carrier_parcel_template_token": null,
"from_contact": "734b7fc7-1051-4181-acd5-3ccef4681410",
"fulfillment": "76ed8f21-7146-48ed-9e9d-8ecc9f7456fe",
"parcel_template": null,
"shipping_provider": "0be1c37f-ce69-4f84-9818-84ceb35a117a",
"to_contact": "220a4372-d415-4dd6-b9e6-ed7fe40cc850",
"created_at": 1793796994,
"updated_at": 1793796994
}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?