Skip to content

Customer Vault

TIP

This section describes the canonical methods for creating and managing Customer records. The endpoints described in the Customers (Deprecated) section are still available for use, but be advised that using endpoints from both groups in your application simultaneously can result in unintended behaviors.

Create Customer Record

Creates a new Customer record that can contain stored preferences, payment methods, and addresses.

Request Method: POST

URL Endpoint: /api/vault/customer

NameTypeDefaultDescriptionRequired
idstringgenerated valueOptionally, you may provide a custom id for storing the vaulted customer. Max 40 characters (a-z, A-Z, 0-9)
id_formatstring literalOptionally defines a format for the gateway to use when auto-generating an id ("xid_type_last4"). Cannot be used if providing a custom id.
descriptionstring""Text field, max 255 characters
flagsstring array[]Array containing flags for customer settings ("surcharge_exempt")
default_paymentobjectnullObject containing ach payment method details
default_payment
    .card
objectnullObject containing card payment method details
default_payment
    .card
        .number
string""Card number
default_payment
    .card
        .expiration_date
string""Card expiration date ("MMYY" or "MM/YY")required if default_payment.card is present
default_payment
    .ach
objectnullObject containing ach payment method details
default_payment
    .ach
        .account_number
string""Account number
default_payment
    .ach
        .routing_number
string""Routing number
default_payment
    .ach
        .account_type
string literalAch account type ("checking" or "savings")required if default_payment.ach is present
default_payment
    .ach
        .sec_code
string literalAch sec code ("web", "ccd", or "ppd")required if default_payment.ach is present
default_payment
    .token
stringPayment method token generated by Tokenizer form
default_payment
    .apple_pay
objectnullObject containing Apple Pay payment method details
default_payment
    .apple_pay
        .key_id
string""Merchant Apple Pay IDrequired if default_payment.apple_pay is present
default_payment
    .apple_pay
        .processor_id
string""Processor ID
default_payment
    .apple_pay
        .temporary_token
string""Token from WalletJS responserequired if using WalletJS
default_payment
    .apple_pay
        .pkpaymenttoken
objectnullPKPaymentToken from Apple Pay JS responserequired if using Apple Pay JS
default_payment
    .google_pay_token
object or stringnullObject or string containing a Google Pay token
default_billing_addressobjectnullObject containing billing address details
default_billing_address
    .first_name
string""Addressee first name
default_billing_address
    .last_name
string""Addressee last name
default_billing_address
    .company
string""Company name
default_billing_address
    .line_1
string""Street address
default_billing_address
    .line_2
string""Additional delivery details
default_billing_address
    .city
string""City name
default_billing_address
    .state
string""State code ("CA")
default_billing_address
    .postal_code
string""Postal code ("12345")
default_billing_address
    .country
string""Country code ("US")
default_billing_address
    .email
string""Email address (must be valid email format, "example@mail.com")
default_billing_address
    .phone
string""Phone number ("3216540987")
default_billing_address
    .fax
string""("3216540987")
default_shipping_addressobjectnullObject containing shipping address details
default_shipping_address
    .first_name
string""Addressee first name
default_shipping_address
    .last_name
string""Addressee last name
default_shipping_address
    .company
string""Company name
default_shipping_address
    .line_1
string""Street address
default_shipping_address
    .line_2
string""Additional delivery details
default_shipping_address
    .city
string""City name
default_shipping_address
    .state
string""State code ("CA")
default_shipping_address
    .postal_code
string""Postal code ("12345")
default_shipping_address
    .country
string""Country code ("US")
default_shipping_address
    .email
string""Email address (must be valid email format, "example@mail.com")
default_shipping_address
    .phone
string""Phone number ("3216540987")
default_shipping_address
    .fax
string""("3216540987")

Get Customer Record By ID

Retrieve details for the specified customer.

Request Method: GET

URL Endpoint: /api/vault/{ customer id }

