Calculate Shipping Rates Worldwide
This is meant to be used to calculate standard shipping rates wordwide, based on origin country and destination country, size and weight, and required level of service.
There's a couple of things to keep in mind:
- You can often get better rates as business customer (frequency, volume, etc.)
- If you have an account with a provider, it might be more accurate, to use their API
- Special cases, like islands, remote areas, etc. are not considered at the moment (you'll get the default rate)
Warning
I cannot guarantee that this is 100% accurate, nor up to date.
Best practice:
- Check the rates (JSON)
- Run tests for your specific use case
If something is off, I'd appreciate a PR.
Usage
let db = from_file.unwrap;
let query = ShippingRateQuery ;
let results = db.get_total_shipping_cost.unwrap;
Supported inputs:
The available providers and service levels, depend on the country of origin.
- Countries:
- "DE" (Germany)
Provider::DHLServiceLevel::StandardServiceLevel::Express
Provider::DPDServiceLevel::Standard
- "FR" (France)
Provider::LaPosteServiceLevel::Standard
- "DE" (Germany)
If you are shipping from Germany, or France, this package will have some use for you; Otherwise, feel free to add more countries, providers and service levels to the JSON file and submit a PR.
TypeScript Types
Generate TypeScript types using typeshare:
Test
RUST_LOG=debug
RUST_LOG=debug
Development
Compile and start server:
Clippy:
Format: