Customer Vault API

The Customer Vault API allows you to create customer profiles containing their payment information – i.e., tokens – and then to make repeat payments without having to directly access sensitive payment information. It is a highly efficient and secure method for enabling repeat customer payments.

Click the links below to view our code samples.

Verify That the Service Is Accessible

paysafeApiClient.CustomerServiceHandler(paysafeApiClient).monitor(
	function(error, response) {});

Customer Profile

Create a customer profile
var profile = new paysafeApiClient.Profiles();
profile.setMerchantCustomerId(Math.random().toString(36).slice(2));
profile.setLocale("en_US");
profile.setFirstName("Alex");
profile.setLastName("ward");
profile.setEmail("alex.ward@cya.com");
profile.setPhone("713-444-5555");
paysafeApiClient.CustomerServiceHandler(paysafeApiClient).createCustmerProfile(
	profile,
	function(error, response) {});
Create a customer profile using a single-use token
var profile = new paysafeApiClient.Profiles();
var card = new paysafeApiClient.Card();
profile.setMerchantCustomerId(Math.random().toString(36).slice(2));
profile.setLocale("en_US");
profile.setFirstName("Alex");
profile.setLastName("ward");
profile.setEmail("alex.ward@cya.com");
profile.setPhone("713-444-5555");
card.setSingleUseToken("SCrGrrRANmOVtcVc");
profile.setCard(card);
paysafeApiClient.CustomerServiceHandler(paysafeApiClient).createCustmerProfile(
	profile,
	function(error, response) {});
Look up a customer profile
var profile = new paysafeApiClient.Profiles();
profile.setId("e5f567a2-6661-45ef-8103-48069c51c6a2");
paysafeApiClient.CustomerServiceHandler(paysafeApiClient).getCustmerProfile(
	profile,
	function(error, response) {});
Update a customer profile
var profile = new paysafeApiClient.Profiles();
profile.setId("e5f567a2-6661-45ef-8103-48069c51c6a2");
profile.setMerchantCustomerId(Math.random().toString(36).slice(2));
profile.setLocale("en_US");
profile.setFirstName("anna");
profile.setLastName("Perry");
profile.setEmail("anna.perry@cya.com");
profile.setPhone("713-444-5555");
paysafeApiClient.CustomerServiceHandler(paysafeApiClient).updateCustmerProfile(
	profile,
	function(error, response) {});
Delete a customer profile
var profile = new paysafeApiClient.Profiles();
profile.setId("e5f567a2-6661-45ef-8103-48069c51c6a2")
paysafeApiClient.CustomerServiceHandler(paysafeApiClient).deleteCustmerProfile(
	profile,
	function(error, response) {});

Profile Addresses

Create a customer address
var profile = new paysafeApiClient.Profiles();
var address = new paysafeApiClient.Address();
address.setStreet2("1009 Buenos Aires");
address.setCity("Buenos Aires");
address.setCountry("AR");
address.setZip("C1009ABK");
address.setRecipientName("Jane Doe");
profile.setId("aa237581-2635-4b93-8b7e-01d60a59a5f4");
address.setProfile(profile);
paysafeApiClient.CustomerServiceHandler(paysafeApiClient).createCustmerAddress(
	address,
	function(error, response) {});
Look up a customer address
var profile = new paysafeApiClient.Profiles();
var address = new paysafeApiClient.Address();
address.setId("3ddfa51c-fcce-48b9-96bc-c86fd3222239");
profile.setId("aa237581-2635-4b93-8b7e-01d60a59a5f4");
address.setProfile(profile);
paysafeApiClient.CustomerServiceHandler(paysafeApiClient).getCustmerAddress(
	address,
	function(error, response) {});
Update a customer address
var profile = new paysafeApiClient.Profiles();
var address = new paysafeApiClient.Address();
address.setId("3ddfa51c-fcce-48b9-96bc-c86fd3222239");
profile.setId("aa237581-2635-4b93-8b7e-01d60a59a5f4");
address.setProfile(profile);
address.setNickName("Alex ward");
paysafeApiClient.CustomerServiceHandler(paysafeApiClient).updateCustmerAddress(
	address,
	function(error, response) {});
Delete a customer address
var profile = new paysafeApiClient.Profiles();
var address = new paysafeApiClient.Address();
address.setId("3ddfa51c-fcce-48b9-96bc-c86fd3222239");
profile.setId("aa237581-2635-4b93-8b7e-01d60a59a5f4");
address.setProfile(profile);
paysafeApiClient.CustomerServiceHandler(paysafeApiClient).deleteCustmerAddress(
	address,
	function(error, response) {});

Profile Cards

Create a customer card
var profile = new paysafeApiClient.Profiles();
var card = new paysafeApiClient.Card();
var cardExp = new paysafeApiClient.CardExpiry();
profile.setId("1ef8881f-71fe-4c94-b48d-869f913c8c8d");
card.setHolderName("AP");
card.setCardNum("6011234567890123");
card.setDefaultCardIndicator("true");
cardExp.setMonth("09");
cardExp.setYear("2019");
card.setCardExpiry(cardExp);
card.setProfile(profile);
card.setBillingAddressId("7994e959-166f-4e6b-a3c9-21692148fc58");
paysafeApiClient.CustomerServiceHandler(paysafeApiClient).createCustmerCard(
	card,
	function(error, response) {});
Look up a customer card
var profile = new paysafeApiClient.Profiles();
var card = new paysafeApiClient.Card();
card.setId("3af29625-b633-41ad-b165-70c40efd7948");
profile.setId("1ef8881f-71fe-4c94-b48d-869f913c8c8d");
card.setProfile(profile);
paysafeApiClient.CustomerServiceHandler(paysafeApiClient).getCustmerCard(
	card,
	function(error, response) {});
Update a customer card
var profile = new paysafeApiClient.Profiles();
var card = new paysafeApiClient.Card();
var cardExp = new paysafeApiClient.CardExpiry();
card.setId("3af29625-b633-41ad-b165-70c40efd7948");
profile.setId("1ef8881f-71fe-4c94-b48d-869f913c8c8d");
card.setHolderName("AP");
card.setCardNum("6011234567890123");
card.setDefaultCardIndicator("false");
cardExp.setMonth("02");
cardExp.setYear("2021");
card.setCardExpiry(cardExp);
card.setProfile(profile);
card.setBillingAddressId("7994e959-166f-4e6b-a3c9-21692148fc58");
paysafeApiClient.CustomerServiceHandler(paysafeApiClient).updateCustmerCard(
	card,
	function(error, response) {});
Delete a customer card
var profile = new paysafeApiClient.Profiles();
var card = new paysafeApiClient.Card();
card.setId("3af29625-b633-41ad-b165-70c40efd7948");
profile.setId("1ef8881f-71fe-4c94-b48d-869f913c8c8d");
card.setProfile(profile);
paysafeApiClient.CustomerServiceHandler(paysafeApiClient).deleteCustmerCard(
	card,
	function(error, response) {});

Profile Bank Accounts

Managing ACH Bank Accounts

Create an ACH bank account
var profile = new paysafeApiClient.Profiles();
profile.setId("a7b218e7-290a-4434-aea2-a1f985fc26c0");
var achbankAccount = new paysafeApiClient.ACHBankAccounts();
achbankAccount.setnickName("John's RBC Business Bank Account");
achbankAccount.setaccountHolderName("XYZ Business");
achbankAccount.setaccountNumber("511201");
achbankAccount.setroutingNumber("123456789");
achbankAccount.setBillingAddressId("7994e959-166f-4e6b-a3c9-21692148fc58");
achbankAccount.setaccountType("CHECKING");
achbankAccount.setProfile(profile);
paysafeApiClient.CustomerServiceHandler(paysafeApiClient).createACHBankAccount(
	achbankAccount,
	function(error, resCreateachbankaccount) {});
