API Documentation
Everything you need to integrate RateShip into your application.
Everything you need to integrate RateShip into your application.
/api/v1/ratesGet shipping rates from all your connected providers in a single request.
| Field | Type | Required | Description |
|---|---|---|---|
| from_address | object | Yes | Origin address: { name, street1, city, state, zip, phone } |
| to_address | object | Yes | Destination address: { name, street1, city, state, zip, phone } |
| weight | number | Yes | Package weight |
| weight_unit | "lbs" | "oz" | Yes | Weight unit |
| length | number | Yes | Length in inches |
| width | number | Yes | Width in inches |
| height | number | Yes | Height in inches |
| package_count | number | Yes | Number of packages |
import { RateShip } from "rateship";
const rateship = new RateShip({ apiKey: "rs_dev_your_key_here" });
const { rates, errors } = await rateship.rates.get({
from_address: {
name: "John Smith",
street1: "123 Main St",
city: "New York",
state: "NY",
zip: "10001",
phone: "2125551234",
},
to_address: {
name: "Jane Doe",
street1: "456 Oak Ave",
city: "Los Angeles",
state: "CA",
zip: "90001",
phone: "3105551234",
},
weight: 2.5,
weight_unit: "lbs",
length: 12,
width: 8,
height: 6,
package_count: 1,
});{
"success": true,
"data": {
"rates": [
{
"provider": "shippo",
"carrier": "USPS",
"service": "Ground Advantage",
"price_cents": 965,
"currency": "USD",
"estimated_days": 5,
"rate_id": "5e228fbf..."
}
],
"errors": []
}
}/api/v1/ratesGet shipping rates from all your connected providers in a single request.
| Field | Type | Required | Description |
|---|---|---|---|
| from_address | object | Yes | Origin address: { name, street1, city, state, zip, phone } |
| to_address | object | Yes | Destination address: { name, street1, city, state, zip, phone } |
| weight | number | Yes | Package weight |
| weight_unit | "lbs" | "oz" | Yes | Weight unit |
| length | number | Yes | Length in inches |
| width | number | Yes | Width in inches |
| height | number | Yes | Height in inches |
| package_count | number | Yes | Number of packages |
import { RateShip } from "rateship";
const rateship = new RateShip({ apiKey: "rs_dev_your_key_here" });
const { rates, errors } = await rateship.rates.get({
from_address: {
name: "John Smith",
street1: "123 Main St",
city: "New York",
state: "NY",
zip: "10001",
phone: "2125551234",
},
to_address: {
name: "Jane Doe",
street1: "456 Oak Ave",
city: "Los Angeles",
state: "CA",
zip: "90001",
phone: "3105551234",
},
weight: 2.5,
weight_unit: "lbs",
length: 12,
width: 8,
height: 6,
package_count: 1,
});{
"success": true,
"data": {
"rates": [
{
"provider": "shippo",
"carrier": "USPS",
"service": "Ground Advantage",
"price_cents": 965,
"currency": "USD",
"estimated_days": 5,
"rate_id": "5e228fbf..."
}
],
"errors": []
}
}