Cards
The CardService
allows you to manage cards, including blocking, unblocking, activating, and setting limits.
Methods:
Method | Description | Corresponding API call |
---|---|---|
getCards(page: number, size: number) | List all cards | Get cards |
createPlasticCard(request: CreatePlasticCardRequest) | Issue a new plastic card | Issue plastic card |
createVirtualCard() | Issue a new virtual card | Issue virtual card |
activateCard(cardId: string, request: ActivateCardRequest) | Activate a card | Activate card |
blockCard(cardId: string) | Block a card | Block card |
unblockCard(cardId: string) | Unblock a card | Unblock card |
closeCard(cardId: string) | Close a card | Close card |
setCardLimit(cardId, request: SetCardLimitRequest) | Set card spending limit | Set card limit |
setActiveBalance(cardId: string, tokenAddress: string) | Set active balance for card | Set card limit |
getCardCvv(cardId: string, actionToken: string) | Retrieve card CVV | Get CVV |
getCardPin(cardId: string, actionToken: string) | Retrieve card PIN | Get PIN |
getCardDetails(cardId: string, actionToken: string) | Retrieve full card details | Get details |
subscribeToCardsChange(callback) | Subscribe to cards change events | New card webhook Card change webhook |
Usage Examples:
Fetching cards
WirexPay.card.getCards(1, 10)
.then(response => console.log('Cards list:', response))
.catch(error => console.error('Error:', error));
Setting Card Spending Limit
WirexPay.card.setCardLimit('card123', { limit: 5000 })
.then(() => console.log('Limit set successfully'))
.catch(error => console.error('Error setting limit:', error));
Subscribing to Cards Changes
WirexPay.card.subscribeToCardsChange((cards) => {
console.log('Updated cards array', cards);
});
Updated 4 months ago
What’s Next