Look up an ACH bank account
var profile = new paysafeApiClient.Profiles();
profile.setId("a7b218e7-290a-4434-aea2-a1f985fc26c0");
var achbankaccounts = new paysafeApiClient.ACHBankAccounts();
achbankaccounts.setId("6a275b7c-6f11-4ed1-ae77-21071724574a");
achbankaccounts.setProfile(profile);
paysafeApiClient.CustomerServiceHandler(paysafeApiClient).getACHBankAccount(
	achbankaccounts,
	function(error, responseDel) {});
Update an ACH bank account
var profile = new paysafeApiClient.Profiles();
profile.setId("a7b218e7-290a-4434-aea2-a1f985fc26c0");
var achbankAccount = new paysafeApiClient.ACHBankAccounts();
achbankaccounts.setId("6a275b7c-6f11-4ed1-ae77-21071724574a");
achbankAccount.setaccountHolderName("John RBC Business Bank Account");
achbankAccount.setroutingNumber("123456789");
achbankAccount.setBillingAddressId("7994e959-166f-4e6b-a3c9-21692148fc58");
achbankAccount.setaccountType("SAVINGS");
achbankAccount.setProfile(profile);
paysafeApiClient.CustomerServiceHandler(paysafeApiClient).updateACHBankAccount(
	achbankAccount,
	function(error, resCreateachbankaccount) {});
Delete an ACH bank account
var profile = new paysafeApiClient.Profiles();
profile.setId("a7b218e7-290a-4434-aea2-a1f985fc26c0");
var achbankaccounts = new paysafeApiClient.ACHBankAccounts();
achbankaccounts.setId("6a275b7c-6f11-4ed1-ae77-21071724574a");
achbankaccounts.setProfile(profile);
paysafeApiClient.CustomerServiceHandler(paysafeApiClient).deleteACHBankAccount(
	achbankaccounts,
	function(error, responseDel) {});

Managing BACS Bank Accounts

Create a BACS bank account
var profile = new paysafeApiClient.Profiles();
profile.setId("a7b218e7-290a-4434-aea2-a1f985fc26c0");
var bacsbankAccount = new paysafeApiClient.BACSBankAccounts();
bacsbankAccount.setnickName("Sally's Barclays Account");
bacsbankAccount.setaccountHolderName("Sally Barnes");
bacsbankAccount.setaccountNumber("51120172");
bacsbankAccount.setsortCode("123456");
bacsbankAccount.setBillingAddressId("7994e959-166f-4e6b-a3c9-21692148fc58");
bacsbankAccount.setProfile(profile);
paysafeApiClient.CustomerServiceHandler(paysafeApiClient).createBACSBankAccount(
	bacsbankAccount,
	function(error, resCreateachbankaccount) {});
Create a BACS bank account with a mandate
var profile = new paysafeApiClient.Profiles();
profile.setId("a7b218e7-290a-4434-aea2-a1f985fc26c0");
var mandates = new paysafeApiClient.Mandates();
mandates.setreference("SUBSCRIP45");
var bacsbankAccount = new paysafeApiClient.BACSBankAccounts();
bacsbankAccount.setnickName("Sally's Barclays Account");
bacsbankAccount.setaccountHolderName("Sally Barnes");
bacsbankAccount.setaccountNumber("51120172");
bacsbankAccount.setsortCode("123456");
bacsbankAccount.setBillingAddressId("7994e959-166f-4e6b-a3c9-21692148fc58");
bacsbankAccount.setmandates([mandates]);
bacsbankAccount.setProfile(profile);
paysafeApiClient.CustomerServiceHandler(paysafeApiClient).createBACSBankAccount(
	bacsbankAccount,
	function(error, resCreateachbankaccount) {});
Look up a BACS bank account
var profile = new paysafeApiClient.Profiles();
profile.setId("a7b218e7-290a-4434-aea2-a1f985fc26c0");
var bacsbankAccount = new paysafeApiClient.BACSBankAccounts();
bacsbankAccount.setId("6a275b7c-6f11-4ed1-ae77-21071724574a");
bacsbankAccount.setProfile(profile);
paysafeApiClient.CustomerServiceHandler(paysafeApiClient).getBACSBankAccount(
	bacsbankAccount,
	function(error, responseDel) {});
