How to work out shipment cost?


Can you guys “throw” in some ideas of how one can calculate shipment cost given distance, weight and set out rates

thank you

1 Like

if you feel like offering DHL shipment and enjoy dealing with XML (but who doesn’t?) you could have a look at their integrated shipping solutions.

I’m not aware of, but other couriers could offer similar service too. I’d do some search and comparison in the field.

1 Like
cost = distance * cost_per_distance_unit + weight * cost_per_weight_unit
1 Like

Check out EasyPost and ExEasyPost.

EasyPost provides a unified API for retrieving shipping rates with support for multiple carriers. You should be able to calculate what you need with the data they provide.


@idi527, as the question is tagged with “math”, I feel your answer is the most accurate here

Thank you. checked out their documentation and something else came up. is it possible to display the given address e.g

    |> ExEasyPost.request()

on a map??

sorry about the tag. couldn’t figure out which one to apply. the question was in general though

Here’s EasyPost’s documentation for addresses.

If you have an address you can use a service like Google Maps to display it on a map.


thanks once again :bowing_man:t5: will definitely check it out