Get Rates


This method is used to check pricing for parcel orders from all allowed providers. The method also automatically creates an order that isn't visible from the dashboard

The request accepts an optional carrier query param if preferred, it can be used like: https://deftship.com/api/shipment-orders/get-rates?carrier=ups. Selecting a specific carrier can significantly reduce the response time for rates.


Available carriers are [Carriers are only available to registered users]

Endpoint

Method URI Headers
POST parcel-orders/get-rates default

Request

Field Required Type Description
from_address_id No* Integer This field is used to identify sender address. You can fetch your saved addresses from address-book. Addresses can be managed from the website on live dashboard or sandbox dashboard. _Not required if a "from_address" object was used.

Note: If both "from_address_id" and "from_address" fields are defined system will prioritise the "from_addressid"
return_address_id No Integer This field is used to identify return address. You should use the address which is in your saved from addresses. You can fetch your saved from addresses from address-book. Addresses can be managed from the website on live dashboard or sandbox dashboard.
from_address {} No* Object Sender address container. _Condition: only required if a "from_addressid" was not used
+name Yes String Name of the sender
+attention No String Attention of the sender
+street_1 Yes String Street line 1
+street_2 No String Street line 2
+street_3 No String Street line 3
+city Yes String City
+zip Yes String Postal Zip code
+state No* String State - This field is required for US or Canada addresses please refer to country-codes
+country Yes String Country (code) for the list please refer to country-codes
+telephone Yes String Telephone Number
+email No String Email
to_address {} Yes Object Receiver address container
+name Yes String Name of the receiver
+attention No String Attention of the receiver
+street_1 Yes String Street line 1
+street_2 No String Street line 2
+street_3 No String Street line 3
+city Yes String City
+zip Yes String Postal Zip code
+state No* String State - This field is required for US or Canada addresses please refer to country-codes
+country Yes String Country (code) for the list please refer to country-codes
+telephone Yes String Telephone Number
+email No String Email
package_list [] Yes Array An array containing all the package information
+count Yes Integer Pieces count
+box_type No String Carrier box types for the list please refer to Parcel Box Types
+length Yes Float Length (IN)
+width Yes Float Width (IN)
+height Yes Float Height (IN)
+weight Yes Float Weight (LBS)
+reference_2 No String Reference that will appear on the label
+insurance No Boolean Default is false. Setting this to true would require items information
+signature No Array Default is no_signature, other options are adult_signature and signature
+items [] No* Array An array containing all items information. Condition: only required on international shipments and shipments with insurance
++quantity No* Integer Quantity of the item Condition: only required when items [] is used
++price No* Float Price of the item Condition: only required when items [] is used
++country_of_manufacture No* Float Where the item is manufactured needs to be a country code please refer to country-codes. Condition: only required when items [] is used
++sku No* String SKU. Condition: only required when items [] is used
++description No* String A brief description for customs. Condition: only required when items [] is used
++content_type No* String Default is Merchandise, acceptable values are Merchandise, Gift, Documents, Sample. Condition: only required when items [] is used

Request Example

{
    "from_address_id": 12345678,
    "to_address": {
        "name": "Example Corp",
        "attention": "John Doe",
        "city": "Some City",
        "street_1": "123 Example Street ",
        "zip": "12312",
        "state": "PA",
        "country": "US",
        "telephone": "1234567890"
    },
    "package_list": [
        {
            "length": 5,
            "width": 4,
            "count": 3,
            "weight": 2,
            "height": 1,
            "insurance": false,
            "signature": "no_signature",
            "items": [
                {
                    "quantity": 1,
                    "price": 12.5,
                    "sku": "SKU",
                    "description": "Fryer",
                    "content_type": "Merchandise"
                }
            ]
        }
    ]
}

Response

Field Type Description
success Boolean true or false
message String Error message (only exists if success is false)
data Array An array containing received rates or if request has failed an object containing validation errors
+id Integer This is the ID (rate_id) that you will need to use to ship this specific rate
+carrier String Carrier of this rate
+service String Service of this rate
+service_code String Service code of this rate, please refer to service names
+final_price Float Final price of the shipment including all costs
+fuel_price Float Fuel price
+restrictions Array Any extra information about this particular rate
+miscellaneous_charges Array Any miscellaneous surcharges
+freight_class String Only shown when the provider is UPS GFP type
+has_enough_credits Boolean Shows if organisation has enough credits for this particular rate

