Creating an agency is the first step to adding a carrier to the rate comparison engine. Each agency record stores the routing rules, shipment capabilities, pricing supplements, and — when the carrier exposes its own HTTP API — the credentials and endpoint map needed to query it in real time.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.
The
code field is automatically derived from name by the API (lower-cased, diacritics stripped, spaces replaced with _). It is not accepted as a request body field — the server always computes it from name.Endpoint
Request Body
Human-readable agency name. Must be between 3 and 14 characters. The value is title-cased automatically (e.g.
"dachser" is stored as "Dachser").Determines how the rate engine sources prices for this agency. Accepted values:
| Value | Description |
|---|---|
"static" | Rates are read from locally stored zone and rate documents in MongoDB. |
"api" | Rates are fetched in real time from the carrier’s external HTTP API. apiConfig is required. |
"hybrid" | Both static and API sources are used. apiConfig is required. |
Routing and capability rules applied during rate comparison.
Pricing supplements applied on top of the base rate.
Carrier API connection details. Required when
type is "api" or "hybrid". Ignored for "static" agencies.Response
A successful request returns HTTP 201 Created with the full agency document.MongoDB ObjectId of the newly created agency.
Title-cased agency name as stored.
Normalised slug identifier derived from
name.Agency type:
"static", "api", or "hybrid".true if the agency is included in rate comparisons.Capability and routing rules as stored.
Stored supplement configuration.
Carrier API configuration (present for
"api" and "hybrid" agencies).ISO 8601 timestamp of when the agency was created.
ISO 8601 timestamp of the last update.
Examples
The following example creates Dachser as an"api" agency that covers both national and international shipments, bills a 5.5 % fuel surcharge, and handles pallets only.
Error Responses
Returned when a required field is missing or a value fails Mongoose schema validation (e.g.
name shorter than 3 characters, unrecognised type value, or missing baseUrlApi for an "api" agency).Returned when an agency with the same
code already exists. Agency codes are derived from name and enforced as unique by a MongoDB index.