User Address .: Update

API Reference / v15

Update an Address for a User

This endpoint allows you to update/modify a particular address for a user. To update an address, you must have a user access token with the manage_user_addresses permission.

Request Endpoint

PUT /v15/user_addresses/:id

Authorization Required – User Token in Header

Authorization: token user="123897-99SCvr3kSe3TqqQid3DyPXfo2Kq98MyhF6CaNPqoDeMhJ18Uopq19uddcznu6R"

Request Body

{
  "user_address": {
      "nickname": "Mi Casa",
      "street_address": "125 Main Street"
  }
}

cURL Example

curl https://sandbox.thelevelup.com/v15/user_addresses/11 \
  -H Accept:application/json \
  -H Content-Type:application/json \
  -H 'Authorization:token user="123897-99SCvr3kSe3TqqQid3DyPXfo2Kq98MyhF6CaNPqoDeMhJ18Uopq19uddcznu6R"'

cURL Example

curl -X PUT -H Accept:application/json -H Content-Type:application/json -H 'Authorization:token user="123897-99SCvr3kSe3TqqQid3DyPXfo2Kq98MyhF6CaNPqoDeMhJ18Uopq19uddcznu6R"' -d '{ "user_address": { "nickname": "Mi Casa","street_address": "125 Main Street"} }' https://sandbox.thelevelup.com/v15/user_addresses/11

Responses

HTTP/1.1 200 OK

{
  "user_address": {
      "address_type": "home",
      "extended_address": "Apt 1",
      "id": 11,
      "latitude": 42.362603,
      "locality": "Boston",
      "longitude": -71.065063,
      "nickname": "Mi Casa",
      "postal_code": "02114",
      "region": "MA",
      "street_address": "125 Main St"
  }
}

Response Parameters

Parameters Type Description
address_type String The type of the address. Valid values are ‘billing’, 'delivery’, 'home’, 'other’, 'payment’, 'shipping’, and 'work’.
extended_address String The second portion of a user’s address.
id Integer The ID of the address.
latitude Float The latitude of the address.
locality String The city of the address.
longitude Float The longitude of the address.
nickname String The nickname of the address.
postal_code String The ZIP code of the address.
region String The state of the address.
street_address String The street and number of the address.

The address was not found

HTTP/1.1 404 Not Found