menu

Get Rates & Delivery Options


play_arrow
pause
play_arrow
stop

Get Rates and Delivery Options

This request will enable you to identify available carriers for your shipment and determine the associated costs and options.

This request is typically beneficial during the checkout process of an Online Store when the client may select the prefered delivery option for his order.

  • You must specify the origin (FROM) from where the parcel will be picked up and the destination (TO) country to which it will be delivered.
  • You also need to provide details about the parcel's parameters, such as its weight and size.
    For a single product, estimating the approximate weight and size of the package is typically not a problem. However, if the cart contains multiple products, you may need to calculate the appropriate box size or determine if multiple boxes are required. This calculation must currently be done on your end.
  • Additionally, you can include other optional parameters to more precisely assess the rates and carriers
  • You can optionally specify the language in which you would like to receive responses for titles and error messages. Set x-api-lang-iso in the header. Avalable values are: en, lv, ru
POST https://api.sender.lv/api/sandbox/v1/rates
{
  • "from": { FROM countainer. Where the parcel will be sent from
    • "country_iso": "LV", From country ISO code
    • "postcode": "LV-1083", From country postal code.
    • "latitude": "56.954165", From Latitude coordinate. Optional field, but can enhance accuracy for certain carriers.
    • "longitude": "24.007918" From Longitude coordinate. Optional field.
    } ,
  • "to": { TO countainer. Destination, where the parcel should be delivered.
    • "country_iso": "LV", To country ISO code
    • "postcode": "LV-1083", To country postal code.
    • "latitude": "56.954165", To Latitude coordinate. Optional field, but can enhance accuracy for certain carriers.
    • "longitude": "24.007918" To Longitude coordinate. Optional field.
    } ,
  • "package_type": "1", Indicate the parcel type. 1 - documents. 2 - parcel/box. 3 - pallet
  • "packages": [ Some carriers accept multiple packages being sent at once to one address. Each package should be described separately in this container.
    • { First Package container
      • "weight": "0.250", weight of the parcel in KG
      • "width": "10", Width of the package in CM
      • "height": "10", Height of the package in CM
      • "depth": "6" Depth of the package in CM
      }
    ] ,
  • "shipment_total_value": "20", Provide the total cost of the items inside the parcel.
  • "shipment_total_value_currency": "EUR", Provide the currency for the total cost of the items inside the parcel.
  • "shipment_contents": "Dyson Airwrap 20mm Long Barrel Black Purple (970736-01)", Optional field. Provide a description of the contents inside the parcel using only Latin characters. If certain prohibited keywords are detected, some carriers may not be displayed.
  • "pickup_timestamp": "1713278164", Is as an optional field. You can specify a preferred pickup date and time in timestamp format. Some carriers may not be shown if the pickup time is unsuitable for them (for example Sundays pickups).
  • "type": "address-address" Optional field to specify delivery type. Available options: address-address | address-parcel_locker | parcel_locker-parcel_locker | parcel_locker-address. For example if you need to get carriers who can pickup the parcel from adress and deliver it to some parcel locker - the value should be 'address-parcel_locker' .
}


Click the PLAY button at the top right of this section to view real-time GET Rates examples. You can also click 'Show API Request' to view each post and see the server's response.

1 Get Rates - minimal payload
 
In this example, we demonstrate obtaining shipping rates for a route from Latvia to Latvia, using only the minimal required fields in the payload.

2 Get Rates - Error example
This example includes an error in the payload. Check the server's response to correctly identify and understand the errors.

3 Get Rates - with Latitude, Longitude
 In this example, we utilize latitude and longitude fields to more precisely determine shipping rates. While these fields are not mandatory, they can enhance the accuracy of price determinations in certain scenarios.

4 Get Rates - multiple Packages
  In this example, we are requesting shipping rates for multiple packages. Carriers incapable of delivering multiple packages to one address will be excluded from the server’s response. Different carriers may have varying pricing calculation methods for multiple packages. Therefore, it is important not to sumup the total size and weight of all packages as a single parcel; instead, each package should be posted separately.

5 Get Rates - From Address to Parcel lockers
  In this example we've added an optional param "type" to get only carrier who can pickup from address and deliver to parcel locker.


Please log in and add your sandbox to play this scenario in real-time