Address

Address: Create

See also the 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 can't 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.

There is a limit of 50 addresses that can be saved per customer. Addresses can also be created with a payment method or created with a customer and a payment method.

  1. DOTNET
var request = new AddressRequest
{
    FirstName         = "Jenna",
    LastName          = "Smith",
    Company           = "Braintree",
    StreetAddress     = "1 E Main St",
    ExtendedAddress   = "Suite 403",
    Locality          = "Chicago",
    Region            = "Illinois",
    PostalCode        = "60622",
    CountryCodeAlpha2 = "US"
};

Result<Address> result = gateway.Address.Create("TheCustomerId", request);

If the address or customer can't be found, it will throw a NotFoundException.

Arguments
CustomerIdrequired, string
A string value representing an existing customer in your Vault that you want to create an address for.
Additional Parameters
Companystring
Company name. 255 character maximum.

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

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

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

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

The extended address information—such as apartment or suite number. 255 character maximum.
FirstNamestring
The first name. The first name value must be less than or equal to 255 characters.
The phone number that belongs to the address that is structured with country code and national number.
Country code of phone number. 1-3 digits. Required.
National number of phone number. 4-12 digits. Required.
LastNamestring
The last name. The last name value must be less than or equal to 255 characters.
Localitystring
The locality/city. 255 character maximum.

Deprecated.

We recommend using international_phone. This functionality still exists in the gateway but is no longer documented. This parameter will be removed in the future.

The postal code. Postal code must be a string of 4-9 alphanumeric characters, optionally separated by a dash or a space. Spaces and hyphens are ignored.
Regionstring
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.
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.