See also the Braintree_Address response object.

note

In addition to updating an address directly, you can also update an address while updating a customer or updating a payment method.

PHP
Click to copy
Copied
Braintree_Address::update('theCustomerId', 'theAddressId', [
  'firstName'         => 'Jenna',
  'lastName'          => 'Smith',
  'company'           => 'Braintree',
  'streetAddress'     => '1 E Main St',
  'extendedAddress'   => 'Suite 403',
  'locality'          => 'Chicago',
  'region'            => 'Illinois',
  'postalCode'        => '60622',
  'countryCodeAlpha2' => 'US'
]);

If the address or customer cannot be found, you'll receive a Braintree_Exception_NotFound exception.

Arguments
customerId required, string

A string value representing an existing customer in your Vault.

addressId required, string

The two-letter value for an address associated with a specific customer ID. The maximum number of addresses per customer is 50. You must pass customer_id, then address_id in order to successfully update this value.

Additional Parameters
'company' string

Company name. 255 character maximum.

'countryCodeAlpha2' string

The ISO 3166-1 alpha-2 country code specified in an address. The gateway only accepts specific alpha-2 values.

'countryCodeAlpha3' string

The ISO 3166-1 alpha-3 country code specified in an address. The gateway only accepts specific alpha-3 values.

'countryCodeNumeric' string

The ISO 3166-1 numeric country code specified in an address. The gateway only accepts specific numeric values.

'countryName' string

The country name specified in an address. We only accept specific country names.

'extendedAddress' string

The extended address information—such as apartment or suite number. 255 character maximum.

'firstName' string

The first name. The first name value must be less than or equal to 255 characters.

'lastName' string

The last name. The last name value must be less than or equal to 255 characters.

'locality' string

The locality/city. 255 character maximum.

'postalCode' string

The postal code. Postal code must be a string of 4-9 alphanumeric characters, optionally separated by a dash or a space. Spaces, hyphens, and all other special characters are ignored.

'region' string

The state or province. For PayPal addresses, the region must meet PayPal's state restrictions; for all other payment methods, it must be less than or equal to 255 characters.

'streetAddress' string

The street address. 255 character maximum. Required when used to create payment methods or transactions that perform verification when AVS rules are configured to require street address.

Still have questions?

If you can’t find an answer, contact our Support team.