Skip to main content

Prepaid Cards

Introduction

The Cards module exposes features for managing prepaid cards, like create card, update fetching list of the cards.

CardService

Service class for managing prepaid card related operations.

Use the following code to obtain an instance of CardService:

const cardService = Wallet.getInstance().getCardService();

Get customer prepaid cards

Retrieve a list of all prepaid cards for the current customer. CardParameters are the parameters for filtering the customer's cards. Use include parameter to add additional information into the response: TOKENIZATIONS - include information about the mobile wallets tokenizations.

CardScheme

The response is a CardList object which contains Card and PagingResultMeta objects.

MobileWalletType

MobileWalletStatus

const cardParameters: CardParameters = {
cardType: CardType.VIRTUAL,
limit: null,
offset: null,
status: [CardStatus.ACTIVE, CardStatus.EXPIRED],
include: [CardIncludesParam.TOKENIZATIONS]
};

Wallet.getInstance().getCardService().getAll(cardParameters)
.then(response => console.log('Cards list', response))
.catch(error => console.error('Error fetching cards', error));
tip

You can achieve pagination by combining the limit and offset filters. For instance, implementing pagination with a page size of 2 results per page would involve configuring:

  • Page 1: limit=2, offset=0
  • Page 2: limit=2, offset=2
  • Page 3: limit=2, offset=4

Retrieve single prepaid card

Provides detailed information about specific card by cardId. The response is a single card object.

const cardId = 'f16ba382-eb42-481a-b08f-c57bdc9aae24';
const include = [CardIncludesParam.TOKENIZATIONS];

Wallet.getInstance().getCardService().get(cardId, include)
.then(response => console.log('Card', response))
.catch(error => console.error('Error fetching card', error));

Create a prepaid card

Create a new Physical or Virtual prepaid card for a customer, based on the provided programName.

CardRequest

const cardRequest: CardRequest = {
programName: 'SKRILL-VIRTUAL-MC-EEA',
currency: 'BGN',
mobile: '+1 123456789',
cardPin: null,
externalId: null,
deliveryAddress: null,
termsAndConditionsAccepted: true,
eDisclosureAccepted: true
};

Wallet.getInstance().getCardService().create(cardRequest)
.then(response => console.log('Created card', response))
.catch(error => console.error('Error creating card', error));

The parameters for PHYSICAL card application are the same, but you need to specify the deliveryAddress parameter.

const cardRequest: CardRequest = {
programName: 'SKRILL-PHYSICAL-MC-EEA',
currency: 'BGN',
mobile: '+1 123456789',
cardPin: null,
externalId: null,
deliveryAddress: {
address1: 'Tsarigradsko Shose 73',
address2: null,
address3: null,
city: 'Sofia',
countryCode: 'BG',
state: null,
postalCode: '1000'
},
termsAndConditionsAccepted: true,
eDisclosureAccepted: true
};

Wallet.getInstance().getCardService().create(cardRequest)
.then(response => console.log('Created card', response))
.catch(error => console.error('Error creating card', error));

Activate a prepaid physical card

This endpoint facilitates the activation of a specific prepaid physical card, identified by its unique cardId. The card can be activated only once and only while it is with status ISSUED or DIGITAL. Once activated, the card's status transitions to ACTIVE, enabling users to conveniently utilize their physical card.

CardActivationRequest

const cardId = 'f16ba382-eb42-481a-b08f-c57bdc9aae24';
const cardActivationRequest: CardActivationRequest = {
lastFourDigits: '1234',
cvv: '567'
};

Wallet.getInstance().getCardService().activate(cardId, cardActivationRequest)
.then(response => console.log('Activated card', response))
.catch(error => console.error('Error activating card', error));

Update prepaid card status

The customer can change/update the status of their prepaid cards, and as a result, lock/unlock or cancel their prepaid card.

In the table below, you can find information about the statuses that the user can change.

From \ ToACTIVECANCELLEDLOCKEDDIGITAL
ACTIVE-
CANCELLED-
LOCKED-
DIGITAL✅ (By PIN & CHIP)-

CardUpdateRequest

const cardUpdateRequest: CardUpdateRequest = {
status: CardStatus.ACTIVE,
statusReason: 'User Activate Card from LOCKED status',
pin: '1243'
};
const cardId = 'f16ba382-eb42-481a-b08f-c57bdc9aae24';

Wallet.getInstance().getCardService().update(cardId, cardUpdateRequest)
.then(response => console.log('Updated card', response))
.catch(error => console.error('Error updating card', error));

Get prepaid card details

Card sensitive information can be retrieved. The response contains card sensitive information such as pan, cvv, expiry, cardHolderName.

Wallet.getInstance().getCardService().getDetails('f16ba382-eb42-481a-b08f-c57bdc9aae24')
.then(response => console.log('Card details', response))
.catch(error => console.error('Error getting card details', error));

Get prepaid card details url

Sensitive card information can be retrieved using a special url which can be retrieved by the following method. Language parameter is optional and default to en-US. The response contains the url which will load sensitive card details.

Wallet.getInstance().getCardService().getDetailsUrl('f16ba382-eb42-481a-b08f-c57bdc9aae24', 'en-GB')
.then(response => console.log('Card details url', response))
.catch(error => console.error('Error getting card details url', error));

Retrieve customer eligible prepaid cards programs

Retrieve eligible programs for a customer. The result list can be filtered by program type. If the customer is eligible for a Prepaid card, the response will contain a non-empty programs array. The number of cards that can be issued of a given type can be seen in the allowableCards field.

Wallet.getInstance().getCardService().getPrograms()
.then(response => console.log('Programs list', response))
.catch(error => console.error('Error fetching programs', error));