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 | 
| Field | Required | Type | Description | 
|---|---|---|---|
| carrier | Yes | String | Carrier of the order going to be insured | 
| service_code | Yes | String | Service code of this order, please refer to service names | 
| is_international | No | Boolean | 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.  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. Condition: only required if a "from_address_id" was not used | 
| +name | Yes | String | Name of the sender | 
| +attention | Yes | 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 | Yes | String | State | 
| +country | Yes | String | Country (code) for the list please refer to country-codes | 
| +telephone | No | String | Telephone Number - This field will will avoid special characters | 
| No | String | ||
| to_address {} | Yes | Object | Receiver address container | 
| +name | Yes | String | Name of the receiver | 
| +attention | Yes | 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 | Yes | String | State | 
| +country | Yes | String | Country (code) for the list please refer to country-codes | 
| +telephone | No | String | Telephone Number - This field will will avoid special characters | 
| No | String | ||
| package_list [] | Yes | Array | An array containing all the information about packages | 
| +tracking_number | Yes | String | Tracking number of the package going to be insured | 
| +items [] | Yes | Array | An array containing all the information about items | 
| ++quantity | Yes | Integer | Item piece count | 
| ++price | Yes | Float | Item piece price | 
| ++description | Yes | String | Description of the item | 
{
    "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": "[email protected]"
    },
    "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": "[email protected]"
    },
    "package_list": [
        {
            "tracking_number": 11111111111,
            "items": [
                {
                    "quantity": 2,
                    "price": 20,
                    "description": "Fryer"
                }
            ]
        },
        {
            "tracking_number": 22222222222,
            "items": [
                {
                    "quantity": 1,
                    "price": 10,
                    "description": "Fryer"
                }
            ]
        }
    ]
}
| Field | Type | Description | 
|---|---|---|
| success | Boolean | true or false | 
| message | String | Error message (only exists if success is false) | 
| data | Array | An array containing received price | 
| +id | Integer | This is the ID (insurance_id) that you will need to use to book this specific insurance | 
| +price | Float | Price of the insurance for the given information | 
Successful
{
    "success": true,
    "data": {
        "id": 1234567890,
        "price": "2.00"
    }
}
Failed
{
    "success": false,
    "message": "There was an error in proceeding this insurance"
}