# Update an account address

Source: https://developers.swell.is/backend-api/account-addresses/update-an-account-address

Update an existing account address using the ID that was returned when created.

## Arguments

- `id` (objectId, required): Unique identifier for the address.
- `parent_id` (objectId, required): The ID of the parent customer.
- `address1` (string, required)
- `city` (string): City where the address is located.
- `company` (string): Customer's company name, if applicable.
- `country` (string): Country of the residence.
- `first_name` (string): First name listed for the address.
- `last_name` (string): Last name listed for the address.
- `name` (string): Combined name listed for the address.
- `state` (string): State of the address.
- `zip` (string): Postal code of the address.

## Example request

`PUT /accounts:addresses/:id`

**cURL**

```sh
$ curl https://api.swell.store/accounts:addresses/62cdb5332c0a5f00123c5fd7 \
  -u store-id:secret-key \
  -d address1="456 Breezehome St" \
  -X PUT
```

**Node**

```javascript
const { swell } = require('swell-node');
swell.init('store-id', 'secret-key');

await swell.put('/accounts:addresses/{id}', {
  id: '62cdb5332c0a5f00123c5fd7',
  address1: '456 Breezehome St'
});
```

**PHP**

```php
<?php $swell = new \Swell\Client('store-id', 'secret-key');

$swell->put('/accounts:addresses/{id}', [
  'id' => '62cdb5332c0a5f00123c5fd7',
  'address1' => '456 Breezehome St'
]);
```

## Example response

```json
{
  "parent_id": "621e53a6213eaf013d1fa6b2",
  "name": "Njada Stonearm",
  "first_name": "Njada",
  "last_name": "Stonearm",
  "address1": "456 Breezehome St",
  "address2": null,
  "city": "Whiterun",
  "state": "NY",
  "zip": null,
  "country": "US",
  "phone": null,
  "fingerprint": "1219483071269e91f9528ac1c4237944",
  "date_created": "2022-07-12T17:53:55.762Z",
  "date_updated": "2022-07-14T10:22:41.318Z",
  "active": true,
  "id": "62cdb5332c0a5f00123c5fd7"
}
```
