See also the
Braintree_Address response object.
The only attribute required to create an address is the
customerId. Addresses stored in the Vault need to be associated to a customer. You cannot specify Address ID. It is always generated by the gateway as two alphanumeric characters. Address IDs are unique to the customer, so multiple customers can have the same address ID.
$result = Braintree_Address::create([ 'customerId' => '131866', 'firstName' => 'Jenna', 'lastName' => 'Smith', 'company' => 'Braintree', 'streetAddress' => '1 E Main St', 'extendedAddress' => 'Suite 403', 'locality' => 'Chicago', 'region' => 'Illinois', 'postalCode' => '60622', 'countryCodeAlpha2' => 'US' ]);
If the customer cannot be found, you'll receive a
The country name specified in an address. We only accept specific country names.
A string value representing an existing customer in your Vault that you want to create an address for.
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.
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.
Still have questions?
If you can’t find an answer, contact our Support team.