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:
- Authentication via valid JWT
- Validation of mandatory minimum fields (lat, lng, name, company_name)
- Automatic reverse geocoding from coordinates
- Automatic creation of the complete address
- Association with the user’s company
- 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
- 200
- 400
- 401
- 404
- 500
Address created successfully
Response Headers
Validation Error - Missing required fields or invalid format
Response Headers
Authentication Error - Invalid token or company not found
Response Headers
User not found
Response Headers
Internal server error