Braintree Vault

The vault allows you to eliminate credit card data storage from your environment and instead store that data with Braintree. In place of credit card numbers, you use tokens to charge customers. In addition to credit card data, you may also store customer data and addresses in the vault.

Customers

A customer in the Braintree vault represents your customer. The customer can have many associated credit cards and addresses. None of the customer attributes are required, so if you're only interested in storing credit card details you can create a blank customer to associate the credit card to.

Attributes

  • id — can be specified by you or generated by the gateway
  • first_name
  • last_name
  • company
  • email
  • phone
  • fax
  • website

Additional attributes may be stored by using custom fields.

If you don't specify the ID, the gateway will generate a string consisting of all numbers. Although it's numeric, the proper data type is a string. If you're specifying the ID, you can use letters, numbers, underscores, and hyphens. The maximum length is 36 characters.

All other attributes are strings with a maximum length of 255 characters. Email and website must be well-formed.

Credit Cards

A credit card belongs to a customer and can have an associated billing address. The only required attributes are number and expiration date.

Attributes

  • token - can be specified by you or generated by the gateway
  • cardholder_name
  • expiration_date (or expiration_month and expiration_year separately)
  • number

If you don't specify the token, the gateway will generate an alphanumeric string. If you're specifying the ID, you can use letters, numbers, underscores, and hyphens. The maximum length is 36 characters.

Expiration date can be passed as M/YY, M/YYYY, MM/YY, or MM/YYYY. It can also be passed as separate fields, in which expiration_month is accepted as M or MM, and year can be YY or YYYY.

cardholder_name is a string with a maximum length of 255 characters.

Credit Card Verification

When creating or updating a credit card, you may pass an option to request that the gateway performs a card verification. This will ensure that the credit card is legitimate. AVS and CVV rules will be applied here according to your configuration.

Addresses

Addresses belong to customers. They may be associated to credit cards as billing addresses.

Attributes

  • first_name
  • last_name
  • company
  • street_address
  • extended_address
  • locality (city in the US)
  • region (state in the US)
  • postal_code (zip code in the US)
  • country_name

Read-Only Attributes

  • id

All attributes are strings with a maximum length of 255 characters. Country name must be an accepted country. Addresses can't be blank, so at least one attribute is required.