Update a BACS bank account
var profile = new paysafeApiClient.Profiles();
profile.setId("a7b218e7-290a-4434-aea2-a1f985fc26c0");
var bacsbankAccount = new paysafeApiClient.BACSBankAccounts();
bacsbankAccount.setId("6a275b7c-6f11-4ed1-ae77-21071724574a");
bacsbankAccount.setnickName("Sally's Barclays Account");
bacsbankAccount.setmerchantRefNum("8hrf983hf89djwjfsdk");
bacsbankAccount.setaccountHolderName("Sally Barclays ");
bacsbankAccount.setbillingAddressId("7994e959-166f-4e6b-a3c9-21692148fc58");
bacsbankAccount.setProfile(profile);
paysafeApiClient.CustomerServiceHandler(paysafeApiClient).updateBACSBankAccount(
	bacsbankAccount,
	function(error, resUpdatebacsbankaccount) {});
Delete a BACS bank account
var profile = new paysafeApiClient.Profiles();
profile.setId("a7b218e7-290a-4434-aea2-a1f985fc26c0");
var bacsbankAccount = new paysafeApiClient.BACSBankAccounts();
bacsbankAccount.setId("6a275b7c-6f11-4ed1-ae77-21071724574a");
bacsbankAccount.setProfile(profile);
bacsbankAccount.CustomerServiceHandler(paysafeApiClient).deleteBACSBankAccount(
	bacsbankAccount,
	function(error, responseDel) {});

Managing EFT Bank Accounts

Create an EFT bank account
var profile = new paysafeApiClient.Profiles();
profile.setId("a7b218e7-290a-4434-aea2-a1f985fc26c0");
var eftbankAccount = new paysafeApiClient.EFTBankAccounts();
eftbankAccount.setnickName("Sally's Bank of Montreal Account");
eftbankAccount.setaccountHolderName("Sally");
eftbankAccount.setaccountNumber("511201");
eftbankAccount.settransitNumber("25039");
eftbankAccount.setinstitutionId("001");
eftbankAccount.setbillingAddressId("60022f38-fd17-4731-909c-923930d0d5d4");
eftbankAccount.setProfile(profile);
paysafeApiClient.CustomerServiceHandler(paysafeApiClient).createEFTBankAccount(
	eftbankAccount,
	function(error, resCreateeftbankaccount) {});
Look up an EFT bank account
var profile = new paysafeApiClient.Profiles();
profile.setId("a7b218e7-290a-4434-aea2-a1f985fc26c0");
var eftankaccounts = new paysafeApiClient.EFTBankAccounts();
eftankaccounts.setId("6a275b7c-6f11-4ed1-ae77-21071724574a");
eftankaccounts.setProfile(profile);
paysafeApiClient.CustomerServiceHandler(paysafeApiClient).getEFTBankAccount(
	eftankaccounts,
	function(error, responsegetEFT) {});
Update an EFT bank account
var profile = new paysafeApiClient.Profiles();
profile.setId("a7b218e7-290a-4434-aea2-a1f985fc26c0");
var eftbankAccount = new paysafeApiClient.EFTBankAccounts();
eftbankAccount.setId("6a275b7c-6f11-4ed1-ae77-21071724574a");
eftbankAccount.setnickName("Sally's Bank of Montreal Account");
eftbankAccount.setaccountHolderName("Jhon Smith");
eftbankAccount.settransitNumber("25039");
eftbankAccount.setinstitutionId("001");
eftbankAccount.setbillingAddressId("60022f38-fd17-4731-909c-923930d0d5d4");
eftbankAccount.setProfile(profile);
paysafeApiClient.CustomerServiceHandler(paysafeApiClient).updateEFTBankAccount(
	eftbankAccount,
	function(error, resUpdateeftbankaccount) {});
