The Create Location endpoint adds a new geographic entry — a province, state, or region — to the Ship Quote database. TheDocumentation 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.
adminFullCode is automatically derived from the countryCode and adminCode you supply (e.g. ES + 28 → ES-28), and a URL-safe normalizedName is generated from the name field. Province entries created here are subsequently resolvable via the List Provinces and Province by Postal Code endpoints, and their adminFullCode values are used directly as the province parameter in compareByProvinceCode.
Endpoint
Request Body
Two-letter ISO-3166-1 alpha-2 country code in uppercase. Examples:
ES for
Spain, FR for France, IT for Italy. Maximum 2 characters. The value is
stored uppercased.Full human-readable country name. Examples:
España, France. Maximum 50
characters. The API normalises the value to Title Case on write (e.g.
"españa" → "España").Administrative region code for the province, state, or region. This can be a
numeric string (e.g.
"28" for Madrid) or an alphabetic abbreviation (e.g.
"VI" for Álava, "AB" for Albacete). Stored in uppercase. Together with
countryCode this forms the adminFullCode, which is constructed
automatically as countryCode + "-" + adminCode.Display name of the province or region. Examples:
Madrid, Álava,
Albacete. Maximum 50 characters. A URL-safe lowercase normalizedName is
derived automatically (accents stripped, spaces replaced with underscores).Classification of the geographic entry. Accepted values:
province, state,
region. Defaults to province when omitted.Response
A successful request returnsHTTP 201 Created with the persisted location document in the response body.
MongoDB ObjectId of the newly created location document.
Uppercased ISO-2 country code as stored (e.g.
ES).Title-cased country name as stored (e.g.
España).Uppercased administrative region code (e.g.
28, VI).Fully-qualified code with country prefix, automatically constructed as
countryCode + "-" + adminCode (e.g. ES-28, ES-VI). This is
the value you pass as province to POST /rates/compareByProvinceCode.Title-cased province name as stored (e.g.
Madrid).Auto-generated lowercase, accent-stripped, underscore-separated name used
for internal indexing (e.g.
madrid, alava).Two-digit postal prefix associated with this province (e.g.
28 for
Madrid, 01 for Álava). This field is required by the model but is not
part of the create request body — seed data sets it during bootstrap.The stored entry type:
province, state, or region.ISO 8601 timestamp of when the document was created.
ISO 8601 timestamp of the most recent update.
Examples
Error Responses
The
adminFullCode field carries a unique index in MongoDB. If you
attempt to create a second province with the same adminFullCode (e.g.
ES-28), the API returns a 400 with a duplicate key error. Use List
Provinces first to check whether a province
already exists.