Custom Shipping Cost Calculation APIs

Job ID: 39294929

Budget: ₹1,500 – ₹12,500 INR

I'm looking to develop a Web API for a shipping application. This API will be crucial for calculating shipping costs based on specific factors.

Key Requirements:
- Expertise in API development is a must.
- The API should take into account the package weight and destination location when calculating costs.
- Prior experience in shipping applications will be an added advantage.

Ideal Skills:
- Strong background in web APIs
- Proficiency in shipping cost algorithms
- Experience in logistics software development

Project Details
This is the device information that I need to ship

Name: Station P1 Pro
Price: $150
Weight: 365g
Volume discount :
1. 25+ units: 5% discount
2. 50+ units: 10% discount
3. 100+ units: 15% discount
4. 250+ units: 20% discount

Now this device need to be shipped from 6 different warehouses around the world. Below is a list of warehouses with geographical location and current stock maintained in a table like this:

Warehouses and stock

Name Coordinates (latitude/longitude) Stock
Los Angeles 33.9425,-118.408056 355
New York 40.639722,-73.778889 578
São Paulo -23.435556,-46.473056 265
Paris 49.009722, 2.547778 694
Warsaw 52.165833, 20.967222 245
Hong Kong 22.308889, 113.914444 419

The cost of shipping an order is calculated based on the geographical distance between the
warehouse and the shipping address, and the weight of the shipment. The rate is $0.01 per
kilogram per kilometer.
A single order can be shipped from multiple warehouses. For example, if one warehouse does
not have enough stock to fulfill the order, remaining units can be shipped from other
warehouses. However, we always want the cost to be as low as possible. If shipping cost
exceeds 15% of the order amount after discount, the order is considered invalid and should not
be processed.

We need to design and implement the backend of the system. Following functional requirements (to be implemented via APIs)


1. A sales rep should be able to verify a potential order without submitting it, by inputting
the number of devices and coordinates (latitude/longitude) of the shipping address.
The rep should be able to see total price, discount and shipping cost, as well as an
indication of the order’s validity.

2. A sales rep should be able to submit an order by inputting the number of devices and
coordinates (latitude/longitude) of the shipping address. A successful order submission
should result in warehouse inventory immediately being updated. The order must have
an order number and store total price, discount and shipping cost as calculated at the
time of submission.

Technical requirements

Need to implement web API service for using this:

1. NodeJS, Typescript, PostgreSQL and Sequelize ORM
2. Need to have proper input validations on all API request
3. Data should be inserted in table using migrations
4. Should be cover all corner case scenarios.
5. Code should be well structed and maintained in layer like controller, valdiators and service etc.

The solution should be implemented in Typescript completely, and store data in a database using migration.

The solution should expose its capabilities through a well-documented API.
Extensive test coverage is not required, but a clear testing strategy should be
demonstrated.

Approach the solution like you would a production system, and consider aspects such as performance, scalability, consistency and extensibility. Also should be to start the application with seed data and run tests in a local environment.