Skip to main content

Create simplified address

POST 

/company/address/simple

Creates a new address in a simplified way 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 minimum required fields (lat, lng, name, company_name)
  3. Automatic reverse geocoding from coordinates
  4. Automatic creation of complete address
  5. Association to the user's company
  6. Return of the created address

Advantages of this endpoint:

  • Requires only 4 mandatory fields vs ~15 of the standard endpoint
  • Automatic geocoding from coordinates
  • Reuses proven logic from 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

Request example:

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

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

Successful response example:

{
"_id": "507f1f77bcf86cd799439011",
"name": "Central 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
}

Request

Responses

Address created successfully