📖 Looking for karrio's legacy docs? Visit docs.karrio.io

Live Rates & Service Selection

Community Edition
Core Feature

Karrio’s live rates API allows you to compare shipping rates across multiple carriers in real-time, helping you find the most cost-effective shipping options for your customers. Get instant quotes from FedEx, UPS, DHL, and other carriers with a single API call.

Overview

The live rates system enables you to:

  • Compare Rates: Get quotes from multiple carriers simultaneously
  • Service Selection: Choose from different service levels (ground, express, overnight)
  • Real-time Pricing: Access current carrier rates and surcharges
  • Delivery Estimates: Get estimated delivery times for each service
  • Cost Optimization: Find the best balance between cost and delivery speed

Rate Shopping Workflow

API Reference

Get Live Rates

Compare shipping rates across multiple carriers without creating a shipment.

1curl -X POST "https://api.karrio.io/v1/proxy/rates" \ 2 -H "Authorization: Token YOUR_API_KEY" \ 3 -H "Content-Type: application/json" \ 4 -d '{ 5 "shipper": { 6 "postal_code": "10001", 7 "country_code": "US" 8 }, 9 "recipient": { 10 "postal_code": "90210", 11 "country_code": "US" 12 }, 13 "parcels": [{ 14 "weight": 2.5, 15 "weight_unit": "LB", 16 "length": 10, 17 "width": 8, 18 "height": 6, 19 "dimension_unit": "IN" 20 }], 21 "services": ["ground", "express"], 22 "options": { 23 "insurance": 100.00, 24 "signature_confirmation": true 25 } 26 }'

Response:

1{ 2 "rates": [ 3 { 4 "id": "rate_fedex_ground", 5 "carrier_name": "fedex", 6 "carrier_id": "fedex_production", 7 "service": "fedex_ground", 8 "total_charge": 15.99, 9 "currency": "USD", 10 "transit_days": 3, 11 "estimated_delivery": "2024-01-18", 12 "extra_charges": [ 13 { 14 "name": "Fuel surcharge", 15 "amount": 2.5, 16 "currency": "USD" 17 } 18 ], 19 "test_mode": false 20 }, 21 { 22 "id": "rate_ups_ground", 23 "carrier_name": "ups", 24 "carrier_id": "ups_production", 25 "service": "ups_ground", 26 "total_charge": 16.49, 27 "currency": "USD", 28 "transit_days": 3, 29 "estimated_delivery": "2024-01-18", 30 "extra_charges": [ 31 { 32 "name": "Fuel surcharge", 33 "amount": 2.75, 34 "currency": "USD" 35 } 36 ], 37 "test_mode": false 38 } 39 ], 40 "messages": [] 41}

Filtered Rate Request

Request rates for specific carriers or services:

1curl -X POST "https://api.karrio.io/v1/proxy/rates" \ 2 -H "Authorization: Token YOUR_API_KEY" \ 3 -H "Content-Type: application/json" \ 4 -d '{ 5 "shipper": { 6 "postal_code": "10001", 7 "country_code": "US" 8 }, 9 "recipient": { 10 "postal_code": "M5V 3A8", 11 "country_code": "CA" 12 }, 13 "parcels": [{ 14 "weight": 1.0, 15 "weight_unit": "KG" 16 }], 17 "carrier_ids": ["fedex_production", "ups_production"], 18 "services": ["fedex_international_priority", "ups_worldwide_express"] 19 }'

International Rate Request

Get rates for international shipments with customs information:

1curl -X POST "https://api.karrio.io/v1/proxy/rates" \ 2 -H "Authorization: Token YOUR_API_KEY" \ 3 -H "Content-Type: application/json" \ 4 -d '{ 5 "shipper": { 6 "postal_code": "10001", 7 "country_code": "US" 8 }, 9 "recipient": { 10 "postal_code": "SW1A 1AA", 11 "country_code": "GB" 12 }, 13 "parcels": [{ 14 "weight": 2.0, 15 "weight_unit": "LB", 16 "items": [{ 17 "description": "Sample Product", 18 "quantity": 1, 19 "value_amount": 50.00, 20 "value_currency": "USD", 21 "weight": 2.0, 22 "weight_unit": "LB" 23 }] 24 }], 25 "customs": { 26 "content_type": "merchandise", 27 "incoterm": "DDU", 28 "commodities": [{ 29 "description": "Sample Product", 30 "quantity": 1, 31 "value_amount": 50.00, 32 "value_currency": "USD", 33 "weight": 2.0, 34 "weight_unit": "LB", 35 "origin_country": "US" 36 }] 37 } 38 }'

Implementation Examples

Basic Rate Shopping

Get all available rates for a shipment
1curl -X POST "https://api.karrio.io/v1/proxy/rates" \ 2 -H "Authorization: Token YOUR_API_KEY" \ 3 -H "Content-Type: application/json" \ 4 -d '{ 5 "shipper": { 6 "postal_code": "10001", 7 "country_code": "US" 8 }, 9 "recipient": { 10 "postal_code": "90210", 11 "country_code": "US" 12 }, 13 "parcels": [{ 14 "weight": 2.5, 15 "weight_unit": "LB" 16 }] 17 }'

Service-Specific Rates

Get rates for specific services only
1curl -X POST "https://api.karrio.io/v1/proxy/rates" \ 2 -H "Authorization: Token YOUR_API_KEY" \ 3 -H "Content-Type: application/json" \ 4 -d '{ 5 "shipper": { 6 "postal_code": "10001", 7 "country_code": "US" 8 }, 9 "recipient": { 10 "postal_code": "90210", 11 "country_code": "US" 12 }, 13 "parcels": [{ 14 "weight": 2.5, 15 "weight_unit": "LB" 16 }], 17 "services": ["fedex_ground", "ups_ground"] 18 }'

Carrier-Specific Rates

Get rates from specific carriers only
1curl -X POST "https://api.karrio.io/v1/proxy/rates" \ 2 -H "Authorization: Token YOUR_API_KEY" \ 3 -H "Content-Type: application/json" \ 4 -d '{ 5 "shipper": { 6 "postal_code": "10001", 7 "country_code": "US" 8 }, 9 "recipient": { 10 "postal_code": "90210", 11 "country_code": "US" 12 }, 13 "parcels": [{ 14 "weight": 2.5, 15 "weight_unit": "LB" 16 }], 17 "carrier_ids": ["fedex_production", "ups_production"] 18 }'

Error Handling

Rate Request Errors

Common error scenarios and responses:

1{ 2 "rates": [], 3 "messages": [ 4 { 5 "code": "INVALID_POSTAL_CODE", 6 "message": "Invalid postal code format", 7 "details": "Postal code must be in format XXXXX or XXXXX-XXXX" 8 } 9 ] 10}