Skip to main content

Profile Information

Introduction​

The Profile Information module contains features that allow you to manage customer-related details.

Profile Service​

The ProfileService gives access to information related to customer profile and balance.

Get Profile​

Retrieves customer information. By default, limited information is returned. Use ProfileInclude array parameter to add additional information into the response:

Get default profile information​

import { Wallet } from '@paysafe/paysafe-wallet-saas-web/wallet';

Wallet.getInstance().getProfileService().getProfile()
.then((customerInfo) => console.log('Customer info', customerInfo))
.catch((error) => console.error(error));

Get detailed profile information​

import { Wallet } from '@paysafe/paysafe-wallet-saas-web/wallet';

Wallet.getInstance().getProfileService().getProfile([ProfileInclude.ACCOUNTS, ProfileInclude.RESTRICTIONS, ProfileInclude.ADDRESS, ProfileInclude.CONTACTINFO])
.then((customerInfo) => console.log('Customer info', customerInfo))
.catch((error) => console.error(error));

Both methods return CustomerInfo instance.

Get Customer Accounts​

Retrieves customer Account[]

import { Wallet } from '@paysafe/paysafe-wallet-saas-web/wallet';

Wallet.getInstance().getProfileService().getAccounts()
.then((accounts) => console.log('Accounts', accounts))
.catch((error) => console.error(error));

Get Customer Account​

Retrieves customer Account by account ID

import { Wallet } from '@paysafe/paysafe-wallet-saas-web/wallet';

const accountId = '1234567890';

Wallet.getInstance().getProfileService().getSingleAccount(accountId)
.then((account) => console.log('Account', account))
.catch((error) => console.error(error));

Account object has as a field virtualInstruments of type VirtualPaymentInstrument[]. These virtual instruments can be of the following types:

The discriminator by which can be determined the type of the VirtualPaymentInstrument is the instrumentType field of the object.

warning

Field instruments is deprecated and will be removed in a future version. Use the Payment Instruments API instead. The instruments field on the Account object includes only a subset of supported payment instrument types. The implementation is not maintained, and future instrument types will not be included in this field. To get all payment instruments, use PaymentInstrumentService.getAll().

Account object has a deprecated field instruments of type PaymentInstrument[]. These payment instruments can be of the following types:

The discriminator by which can be determined the type of the PaymentInstrument is the instrumentType field of the object.

Add Customer Account​

Adds a new customer account.

import { Wallet } from '@paysafe/paysafe-wallet-saas-web/wallet';

const addAccountRequest: AddAccountRequest = {
currencyCode: 'EUR'
};

Wallet.getInstance().getProfileService().addAccount(addAccountRequest)
.then((account) => console.log('Account', account))
.catch((error) => console.error(error));