Response Examples

Successful

{
    "success": true,
    "data": [
        {
            "id": 12345678,
            "carrier": "fedex",
            "service": "Fedex Ground",
            "service_code": "FEDEX-1",
            "final_price": "45.72",
            "fuel_price": "2.59",
            "restrictions": [],
            "miscellaneous_charges": [],
            "has_enough_credits": true
        },
        {
            "id": 12345678,
            "carrier": "ups",
            "service": "UPS 3 Day Select",
            "service_code": "UPS-8",
            "final_price": "80.33",
            "fuel_price": "4.55",
            "restrictions": [],
            "miscellaneous_charges": [],
            "has_enough_credits": true
        }
    ]
}

Failed

{
    "success": false,
    "message": "The given data was invalid.",
    "data": {
        "to_address.city": [
            "The to address.city field is required."
        ]
    }
}

Parcel Box Types

Name Code Length (IN) Width (IN) Height (IN) Weight (LBS)
UPS Boxes
UPS Letter 01 15.00 🔒 9.50 🔒 1.00 🔒 0.90
Package 02 0.00 0.00 0.00 200.00
Tube 03 38.00 🔒 6.00 🔒 9.00 🔒 150.00
25KG Box 24 19.75 🔒 17.75 🔒 13.25 🔒 55.12 🔒
10KG Box 25 16.50 🔒 13.25 🔒 10.75 🔒 22.05 🔒
Small Express Box 2a 13.00 🔒 11.00 🔒 2.00 🔒 150.00
Medium Express Box 2b 16.00 🔒 11.00 🔒 3.00 🔒 150.00
Large Express Box 2c 18.00 🔒 13.00 🔒 3.00 🔒 150.00
FedEx Boxes
FedEx Small Box FEDEX_SMALL_BOX 1.50 🔒 12.24 🔒 10.87 🔒 19.84
FedEx Medium Box FEDEX_MEDIUM_BOX 2.36 🔒 12.99 🔒 11.50 🔒 19.84
FedEx Large Box FEDEX_LARGE_BOX 2.99 🔒 17.87 🔒 12.36 🔒 20.00
FedEx Pak FEDEX_PAK 0.39 🔒 15.51 🔒 12.01 🔒 5.51
FedEx Tube FEDEX_TUBE 5.98 🔒 5.98 🔒 37.99 🔒 19.84
FedEx Envelope FEDEX_ENVELOPE 0.10 🔒 12.51 🔒 9.40 🔒 5.51
FedEx 10kg Box FEDEX_10KG_BOX 10.16 🔒 12.94 🔒 15.81 🔒 22.05 🔒
FedEx 25kg Box FEDEX_25KG_BOX 13.19 🔒 16.56 🔒 21.56 🔒 55.12 🔒
USPS Boxes
Small Flat Rate Box usps_small_flat_rate_box 8.62 🔒 5.37 🔒 1.62 🔒 70.00
Medium Flat Rate Box usps_medium_flat_rate_box 12.00 🔒 3.50 🔒 14.12 🔒 70.00
Large Flat Rate Box usps_large_flat_rate_box 12.00 🔒 12.00 🔒 5.50 🔒 70.00
Flat Rate Envelope usps_flat_rate_envelope 12.50 🔒 9.50 🔒 1.00 🔒 70.00
Padded Flat Rate Envelope usps_padded_flat_rate_envelope 12.50 🔒 9.50 🔒 1.00 🔒 70.00
Legal Flat Rate Envelope usps_legal_flat_rate_envelope 15.00 🔒 9.50 🔒 1.00 🔒 70.00
Regional Rate Box A usps_regional_rate_box_a 10.93 🔒 2.37 🔒 2.81 🔒 15.00
Regional Rate Box B usps_regional_rate_box_b 14.37 🔒 2.87 🔒 15.87 🔒 20.00