Skip to main content

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.

USA Only

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​

HeaderTypeRequiredDescription
Authorizationstringβœ“Bearer token obtained from /token/generate endpoint
Content-Typestringβœ“Must be application/json

Body Parameters​

ParameterTypeRequiredMax. LengthDescription
ratesobjectβœ“-Container object for all quote parameters
rates.shippingServicestring-10Name of the shipping service from which you want to get rates. If not specified, returns rates from all available services
rates.shipperobjectβœ“-Shipper (warehouse) information
rates.shipper.warehouse_idintegerβœ“10ID of the warehouse from which products will be shipped
rates.recipientobjectβœ“-Recipient information
rates.recipient.addressobjectβœ“-Recipient address
rates.recipient.address.addressLinestring-35Shipping delivery address, necessary only if querying UPS
rates.recipient.address.postalCodestringβœ“10Destination zip code
rates.recipient.address.countryCodestringβœ“2Two-letter country code. Default 'US'
rates.packageItemsarrayβœ“99One or more packages with their attribute descriptions
rates.packageItems[].weightobjectβœ“-Package weight
rates.packageItems[].weight.unitsstringβœ“-Weight unit. Valid values: 'KG' or 'LB'
rates.packageItems[].weight.valuedoubleβœ“99Package 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:

  1. Actual weight: The physical weight of the package
  2. Dimensional weight: (Length Γ— Width Γ— Height) / Dimensional factor
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.

Rates for Mexico

To get shipping rates in Mexico:

  1. Rates are predefined by contract
  2. Contact support to get your rate table
  3. 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