Skip to content

Update a company address

PATCH
/addresses/{address_id}
curl --request PATCH \
--url https://api.fleet.co/platform/v1/addresses/42 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "first_name": "example", "last_name": "example", "phone": "example", "phone_country": "FR", "address1": "example", "address2": "example", "zip": "example", "city": "example", "administrative_area": "IT-MI", "state": "example", "country": "FR", "type": "HOME", "label": "example", "comment": "example", "is_default": true, "user_id": 42 }'

Contact, label, type, comment, default, and user_id changes keep the address id. A change of location (street, zip, city, area, or country) archives the address, so delivered orders and devices keep their history, and returns a new address with a new id; the old id then answers ADDRESS_NOT_FOUND.

address_id
required

Address id

string
/^[1-9]\d*$/

Example

42
Media typeapplication/json
object
first_name
string
>= 1 characters
last_name
string
>= 1 characters
phone
string
>= 1 characters
phone_country

ISO 3166-1 alpha-2 country code

string

Example

FR
address1
string
>= 1 characters <= 255 characters
address2
string
>= 1 characters <= 70 characters
zip
string
>= 1 characters
city
string
>= 1 characters
administrative_area

State, province or prefecture, as its local code (MI) or ISO 3166-2 code (IT-MI). Required for US, CA, IT, AU, MX and JP; optional for ES; rejected elsewhere.

string
>= 1 characters

Example

IT-MI
state

Deprecated: send administrative_area instead. Read only when administrative_area is absent and it names an area of the country.

string
country

ISO 3166-1 alpha-2 country code

string

Example

FR
type
string
Allowed values: HOME OFFICE PO_BOX EXTERNAL_STORAGE
label
string
>= 1 characters
comment
string
>= 1 characters
is_default
boolean
user_id

Employee who lives at this HOME address. An employee has one personal address: assigning this one replaces their previous link, and the address takes the employee’s name, email, and phone (a phone sent here also updates the employee).

integer

Example

42

Updated address

Media typeapplication/json
object
data
required
object
id
required
integer
first_name
required
string
nullable
last_name
required
string
nullable
phone
required
string
nullable
phone_country
required
string
nullable
email
required
string
nullable
address1
required
string
nullable
address2
required
string
nullable
type
required

Address kind: OFFICE, HOME, PO_BOX or EXTERNAL_STORAGE

string
nullable
zip
required
string
nullable
city
required
string
nullable
state
required

Legacy free-text state, no longer written: read administrative_area instead.

string
nullable
administrative_area
required

Local subdivision code

string
nullable
administrative_area_iso
required

ISO 3166-2 subdivision code

string
nullable
country
required

ISO 3166-1 alpha-2 country code

string
nullable
label
required
string
nullable
comment
required
string
nullable
is_default
required
boolean
is_hq
required
boolean
user_id
required

Employee who lives at this HOME address; null for other addresses

integer
nullable
created_at
required
string
nullable
updated_at
required
string
nullable

Example

{
"data": {
"administrative_area": "MI",
"administrative_area_iso": "IT-MI",
"country": "FR"
}
}

Validation error, INVALID_ADDRESS when the administrative area is missing or does not belong to the country, or ADDRESS_NOT_HOME when user_id is sent for an address that is not HOME

Media typeapplication/json
Any of:
object
message
required

Every validation failure, comma-separated

string
type
required
string
Allowed values: validation_error
error
required
string
Allowed values: validation_error

Example

{
"message": "Required, must be an ISO 3166-1 alpha-2 country code",
"type": "validation_error",
"error": "validation_error"
}

Missing, invalid, or revoked API key

Media typetext/plain
string

Example

Unauthorized

The API key has READ scope; this operation needs WRITE

Media typeapplication/json
object
error
required
string
Allowed values: INSUFFICIENT_SCOPE

Example

{
"error": "INSUFFICIENT_SCOPE"
}

Resource not found; USER_NOT_FOUND when user_id is not an active user of the company

Media typeapplication/json
object
error
required
string
Allowed values: COMPANY_NOT_FOUND ADDRESS_NOT_FOUND DELIVERY_COUNTRY_NOT_FOUND USER_NOT_FOUND

Example

{
"error": "COMPANY_NOT_FOUND"
}

ADDRESS_HAS_ASSIGNED_USER when changing the type of a HOME address an employee lives at

Media typeapplication/json
object
error
required
string
Allowed values: ADDRESS_HAS_ASSIGNED_USER

Example

{
"error": "ADDRESS_HAS_ASSIGNED_USER"
}

Rate limit exceeded. The RateLimit-* headers give the limit and the reset time.

Media typetext/plain
string

Example

Too many requests, please try again later.

Unexpected server error

Media typeapplication/json
object
error
required
string
Allowed values: INTERNAL_ERROR

Example

{
"error": "INTERNAL_ERROR"
}

Rate limiting is temporarily unavailable; retry with backoff

Media typeapplication/json
object
message
required
string

Example generated

{
"message": "example"
}