Skip to main content

Create simplified address

POST 

/company/address/simple

Create a new address in a simplified manner using only coordinates and basic data.
This endpoint is optimized for cases where exact coordinates are known and an address needs to be created quickly without the complexity of Google Maps data.

Operation flow:

  1. Authentication via valid JWT
  2. Validation of mandatory minimum fields (lat, lng, name, company_name)
  3. Automatic reverse geocoding from coordinates
  4. Automatic creation of the complete address
  5. Association with the user’s company
  6. Return of the created address

Advantages of this endpoint:

  • Requires only 4 mandatory fields vs ~15 in the standard endpoint
  • Automatic geocoding from coordinates
  • Reuses the proven logic of the bulk import system
  • Maintains the same data quality as normal creation

Typical use cases:

  • Mobile applications with GPS
  • Integration from third-party systems with coordinates
  • Quick creation from interactive maps
  • Simplified bulk creation

Example request:

POST /company/address/simple  
Authorization: Bearer \{token\}
Content-Type: application/json

\{
lat: 40.416775,
lng: -3.703790,
name: Head Office,
company_name: CargoOffer SL,
phone: +34912345678,
isDefault: false
\}

Example successful response:

\{  
_id: 507f1f77bcf86cd799439011,
name: Head Office,
company_name: CargoOffer SL,
phone: +34912345678,
street: Calle de Alcalá, 42,
city: madrid,
zipcode: 28014,
country: es,
location: \{
type: Point,
coordinates: [-3.703790, 40.416775]
\},
is_default: false,
can_be_deleted: true
\}

Important note about phones:

  • Phone numbers must be in a valid format for Spain, France, or Portugal

Requires an active subscription (validated by the isPaymentUpdate middleware)

Request

Responses

Address created successfully

Response Headers