This method is used to get pickup orders rates. It can be used by sending a POST request to: https://api.deftship.com/pickup-orders/get-rates.
| Method | URI | Headers |
|---|---|---|
| POST | pickup-orders/get-rates |
default |
| 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) |
| No | String | ||
| +is_residential | Yes | Boolean | Residential Indicator |
| carrier | Yes | String | Carrier is one of the following [ups, dhl, usps, canadapost] |
| pickup_date | Yes* | String | Proposed pickup date, in Y-m-d. Condition: only not required if a "carrier" is "dhl" |
| ready_time | No* | String | Opening time of pickup address, in H:i. Condition: only required if a "carrier" is "ups" |
| close_time | No* | String | Closing time of pickup address, in H:i. Condition: only required if a "carrier" is "ups" |
| pieces [] | Yes | Array | An array containing all the information about pieces |
| +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" |
{
"from_address_id": 1387235969,
"carrier": "ups",
"ready_time": "13:30",
"close_time": "15:30",
"pickup_date": "04/28/2023",
"pieces": [
{
"service": "PICKUP-UPS-1",
"container_type": "package",
"quantity": "2",
"weight": "20",
"destination_country_code": "US"
}
]
}
{
"from_address_id": 696756088,
"carrier": "usps",
"pickup_date": "04/28/2023",
"pieces": [
{
"service": "PICKUP-USPS-1",
"quantity": "2",
"weight": "20"
}
]
}
| 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 |
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"
]
}
}