> ## Documentation Index
> Fetch the complete documentation index at: https://docs.slm.m1amdocs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Address.update

The `update` method creates or updates an `Address` object. When creating a new `Address` object, do not set a value for `VID`; Subscribe will automatically generate a VID for the new object when you call `update()`. When updating an existing `Address` object, identify it with its VID.

**Note:** You can also create an `Address` object indirectly by specifying it inside other objects that you explicitly create. For example, specify `shippingAddress` when you create `Account`; specify `billingAddress` when you create `PaymentMethod`, and etc.

## Input

*srd*: sparse response description, a SOAP string (which must be a JSON object), in which you specify the elements you want returned.This parameter enables the calling system to constrain a `method` call to return only components you specify. This gives you greater control over returned content, and improves response time within the Vindicia platform by reducing the processing needed for the call.

Some fields are required, either practically or in the WSDL, and will be returned regardless of the *srd*. A null *srd* returns the complete response.

*address*: the populated `Address` object to create or update. To update an existing object, be sure to specify its VID.

## Output

*return*: an object of type `Return` that indicates the success or failure of the call.

*address*: `Address` object that was created or updated.

*created*: a Boolean flag that, if set to `true`, indicates that this method has created a new `Address` object. A false setting indicates that `update` has updated an existing `Address` object.

## Returns

This call returns the codes listed in [The Return Object](The_Return_Object).

## Example

```

// To create address information, instantiate an Address object
$address = new Address();

// populate the address object with data
$address->setAddr1('123 Main Street');
$address->setAddr2('Apt. 4');
$address->setCity('San Carlos');
$address->setDistrict('CA'); // this is US state or province
$address->setPostalCode('94070');
$address->setCountry('US');
$address->setPhone('123-456-7890');

$response = $address->update();
if($response['returnCode'] == 200) {
   $createdAddr = $response['data']->address;
   print "Address create with VID " . $createdAddr->getVID() . "\n";
}
```

**Parent topic:**[Address Methods](../topics/Address_Methods)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.