Get Rates


This method is used to get pickup orders rates. It can be used by sending a POST request to: https://system.deftship.com/api/pickup-orders/get-rates.

Endpoint

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

Requests

Field Required Type Description
id No Integer Pickup order id to update an already existing order
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_address_id".
from_address {} No* Object Sender address container, not required if a "from_address_id" was 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 - This field will will avoid special characters (10-15 digits)
+email No String Email
+is_residential Yes Boolean Residential Indicator
carrier Yes String Carrier is one of the following [ups, fedex, dhl, usps]
pickup_date No* String Proposed pickup date, in Y-m-d. Condition: only required if a "carrier" is "ups", "fedex"
ready_time No* String Opening time of pickup address, in H:i. Condition: only required if a "carrier" is "ups", "fedex"
close_time No* String Closing time of pickup address, in H:i. Condition: only required if a "carrier" is "ups", "fedex"
pieces [] Yes Array An array containing all the information about pieces
+is_gfp No* Boolean If the item is Ground Freight. Default value is false. Condition: only required if a "carrier" is "ups"
+service Yes String For a full list please check out carrier service types. If is_gfp is true the value will be set to PICKUP-UPS-15
+container_type No* String Container type is either "package" or "letter". Condition: only required if a "carrier" is "ups"
+quantity Yes Integer Quantity of the pickup item
+weight Yes Float Weight (LBS)
+destination_country_code No* String Destination country needs to be a country code please refer to country-codes. Condition: only required if a "carrier" is "ups"

Request Examples

UPS Request Example

{
    "from_address_id": 1387235969,
    "carrier": "ups",
    "ready_time": "13:30",
    "close_time": "15:30",
    "pickup_date": "04/28/2023",
    "pieces": [
        {
            "is_gfp": false,
            "service": "PICKUP-UPS-1",
            "container_type": "package",
            "quantity": "2",
            "weight": "20",
            "destination_country_code": "US"
        }
    ]
}

FedEx Request Example

{
    "from_address_id": 362451571,
    "carrier": "fedex",
    "ready_time": "13:30",
    "close_time": "15:30",
    "pickup_date": "05/01/2023",
    "pieces": [
        {
            "service": "PICKUP-FEDEX-1",
            "quantity": "2",
            "weight": "3"
        }
    ]
}

USPS Request Example

{
    "from_address_id": 696756088,
    "carrier": "usps",
    "pieces": [
        {
            "service": "PICKUP-USPS-1",
            "quantity": "2",
            "weight": "20"
        }
    ]
} 

Response

Field Type Description
success Boolean true or false
data Object Pickup order data container
+id String Pickup order id
+miscellaneous_charges String Miscellaneous Charges
+base_price String Base Price
+fuel_price String Fuel Price
+final_price String Final Price

Response Examples

Successful

{
    "success": true,
    "data": {
        "id": 634804812,
        "miscellaneous_charges": [],
        "base_price": "8.00",
        "fuel_price": "0.00",
        "final_price": "8.00"
    }
}

Failed

{
    "success": false,
    "message": "The given data was invalid.",
    "data": {
        "from_address_id": [
            "A valid from address is required"
        ]
    }
}