Delete an EFT bank account
var profile = new paysafeApiClient.Profiles();
profile.setId("a7b218e7-290a-4434-aea2-a1f985fc26c0");
var eftankaccounts = new paysafeApiClient.EFTBankAccounts();
eftankaccounts.setId("6a275b7c-6f11-4ed1-ae77-21071724574a");
eftankaccounts.setProfile(profile);
paysafeApiClient.CustomerServiceHandler(paysafeApiClient).deleteEFTBankAccount(
	eftankaccounts,
	function(error, responsegetEFT) {});

Managing SEPA Bank Accounts

Create a SEPA bank account
var profile = new paysafeApiClient.Profiles();
profile.setId("a7b218e7-290a-4434-aea2-a1f985fc26c0");
var sepabankAccount = new paysafeApiClient.SEPABankAccounts();
sepabankAccount.setaccountHolderName("Sally Barnes");
sepabankAccount.setiban("TN5914207207100707129648");
sepabankAccount.setbillingAddressId("60022f38-fd17-4731-909c-923930d0d5d4");
sepabankAccount.setbic("OKOYFIHH");
sepabankAccount.setProfile(profile);
paysafeApiClient.CustomerServiceHandler(paysafeApiClient).createSEPABankAccount(
	sepabankAccount,
	function(error, resCreatesepabankaccount) {});
Create a SEPA bank account with a mandate
var profile = new paysafeApiClient.Profiles();
profile.setId("a7b218e7-290a-4434-aea2-a1f985fc26c0");
var mandates = new paysafeApiClient.Mandates();
mandates.setreference("ABCDEFGHIJ10987");
var sepabankAccount = new paysafeApiClient.SEPABankAccounts();
sepabankAccount.setaccountHolderName("Sally Barnes");
sepabankAccount.setnickName("Sally's Account");
sepabankAccount.setiban("PL27114020040000300201355387");
sepabankAccount.setbillingAddressId("60022f38-fd17-4731-909c-923930d0d5d4");
sepabankAccount.setbic("OKOYFIHH");
sepabankAccount.setmandates([mandates]);
sepabankAccount.setProfile(profile);
paysafeApiClient.CustomerServiceHandler(paysafeApiClient).createSEPABankAccount(
	sepabankAccount,
	function(error, resCreatesepabankaccount) {});
Look up a SEPA bank account
var profile = new paysafeApiClient.Profiles();
profile.setId("a7b218e7-290a-4434-aea2-a1f985fc26c0");
var sepabankAccount = new paysafeApiClient.SEPABankAccounts();
sepabankAccount.setId("6a275b7c-6f11-4ed1-ae77-21071724574a ");
sepabankAccount.setProfile(profile);
paysafeApiClient.CustomerServiceHandler(paysafeApiClient).getSEPABankAccount(
	sepabankAccount,
	function(error, responsegetSEPA) {});
Update a SEPA bank account
var profile = new paysafeApiClient.Profiles();
profile.setId("a7b218e7-290a-4434-aea2-a1f985fc26c0");
var sepabankAccount = new paysafeApiClient.SEPABankAccounts();
sepabankAccount.setId("6a275b7c-6f11-4ed1-ae77-21071724574a");
sepabankAccount.setnickName("Jhon Smith's Account");
sepabankAccount.setmerchantRefNum("8hrf983hf89djwjfsdk");
sepabankAccount.setbillingAddressId("d2a82a0f-142e-404d-b41d-a8704e2664e2");
sepabankAccount.setaccountHolderName("Jhon Smith");
sepabankAccount.setiban("SM86U0322509800000000270100");
sepabankAccount.setProfile(profile);
paysafeApiClient.CustomerServiceHandler(paysafeApiClient).updateSEPABankAccount(
	sepabankAccount,
	function(error, resupdatesepabankaccount) {});
Delete a SEPA bank account
var profile = new paysafeApiClient.Profiles();
profile.setId("a7b218e7-290a-4434-aea2-a1f985fc26c0");
var sepabankAccount = new paysafeApiClient.SEPABankAccounts();
sepabankAccount.setId("6a275b7c-6f11-4ed1-ae77-21071724574a");
sepabankAccount.setProfile(profile);
paysafeApiClient.CustomerServiceHandler(paysafeApiClient).deleteSEPABankAccount(
	sepabankAccount,
	function(error, responsegetSEPA) {});

