---
updatedAt: 2025-04-21T20:01:11.000Z
agentTools:
  projectIndex: https://partner.wirexpaychain.com/llms.txt
---

# 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](https://partner.wirexpaychain.com/reference/get_cards)                                                                              |
| `createPlasticCard(request: CreatePlasticCardRequest)`       | Issue a new plastic card         | [Issue plastic card](https://partner.wirexpaychain.com/reference/post_cards-plastic)                                                            |
| `createVirtualCard()`                                        | Issue a new virtual card         | [Issue virtual card](https://partner.wirexpaychain.com/reference/post_cards-virtual)                                                            |
| `activateCard(cardId: string, request: ActivateCardRequest)` | Activate a card                  | [Activate card](https://partner.wirexpaychain.com/reference/put_cards-cardid-activate)                                                          |
| `blockCard(cardId: string)`                                  | Block a card                     | [Block card](https://partner.wirexpaychain.com/reference/put_cards-cardid-block)                                                                |
| `unblockCard(cardId: string)`                                | Unblock a card                   | [Unblock card](https://partner.wirexpaychain.com/reference/put_cards-cardid-unblock)                                                            |
| `closeCard(cardId: string)`                                  | Close a card                     | [Close card](https://partner.wirexpaychain.com/reference/put_cards-cardid-close)                                                                |
| `setCardLimit(cardId, request: SetCardLimitRequest)`         | Set card spending limit          | [Set card limit](https://partner.wirexpaychain.com/reference/put_cards-cardid-limit)                                                            |
| `setActiveBalance(cardId: string, tokenAddress: string)`     | Set active balance for card      | [Set card limit](https://partner.wirexpaychain.com/reference/put_cards-cardid-limit)                                                            |
| `getCardCvv(cardId: string, actionToken: string)`            | Retrieve card CVV                | [Get CVV](https://partner.wirexpaychain.com/reference/post_cards-cardid-cvv)                                                                    |
| `getCardPin(cardId: string, actionToken: string)`            | Retrieve card PIN                | [Get PIN](https://partner.wirexpaychain.com/reference/post_cards-cardid-pin)                                                                    |
| `getCardDetails(cardId: string, actionToken: string)`        | Retrieve full card details       | [Get details](https://partner.wirexpaychain.com/reference/post_cards-cardid-details)                                                            |
| `subscribeToCardsChange(callback)`                           | Subscribe to cards change events | [New card webhook](https://partner.wirexpaychain.com/docs/webhooks#cardnewwebhook)  [Card change webhook](https://partner.wirexpaychain.com/docs/webhooks#cardchangeswebhook) |

## **Usage Examples:**

### **Fetching cards**

```typescript
WirexPay.card.getCards(1, 10)
  .then(response => console.log('Cards list:', response))
  .catch(error => console.error('Error:', error));
```

### **Setting Card Spending Limit**

```typescript
WirexPay.card.setCardLimit('card123', { limit: 5000 })
  .then(() => console.log('Limit set successfully'))
  .catch(error => console.error('Error setting limit:', error));
```

### **Subscribing to Cards Changes**

```typescript
WirexPay.card.subscribeToCardsChange((cards) => {
  console.log('Updated cards array', cards);
});
```