This method is used to check pricing for Insurance. The method also automatically creates an insurance and returns the pricing.
Available carriers are [Carriers are only available to registered users]
| Method | URI | Headers |
|---|---|---|
| POST | insurances/get-rates |
default |
true if the shipment is international default false
is_freight | No | Boolean | true if the shipment is freight default false
shipment_date | Yes | String | Shipment date, in Y-m-d
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. {
"carrier": "ups",
"service_code": "UPS-2",
"is_international": false,
"is_freight": false,
"shipment_date": "2023-02-25",
"from_address": {
"name": "Example Corp",
"attention": "John Doe",
"street_1": "123 S Main St",
"street_2": "Street2",
"street_3": "Street3",
"city": "Los Angeles",
"zip": "90012",
"state": "CA",
"country": "US",
"telephone": "1234567891",
"email": "test1@test.com"
},
"to_address": {
"name": "Example Corp 2",
"attention": "John Doe 2",
"street_1": "123 Main St",
"street_2": "Street 2",
"street_3": "Street 3",
"city": "Flushing",
"zip": "11354",
"state": "NY",
"country": "US",
"telephone": "1234567891",
"email": "test2@test.com"
},
"package_list": [
{
"tracking_number": 11111111111,
"items": [
{
"quantity": 2,
"price": 20,
"description": "Fryer"
}
]
},
{
"tracking_number": 22222222222,
"items": [
{
"quantity": 1,
"price": 10,
"description": "Fryer"
}
]
}
]
}
Successful
{
"success": true,
"data": {
"id": 1234567890,
"price": "2.00"
}
}
Failed
{
"success": false,
"message": "There was an error in proceeding this insurance"
}