Mandates

Create a BACS bank account mandate
var profile = new paysafeApiClient.Profiles();
profile.setId("a7b218e7-290a-4434-aea2-a1f985fc26c0");
var mandates = new paysafeApiClient.Mandates();
var bacsbankAccount = new paysafeApiClient.BACSBankAccounts();
bacsbankAccount.setId("5c9941e0-b30b-4cff-b7ff-eee697a76ab3");
mandates.setreference("SUBSCRIP45");
mandates.setprofiles(profile);
mandates.setbacsbankaccounts(bacsbankAccount);
paysafeApiClient.CustomerServiceHandler(paysafeApiClient).createMandates(
	mandates,
	function(error, resCreateBACSMandates) {});
Create a SEPA bank account mandate
var profile = new paysafeApiClient.Profiles();
profile.setId("a7b218e7-290a-4434-aea2-a1f985fc26c0");
var mandates = new paysafeApiClient.Mandates();
var sepabankAccount = new paysafeApiClient.SEPABankAccounts();
sepabankAccount.setId("bd3031cf-414e-4f7f-be24-d97f8b696674");
mandates.setreference("SUBSCRIPTIP457");
mandates.setprofiles(profile);
mandates.setsepabankaccounts(sepabankAccount);
paysafeApiClient.CustomerServiceHandler(paysafeApiClient).createMandates(
	mandates,
	function(error, resCreateSEPAMandates) {});
Look up a mandate
var profile = new paysafeApiClient.Profiles();
profile.setId("a7b218e7-290a-4434-aea2-a1f985fc26c0");
var mandates = new paysafeApiClient.Mandates();
mandates.setId("e250fdeb-dceb-4953-9268-8305d06b9292");
mandates.setprofiles(profile);
paysafeApiClient.CustomerServiceHandler(paysafeApiClient).lookupMandates(
	mandates,
	function(error, resLookupMandates) {});
Update a mandate
var profile = new paysafeApiClient.Profiles();
profile.setId("a7b218e7-290a-4434-aea2-a1f985fc26c0");
var mandates = new paysafeApiClient.Mandates();
mandates.setId("551ca705-7eb1-4b9a-98e5-cb7b4a9e549d");
mandates.setstatus("ACTIVE");
mandates.setprofiles(profile);
paysafeApiClient.CustomerServiceHandler(paysafeApiClient).updateMandates(
	mandates,
	function(error, resUpdateMandates) {});
Delete a mandate
var profile = new paysafeApiClient.Profiles();
profile.setId("a7b218e7-290a-4434-aea2-a1f985fc26c0");
var mandates = new paysafeApiClient.Mandates();
mandates.setId("551ca705-7eb1-4b9a-98e5-cb7b4a9e549d");
mandates.setprofiles(profile);
paysafeApiClient.CustomerServiceHandler(paysafeApiClient).deleteMandates(
	mandates,
	function(error, resDeleteMandates) {});

Process a Payment Using a Payment Token

Process an authorization with a payment token
var authorization = new paysafeApiClient.Authorization();
var card = new paysafeApiClient.Card();
card.setPaymentToken("CdELTQJoyuHg6In");
authorization.setCard(card);
authorization.setMerchantRefNum(Math.random().toString(36).slice(2));
authorization.setAmount("1250000");
authorization.setSettleWithAuth("false");
paysafeApiClient.cardServiceHandler(paysafeApiClient).authorize(
	authorization,
	function(error, response) {});
Verify a card using a payment token
var verification = new paysafeApiClient.Verification();
var card = new paysafeApiClient.Card();
var merchantRefNumber = Math.random().toString(36).slice(2);
card.setPaymentToken("CdZTeC8xEE0uIK0");
verification.setMerchantRefNum(merchantRefNumber);
verification.setCard(card);
paysafeApiClient.cardServiceHandler(paysafeApiClient).verify(
	verification,
	function(error, response) {});
Did you find this page useful?