json
{
  "status": "success",
  "msg": "success",
  "data": {
    "id": "952f250d-fa85-40ac-a45e-3886f98032c6",
    "owner_id": "testmerchant12345678",
    "data": {
      "customer": {
        "addresses": [
          {
            "city": "Some Town",
            "company": "Some Business",
            "country": "US",
            "email": "user@somesite.com",
            "fax": "555555555",
            "first_name": "John",
            "hash": "cV9qS6UvnnRDJCkgfitHqGrKSRfTARDsLy5zfkNNTcM=",
            "id": "bl6nqk69ku6897l45fp0",
            "last_name": "Smith",
            "line_1": "",
            "line_2": "",
            "phone": "5555555555",
            "postal_code": "60187",
            "state": "IL"
          }
        ],
        "defaults": {
          "billing_address_id": "bl6nqk69ku6897l45fp0",
          "payment_method_id": "bl6nqk69ku6897l45fq0",
          "payment_method_type": "card",
          "shipping_address_id": "bl6nqk69ku6897l45fp0"
        },
        "description": "test description",
        "payments": {
          "ach": [],
          "cards": [
            {
              "card_type": "visa",
              "expiration_date': '2020-12-31T00:00:00Z',
              'id': 'bl6nqk69ku6897l45fq0',
              'masked_number': '411111******1111'
            }
          ]
        }
      }
    },
    "created_at": "2019-08-09T09:04:00.786094073-05:00",
    "updated_at": "2019-08-09T09:04:00.786094116-05:00"
  }
}

Search Customer Records

Retrieve details for all customer records that match provided search criteria.

Request Method: POST

URL Endpoint: /api/vault/customer/search

NameTypeDefaultDescriptionRequired
idobjectObject containing details defining a customer id to match or exclude
id
    .value
string""Customer record ID to match or exclude
id
    .operator
string"""=" or "!="
address_idobjectObject containing details defining an address id to match or exclude
address_id
    .value
string""Address ID to match or exclude
address_id
    .operator
string"""=" or "!="
first_nameobjectObject containing details defining a customer first name to match or exclude
first_name
    .value
string""Customer first name to match or exclude
first_name
    .operator
string"""=" or "!="
last_nameobjectObject containing details defining a customer last name to match or exclude
last_name
    .value
string""Customer last name to match or exclude
last_name
    .operator
string"""=" or "!="
companyobjectObject containing details defining a company name to match or exclude
company
    .value
string""Customer company to match or exclude
company
    .operator
string"""=" or "!="
address_line_1objectObject containing details defining a street address to match or exclude
address_line_1
    .value
string""Customer street address to match or exclude
address_line_1
    .operator
string"""=" or "!="
address_line_2objectObject containing details defining additional address details to match or exclude
address_line_2
    .value
string""Customer address details to match or exclude
address_line_2
    .operator
string"""=" or "!="
cityobjectObject containing details defining a city to match or exclude
city
    .value
string""Customer city to match or exclude
city
    .operator
string"""=" or "!="
stateobjectObject containing details defining a state to match or exclude
state
    .value
string""Customer state to match or exclude
state
    .operator
string"""=" or "!="
postal_codeobjectObject containing details defining a postal code to match or exclude
postal_code
    .value
string""Customer postal code to match or exclude
postal_code
    .operator
string"""=" or "!="
countryobjectObject containing details defining a country to match or exclude
country
    .value
string""Customer country to match or exclude
country
    .operator
string"""=" or "!="
emailobjectObject containing details defining a customer email to match or exclude
email
    .value
string""Customer email to match or exclude
email
    .operator
string"""=" or "!="
phoneobjectObject containing details defining a phone number to match or exclude
phone
    .value
string""Customer phone to match or exclude
phone
    .operator
string"""=" or "!="
faxobjectObject containing details defining a fax number to match or exclude
fax
    .value
string""Customer fax to match or exclude
fax
    .operator
string"""=" or "!="
payment_method_typeobjectObject containing details defining a payment method type to match or exclude
payment_method_type
    .value
string""Customer payment method type to match or exclude
payment_method_type
    .operator
string"""=" or "!="
billing_address_idobjectObject containing details defining a billing address id to match or exclude
billing_address_id
    .value
string""Customer billing address id to match or exclude
billing_address_id
    .operator
string"""=" or "!="
shipping_address_idobjectObject containing details defining a shipping address id to match or exclude
shipping_address_id
    .value
string""Customer shipping address id to match or exclude
shipping_address_id
    .operator
