Get Shipping Rates
Calculate shipping rates for packages within the United States. This endpoint allows you to get quotes from FedEx and other available carriers.
This endpoint only works for shipments within the United States. For shipments in Mexico or other countries, contact support to get rates.
Endpointβ
POST /v1/client/shipment/rates
Descriptionβ
This endpoint allows you to get FedEx rates for shipments within the United States. You need to provide the Bearer token generated previously.
Headersβ
| Header | Type | Required | Description |
|---|---|---|---|
| Authorization | string | β | Bearer token obtained from /token/generate endpoint |
| Content-Type | string | β | Must be application/json |
Body Parametersβ
| Parameter | Type | Required | Max. Length | Description |
|---|---|---|---|---|
| rates | object | β | - | Container object for all quote parameters |
| rates.shippingService | string | - | 10 | Name of the shipping service from which you want to get rates. If not specified, returns rates from all available services |
| rates.shipper | object | β | - | Shipper (warehouse) information |
| rates.shipper.warehouse_id | integer | β | 10 | ID of the warehouse from which products will be shipped |
| rates.recipient | object | β | - | Recipient information |
| rates.recipient.address | object | β | - | Recipient address |
| rates.recipient.address.addressLine | string | - | 35 | Shipping delivery address, necessary only if querying UPS |
| rates.recipient.address.postalCode | string | β | 10 | Destination zip code |
| rates.recipient.address.countryCode | string | β | 2 | Two-letter country code. Default 'US' |
| rates.packageItems | array | β | 99 | One or more packages with their attribute descriptions |
| rates.packageItems[].weight | object | β | - | Package weight |
| rates.packageItems[].weight.units | string | β | - | Weight unit. Valid values: 'KG' or 'LB' |
| rates.packageItems[].weight.value | double | β | 99 | Package weight value |
Examplesβ
cURLβ
curl -X POST https://apisandbox.eonwms.com/v1/client/shipment/rates \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"rates": {
"shippingService": "FEDEX",
"shipper": {
"warehouse_id": 3
},
"recipient": {
"address": {
"addressLine": "123 Main St",
"postalCode": "77384",
"countryCode": "US"
}
},
"packageItems": [
{
"weight": {
"units": "LB",
"value": 3
}
}
]
}
}'
JavaScriptβ
const rateRequest = {
rates: {
shippingService: "FEDEX", // Optional, omit to get all rates
shipper: {
warehouse_id: 3 // USA warehouse
},
recipient: {
address: {
addressLine: "123 Main St", // Required only for UPS
postalCode: "77384",
countryCode: "US"
}
},
packageItems: [
{
weight: {
units: "LB",
value: 3
}
}
]
}
};
const response = await fetch('https://apisandbox.eonwms.com/v1/client/shipment/rates', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify(rateRequest)
});
const rates = await response.json();
console.log(`Total rate: $${rates.totalNetCharge} USD`);
Pythonβ
import requests
rate_request = {
"rates": {
"shippingService": "FEDEX", # Optional
"shipper": {
"warehouse_id": 3 # USA warehouse
},
"recipient": {
"address": {
"addressLine": "123 Main St", # Required only for UPS
"postalCode": "77384",
"countryCode": "US"
}
},
"packageItems": [
{
"weight": {
"units": "LB",
"value": 3
}
}
]
}
}
response = requests.post(
'https://apisandbox.eonwms.com/v1/client/shipment/rates',
headers={
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json'
},
json=rate_request
)
rates = response.json()
print(f"Total rate: ${rates['totalNetCharge']} USD")
Responsesβ
200 - Successβ
{
"status": 200,
"rateType": "LIST",
"totalDiscounts": 0,
"totalBaseCharge": 14.38,
"totalNetCharge": 21.9,
"shipmentDetail": {
"rateZone": "5",
"totalBillingWeight": {
"units": "LB",
"value": 3
},
"currency": "USD"
}
}
401 - Unauthorizedβ
{
"code": 401,
"fault": {
"arguments": {
"Authorization": "invalid"
},
"type": "InvalidAuthorizationException",
"message": "The request is unauthorized, the access token is invalid."
}
}
422 - No Delivery Coverageβ
{
"code": 422,
"fault": {
"arguments": {
"postalCode": "00000"
},
"type": "getRates.noDeliveryCoverage",
"message": "FedEx service is not currently available to this origin/destination combination."
}
}
Response Structureβ
Main Fieldsβ
- status: HTTP status code
- rateType: Rate type (usually "LIST")
- totalDiscounts: Applied discounts
- totalBaseCharge: Base charge without taxes or surcharges
- totalNetCharge: Total charge to pay (includes all charges)
Shipment Detailsβ
The shipmentDetail object includes:
- rateZone: Rate zone (1-8 for domestic USA shipments)
- totalBillingWeight: Billing weight
- units: Weight unit (LB or KG)
- value: Weight value
- currency: Currency (always USD)
Weight Considerationsβ
Dimensional Weight vs Actual Weightβ
FedEx and other carriers use the greater of:
- Actual weight: The physical weight of the package
- Dimensional weight: (Length Γ Width Γ Height) / Dimensional factor
- FedEx Ground: 139
- FedEx Express: 139
- UPS: 166 (may vary)
Calculation Exampleβ
// Calculate dimensional weight
function calculateDimensionalWeight(length, width, height, factor = 139) {
const volume = length * width * height;
const dimensionalWeight = volume / factor;
return Math.ceil(dimensionalWeight);
}
// Example: Box of 16" x 12" x 10"
const dimWeight = calculateDimensionalWeight(16, 12, 10); // = 14 lbs
const actualWeight = 3; // 3 lbs
// FedEx will charge for 14 lbs (the greater)
Multiple Packagesβ
To quote shipments with multiple packages:
const multiPackageRequest = {
rates: {
shipper: {
warehouse_id: 3
},
recipient: {
address: {
postalCode: "77384",
countryCode: "US"
}
},
packageItems: [
{
weight: {
units: "LB",
value: 5
}
},
{
weight: {
units: "LB",
value: 3
}
},
{
weight: {
units: "LB",
value: 10
}
}
]
}
};
Available USA Warehousesβ
To use this endpoint you need a warehouse in the United States. Check available warehouses with the Get Available Warehouses endpoint.
To get shipping rates in Mexico:
- Rates are predefined by contract
- Contact support to get your rate table
- Use the appropriate shipping service when creating the order
Service Comparisonβ
If you don't specify shippingService, the endpoint may return rates for multiple services, allowing you to compare:
- FedEx Ground: More economical, 1-5 business days
- FedEx Express: Faster, next day delivery
- UPS Ground: Alternative to FedEx Ground
- UPS Next Day Air: Guaranteed next day delivery