Skip to main content

Create new address

POST 

/api/address/

Register a new address associated with the authenticated company.

Functionality:

  • Creates a new address with the provided data
  • Validates the phone number format (if provided)
  • Automatically associates the address with the company
  • If coordinates (lat/lng) are provided, automatically completes the address data

Required fields:

  • name: Descriptive name for the address
  • street: Street name and number
  • city: City
  • postalCode: Postal code
  • country: Country

Optional fields:

  • phone: Phone number (must have a valid format)
  • lat/lng: Geographic coordinates for auto-completing the address
  • company_name: Company name for the address

Request example:

{
name: Main Warehouse,
street: Avenida Industrial 456,
city: Barcelona,
postalCode: 08001,
country: Spain,
phone: +34931234567,
lat: 41.3851,
lng: 2.1734,
company_name: Logística Barcelona S.L.
}

Request

Responses

Address created successfully