cURL
curl https://api.goshippo.com/shipments/5e40ead7cffe4cc1ad45108696162e42/rates/USD \
-H "Authorization: ShippoToken <API_TOKEN>"import shippo
s = shippo.Shippo(
api_key_header='ShippoToken <API_TOKEN>',
shippo_api_version='2018-02-08',
)
res = s.rates.list_shipment_rates(shipment_id='<id>')
if res is not None:
# handle response
passimport { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken <API_TOKEN>",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.rates.listShipmentRates("<id>");
// Handle the result
console.log(result);
}
run();declare(strict_types=1);
require 'vendor/autoload.php';
use Shippo\API;
use Shippo\API\Models\Operations;
$sdk = API\Shippo::builder()
->setSecurity(
'ShippoToken <API_TOKEN>'
)
->setShippoApiVersion('2018-02-08')
->build();
$request = new Operations\ListShipmentRatesRequest(
shipmentId: '<id>',
);
$response = $sdk->rates->listShipmentRates(
request: $request
);
if ($response->ratePaginatedList !== null) {
// handle response
}using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken <API_TOKEN>",
shippoApiVersion: "2018-02-08"
);
ListShipmentRatesRequest req = new ListShipmentRatesRequest() {
ShipmentId = "<id>",
};
var res = await sdk.Rates.ListShipmentRatesAsync(req);
// handle responsepackage hello.world;
import com.goshippo.shippo_sdk.Shippo;
import com.goshippo.shippo_sdk.models.operations.ListShipmentRatesResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
Shippo sdk = Shippo.builder()
.apiKeyHeader("ShippoToken <API_TOKEN>")
.shippoApiVersion("2018-02-08")
.build();
ListShipmentRatesResponse res = sdk.rates().listShipmentRates()
.shipmentId("<id>")
.page(1L)
.results(25L)
.shippoApiVersion("2018-02-08")
.call();
if (res.ratePaginatedList().isPresent()) {
// handle response
}
}
}const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.goshippo.com/shipments/{ShipmentId}/rates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.goshippo.com/shipments/{ShipmentId}/rates"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.goshippo.com/shipments/{ShipmentId}/rates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"next": "baseurl?page=3&results=10",
"previous": "baseurl?page=1&results=10",
"results": [
{
"amount": "5.5",
"amount_local": "5.5",
"currency": "USD",
"currency_local": "USD",
"attributes": [
"BESTVALUE"
],
"carrier_account": "078870331023437cb917f5187429b093",
"object_created": "2023-11-07T05:31:56Z",
"object_id": "adcfdddf8ec64b84ad22772bce3ea37a",
"object_owner": "pp@gmail.com",
"provider": "USPS",
"servicelevel": {
"name": "Priority Mail Express",
"terms": "ONERATE",
"token": "usps_priority_express",
"extended_token": "<string>",
"parent_servicelevel": {
"name": "Priority Mail Express",
"terms": "ONERATE",
"token": "usps_priority_express",
"extended_token": "<string>"
}
},
"shipment": "adcfdddf8ec64b84ad22772bce3ea37a",
"arrives_by": "08:30:00",
"duration_terms": "Delivery in 1 to 3 business days",
"estimated_days": 2,
"included_insurance_price": "1.05",
"messages": [
{
"source": "UPS",
"code": "carrier_timeout",
"text": "UPS API did not respond. Please try again in a few minutes."
}
],
"provider_image_75": "https://cdn2.goshippo.com/providers/75/USPS.png",
"provider_image_200": "https://cdn2.goshippo.com/providers/200/USPS.png",
"test": true,
"zone": "1"
}
]
}{}Rates
Retrieve shipment rates
Returns a paginated list of rates associated with a shipment. Rates for shipments older than 390 days are not returned.
GET
/
shipments
/
{ShipmentId}
/
rates
cURL
curl https://api.goshippo.com/shipments/5e40ead7cffe4cc1ad45108696162e42/rates/USD \
-H "Authorization: ShippoToken <API_TOKEN>"import shippo
s = shippo.Shippo(
api_key_header='ShippoToken <API_TOKEN>',
shippo_api_version='2018-02-08',
)
res = s.rates.list_shipment_rates(shipment_id='<id>')
if res is not None:
# handle response
passimport { Shippo } from "shippo";
const shippo = new Shippo({
apiKeyHeader: "ShippoToken <API_TOKEN>",
shippoApiVersion: "2018-02-08",
});
async function run() {
const result = await shippo.rates.listShipmentRates("<id>");
// Handle the result
console.log(result);
}
run();declare(strict_types=1);
require 'vendor/autoload.php';
use Shippo\API;
use Shippo\API\Models\Operations;
$sdk = API\Shippo::builder()
->setSecurity(
'ShippoToken <API_TOKEN>'
)
->setShippoApiVersion('2018-02-08')
->build();
$request = new Operations\ListShipmentRatesRequest(
shipmentId: '<id>',
);
$response = $sdk->rates->listShipmentRates(
request: $request
);
if ($response->ratePaginatedList !== null) {
// handle response
}using Shippo;
using Shippo.Models.Components;
using Shippo.Models.Requests;
var sdk = new ShippoSDK(
apiKeyHeader: "ShippoToken <API_TOKEN>",
shippoApiVersion: "2018-02-08"
);
ListShipmentRatesRequest req = new ListShipmentRatesRequest() {
ShipmentId = "<id>",
};
var res = await sdk.Rates.ListShipmentRatesAsync(req);
// handle responsepackage hello.world;
import com.goshippo.shippo_sdk.Shippo;
import com.goshippo.shippo_sdk.models.operations.ListShipmentRatesResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
Shippo sdk = Shippo.builder()
.apiKeyHeader("ShippoToken <API_TOKEN>")
.shippoApiVersion("2018-02-08")
.build();
ListShipmentRatesResponse res = sdk.rates().listShipmentRates()
.shipmentId("<id>")
.page(1L)
.results(25L)
.shippoApiVersion("2018-02-08")
.call();
if (res.ratePaginatedList().isPresent()) {
// handle response
}
}
}const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.goshippo.com/shipments/{ShipmentId}/rates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.goshippo.com/shipments/{ShipmentId}/rates"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.goshippo.com/shipments/{ShipmentId}/rates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"next": "baseurl?page=3&results=10",
"previous": "baseurl?page=1&results=10",
"results": [
{
"amount": "5.5",
"amount_local": "5.5",
"currency": "USD",
"currency_local": "USD",
"attributes": [
"BESTVALUE"
],
"carrier_account": "078870331023437cb917f5187429b093",
"object_created": "2023-11-07T05:31:56Z",
"object_id": "adcfdddf8ec64b84ad22772bce3ea37a",
"object_owner": "pp@gmail.com",
"provider": "USPS",
"servicelevel": {
"name": "Priority Mail Express",
"terms": "ONERATE",
"token": "usps_priority_express",
"extended_token": "<string>",
"parent_servicelevel": {
"name": "Priority Mail Express",
"terms": "ONERATE",
"token": "usps_priority_express",
"extended_token": "<string>"
}
},
"shipment": "adcfdddf8ec64b84ad22772bce3ea37a",
"arrives_by": "08:30:00",
"duration_terms": "Delivery in 1 to 3 business days",
"estimated_days": 2,
"included_insurance_price": "1.05",
"messages": [
{
"source": "UPS",
"code": "carrier_timeout",
"text": "UPS API did not respond. Please try again in a few minutes."
}
],
"provider_image_75": "https://cdn2.goshippo.com/providers/75/USPS.png",
"provider_image_200": "https://cdn2.goshippo.com/providers/200/USPS.png",
"test": true,
"zone": "1"
}
]
}{}Authorizations
API key authentication using the ShippoToken scheme. Format: Authorization: ShippoToken <API_TOKEN> Example: Authorization: ShippoToken shippo_live_abc123
Headers
Optional string used to pick a non-default API version to use. See our API version guide.
Example:
"2018-02-08"
Optional. The object ID of a Managed Shippo Account. Platform accounts set this to make the request on behalf of one of their managed accounts. See the Platform accounts guide.
Path Parameters
Object ID of the shipment to update
Query Parameters
The page number you want to select
The number of results to return per page (max 100)
Required range:
x <= 100Was this page helpful?
⌘I