Create Test Cards
Generate custom test cards via API
Create Test Cards
Generate custom test cards with specific properties for advanced testing scenarios.
Test Cards API
Create cards with custom attributes:
const testCard = await plexy.testHelpers.issuing.cards.create({
brand: 'visa',
funding: 'credit',
country: 'US',
status: 'active',
});
console.log(testCard.number); // Generated test card number
console.log(testCard.cvc); // Generated CVCCard properties
| Property | Options |
|---|---|
brand | visa, mastercard, amex, discover |
funding | credit, debit, prepaid |
country | ISO country code (e.g., US, GB, DE) |
status | active, inactive, blocked |
Custom decline behavior
Create cards that trigger specific declines:
const declineCard = await plexy.testHelpers.issuing.cards.create({
brand: 'visa',
decline_on: {
cvc_check: 'fail',
avs_check: 'fail',
},
});Balance testing
Create cards with specific balances:
const limitedCard = await plexy.testHelpers.issuing.cards.create({
brand: 'mastercard',
spending_limit: 10000, // $100.00
currency: 'USD',
});
// Payments over $100 will be declinedIssuing cards
For Plexy Issuing, create test cards with:
const issuedCard = await plexy.testHelpers.issuing.cards.create({
cardholder: 'ich_abc123',
type: 'virtual',
spending_controls: {
allowed_categories: ['restaurants', 'groceries'],
spending_limits: [
{
amount: 50000,
interval: 'monthly',
},
],
},
});Simulate transactions
Simulate authorizations and captures:
// Simulate authorization
await plexy.testHelpers.issuing.authorizations.create({
card: issuedCard.id,
amount: 2500,
merchant_data: {
name: 'Test Merchant',
category: 'restaurants',
},
});
// Simulate capture
await plexy.testHelpers.issuing.transactions.create({
card: issuedCard.id,
amount: 2500,
});API reference
Create test card
POST /v2/test_helpers/issuing/cardsParameters
| Parameter | Type | Description |
|---|---|---|
brand | string | Card brand |
funding | string | Funding type |
country | string | ISO country code |
status | string | Card status |
decline_on | object | Decline conditions |
spending_limit | number | Maximum amount |