This guide walks you from a fresh clone to a working rate comparison request against a locally running Ship Quote API. The only hard prerequisites are Node.js 18+ and a running MongoDB 4.4+ instance — either local or a remote connection string.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/plantasur-dev/ship-quote/llms.txt
Use this file to discover all available pages before exploring further.
Clone the repository and install dependencies
Clone the repository and install dependencies for both the API and the optional web frontend.Install the API dependencies:Install the web frontend dependencies (optional — only needed if you want the UI):
Configure environment variables
Copy the example environment files and fill in your values. The API will not start without a valid MongoDB connection string.Open Open
api/.env and set the required values:web/.env and set the API URL:Seed the database with bootstrap data
The You should see log output confirming that provinces, countries, agencies, and tariffs have been inserted. If you re-run the seed it is safe — duplicate records are handled gracefully.
seed script loads the initial geographic data, agency records, pallet types, zones, and rate tables that the rate engine depends on. Run this once before starting the server for the first time.Start the API development server
server.js with your .env file, connects to MongoDB, initialises the in-memory cache (provinces, countries, agency tariffs), and begins listening.http://localhost:3000/api/v1. The interactive OpenAPI documentation is available at http://localhost:3000/api-docs.Make your first rate comparison request
Send a Each object in the response array represents one carrier. The
POST request to /api/v1/rates/compareByPostalCode with a destination postal code, country code, and at least one shipment item. The example below quotes a single pallet bound for Madrid (28001).available flag tells you whether that carrier returned at least one valid price. When available is false, the incidents array explains why (e.g. no tariff configured for that zone, dimension exceeded, API timeout).The
countryCode field drives scope detection. Sending "countryCode": "ES" with DEFAULT_COUNTRY=ES classifies the shipment as national, so only carriers that support national coverage are queried.Start the web frontend (optional)
The web frontend is a React + Vite application that provides a UI for running comparisons and browsing results. It is completely optional for API usage.The development server starts at
http://localhost:5173 and proxies API calls to the URL defined in VITE_API_URL_DEV.Make sure the API is running on port 3000 before opening the web UI, otherwise rate comparison requests from the browser will fail with a network error.
Next Steps
- Read the Configuration page for a full reference of every environment variable.
- Explore the interactive OpenAPI docs at
http://localhost:3000/api-docsto try every endpoint. - To quote a parcel instead of a pallet, change
"typeServices"to"parcel"and omit the dimension fields — onlyweightis required for parcels.