string"""=" or "!="
created_atobjectObject containing details defining a date range to match
created_at
    .start_date
string""Beginning of date range
created_at
    .end_date
string""End of date range
updated_atobjectObject containing details defining a date range to match
updated_at
    .start_date
string""Beginning of date range
updated_at
    .end_date
string""End of date range
limitinteger10The number of results to return (1-100)
offsetinteger0The number of results to skip (1-1000)

Update Customer Record

Update an existing customer record.

Request Method: POST

URL Endpoint: /api/vault/customer/{ customer id }

NameTypeDefaultDescriptionRequired
descriptionstring""Text field, max 255 characters
notesstring""Text field, max 255 characters
flagsstring array[]Array containing flags for customer settings ("surcharge_exempt")
defaultsobjectnullObject containing id's designating payment methods and addresses to be used as defaults for the customer's transactions
defaults
    .billing_address_id
stringIf only one stored address exists on the customer record, that will be used by defaultId of stored address to use as the default billing address for transactions
defaults
    .shipping_address_id
stringIf only one stored address exists on the customer record, that will be used by defaultId of stored address to use as the default shipping address for transactions
defaults
    .payment_method_id
stringId of stored payment method to use as the default payment method for transactionsrequired if defaults.payment_method_type is present
defaults
    .payment_method_type
string literal""Type of the payment method id supplied ("card" or "ach")required if defaults.payment_method_id is present

Delete Customer Record

Delete the specified customer record.

Request Method: DELETE

URL Endpoint: /api/vault/{ customer id }

json
{
  "status": "success",
  "msg": "success"
}

Create Address Record

Create a new address record that will be stored within the customer record. A stored address can be used as the billing and/or shipping address on transactions processed for the customer.

Request Method: POST

URL Endpoint: /api/vault/customer/{ customer id }/address

NameTypeDefaultDescriptionRequired
first_namestring""Addressee first name
last_namestring""Addressee last name
companystring""Company name
line_1string""Street address
line_2string""Additional delivery details
citystring""City name
statestring""State code ("CA")
postal_codestring""Postal code ("12345")
countrystring""Country code ("US")
emailstring""Email address (must be valid email format, "example@mail.com")
phonestring""Phone number ("3216540987")
faxstring""Fax number ("3216540987")

Get Address Record By ID

TIP

Address records cannot be fetched individually, please use the Get Customer Record By ID endpoint to retrieve the collection of address records for a specified customer.

Update Address Record

Update an existing address within a customer record.

Request Method: POST

URL Endpoint: /api/vault/customer/{ customer id }/address/{ address id }

NameTypeDefaultDescriptionRequired
first_namestring""Addressee first name
last_namestring""Addressee last name
companystring""Company name
line_1string""Street address
line_2string""Additional delivery details
citystring""City name
statestring""State code ("CA")
postal_codestring""Postal code ("12345")
countrystring""Country code ("US")
emailstring""Email address (must be valid email format, "example@mail.com")
phonestring""Phone number ("3216540987")
faxstring""Fax number ("3216540987")

Delete Address Record

Delete the specified address within a customer record.

Request Method: DELETE

URL Endpoint: /api/vault/customer/{ customer id }/address/{ address id }

json
{
  "status": "success",
  "msg": "success"
}

Create Payment Method Record

Create a new stored payment method on the specified customer record. The url endpoint and request body properties vary depending on the type of payment method being created.

Request Method: POST

Create Card - URL Endpoint: /api/vault/customer/{ customer id }/card

Create ACH - URL Endpoint: /api/vault/customer/{ customer id }/ach

Create Card or ACH with Token - URL Endpoint: /api/vault/customer/{ customer id }/token

Create Card with Apple Pay Token - URL Endpoint: /api/vault/customer/{ customer id }/applepay

Create Card with Google Pay Token - URL Endpoint: /api/vault/customer/{ customer id }/googlepay

NameTypeDefaultDescriptionRequired
numberstring""Card number
expiration_datestring""Card expiration date ("MMYY" or "MM/YY")*

Create Payment Method Record Code Samples

json
{
  "status": "success",
  "msg": "success",
  "data": {
    "id': '952f250d-fa85-40ac-a45e-3886f98032c6',
    'owner_id': 'testmerchant12345678',
    'data': {
      'customer': {
        'addresses': [
          {
            'city': 'Some Town',
            'company': 'Some Business',
            'country': 'US',
            'email': 'user@somesite.com',
            'fax': '555555555',
            'first_name': 'John',
            'hash': 'cV9qS6UvnnRDJCkgfitHqGrKSRfTARDsLy5zfkNNTcM=',
            'id': 'bl6nqk69ku6897l45fp0',
            'last_name': 'Smith',
            'line_1': '',
            'line_2': '',
            'phone': '5555555555',
            'postal_code': '60187',
            'state': 'IL'
          }
        ],
        'defaults': {
          'billing_address_id': 'bl6nqk69ku6897l45fp0',
          'payment_method_id': 'bl6nqk69ku6897l45fq0',
          'payment_method_type': 'card',
          'shipping_address_id': 'bl6nqk69ku6897l45fp0'
        },
        'description': 'test description',
        'notes': '',
        'flags': ['surcharge_exempt'],
        'payments': {
          'ach': [],
          'cards': [
            {
              'card_type': 'visa',
              'expiration_date': '2020-12-31T00:00:00Z',
              'id': 'bl6nqk69ku6897l45fq0',
              'masked_number': '411111******1111'
            }
          ]
        }
      }
    },
    'created_at': '2019-08-09T09:04:00.786094073-05:00',
    'updated_at': '2019-08-09T09:04:00.786094116-05:00'
  }
}

Get Payment Method Record By ID

TIP

Payment method records cannot be fetched individually, please use the Get Customer Record By ID endpoint to retrieve the collection of payment method records for a specified customer.

Update Payment Method Record

Update an existing payment method within a customer record.

Request Method: POST

Update Card - URL Endpoint: /api/vault/customer/{ customer id }/card/{ payment method id }

Update ACH - URL Endpoint: /api/vault/customer/{ customer id }/ach/{ payment method id }

Update Token - URL Endpoint: /api/vault/customer/{ customer id }/token/{ payment method id }

NameTypeDefaultDescriptionRequired
numberstring""Card number
expiration_datestring""Card expiration date ("MMYY" or "MM/YY")*
flagsarray[]"surcharge_exempt", "applepay", "closed_contact", "contact", "locked_security", "locked_stop_recurring"

Update Payment Method Record Code Samples

json
{
  "status": "success",
  "msg": "success",
  "data": {
    "id': '952f250d-fa85-40ac-a45e-3886f98032c6',
    'owner_id': 'testmerchant12345678',
    'data': {
      'customer': {
        'addresses': [
          {
            'city': 'Some Town',
            'company': 'Some Business',
            'country': 'US',
            'email': 'user@somesite.com',
            'fax': '555555555',
            'first_name': 'John',
            'hash': 'cV9qS6UvnnRDJCkgfitHqGrKSRfTARDsLy5zfkNNTcM=',
            'id': 'bl6nqk69ku6897l45fp0',
            'last_name': 'Smith',
            'line_1': '',
            'line_2': '',
            'phone': '5555555555',
            'postal_code': '60187',
            'state': 'IL'
          }
        ],
        'defaults': {
          'billing_address_id': 'bl6nqk69ku6897l45fp0',
          'payment_method_id': 'bl6nqk69ku6897l45fq0',
          'payment_method_type': 'card',
          'shipping_address_id': 'bl6nqk69ku6897l45fp0'
        },
        'description': 'test description',
        'notes': '',
        'flags': ['surcharge_exempt'],
        'payments': {
          'ach': [],
          'cards': [
            {
              'card_type': 'visa',
              'expiration_date': '2020-12-31T00:00:00Z',
              'id': 'bl6nqk69ku6897l45fq0',
              'masked_number': '411111******1111'
            }
          ]
        }
      }
    },
    'created_at': '2019-08-09T09:04:00.786094073-05:00',
    'updated_at': '2019-08-09T09:04:00.786094116-05:00'
  }
}

Delete Payment Method Record

Delete the specified payment method within a customer record.

Request Method: DELETE

Delete Card - URL Endpoint: /api/vault/customer/{ customer id }/card/{ card id }

Delete ACH - URL Endpoint: /api/vault/customer/{ customer id }/ach/{ ach id }

json
{
  "status": "success",
  "msg": "success"
}