Test your integration

Use sandbox terminals and test cards to verify every payment scenario before going live.

View as MarkdownInstall skills

VINR provides a full sandbox environment — no physical hardware required. The sandbox mirrors the live API exactly: same endpoints, same event payloads, same webhook delivery. Switch between environments with your API key prefix (sk_test_ vs sk_live_).

Sandbox vs liveAsk

SandboxLive
API keyssk_test_... / pk_test_...sk_live_... / pk_live_...
TerminalsSimulated — no hardware neededPhysical VINR-certified hardware
PaymentsNever move real moneyReal card transactions
WebhooksDelivered to your test endpointDelivered to your live endpoint
Dashboardsandbox.dashboard.vinr.comdashboard.vinr.com

Sandbox and live are completely isolated environments. Terminals, API keys, webhooks, and customers created in sandbox do not exist in live, and vice versa.


Sandbox terminalsAsk

Every test account includes three pre-provisioned simulated terminals. You can also create additional simulated terminals via the API.

Terminal IDBehaviour
term_test_defaultSucceeds for all standard test cards
term_test_offlineSimulates a terminal that is offline when the session is created, then comes online after 10 seconds
term_test_busyReturns terminal_busy for the first attempt, then succeeds on a retry

Create additional sandbox terminals

const terminal = await vinr.terminals.create({
  label: 'Test counter 1',
  locationId: 'loc_test_main',
});
// terminal.id → "term_test_abc123..."

Test cardsAsk

Use these card numbers with any future expiry date (e.g. 12/30), any 3-digit CVV, and any billing postcode.

Standard outcomes

Card numberOutcomedeclineCode
4242 4242 4242 4242Success — contactless
4000 0000 0000 0077Success — chip + PIN
4000 0000 0000 0002Declinedcard_declined
4000 0000 0000 9995Insufficient fundsinsufficient_funds
4000 0000 0000 0069Expired cardexpired_card
4000 0000 0000 0119Processing errorprocessing_error
4000 0000 0000 0259Incorrect PINincorrect_pin
4000 0000 0000 0341Lost or stolenlost_or_stolen
4000 0000 0000 9979Do not honourdo_not_honour

Feature-specific cards

Card numberWhat it tests
4000 0000 0000 3220Triggers 3D Secure (online payments only)
4000 0000 0000 0341Triggers fraud decline (tests your security policy flow)
4242 4242 4242 4242 (debit variant)Partial authorization — approved for 50% of amount
4000 0000 0000 0101DCC eligible — foreign cardholder (EUR card, USD transaction)

Network-specific cards

Card numberNetwork
4242 4242 4242 4242Visa
5555 5555 5555 4444Mastercard
3714 4963 5398 431American Express
6011 1111 1111 1117Discover

Test specific scenariosAsk

Successful contactless payment

const vinr = new Vinr({ secretKey: 'sk_test_...' });

const tp = await vinr.terminal.payments.create({
  terminalId: 'term_test_default',
  amount: 2500,
  currency: 'USD',
  reference: 'test_order_001',
});

// Sandbox auto-completes after ~2 seconds
// Your webhook receives terminal_payment.completed

Card declined flow

const tp = await vinr.terminal.payments.create({
  terminalId: 'term_test_default',
  amount: 2500,
  currency: 'USD',
  reference: 'test_order_002',
  testCard: '4000000000000002', // card_declined
});

// Your webhook receives terminal_payment.failed
// event.data.object.declineCode === 'card_declined'

Use the testCard field on sandbox sessions to force a specific card scenario without physical card presentation.

Terminal offline then recovery

const tp = await vinr.terminal.payments.create({
  terminalId: 'term_test_offline', // goes online after 10 s
  amount: 1000,
  currency: 'USD',
  reference: 'test_order_003',
});

// Session stays in 'pending' for ~10 seconds, then auto-completes
// Useful for testing your UI loading/waiting state

Timeout (no card presented)

const tp = await vinr.terminal.payments.create({
  terminalId: 'term_test_default',
  amount: 1000,
  currency: 'USD',
  reference: 'test_order_004',
  testScenario: 'timeout', // session expires after 5 s in sandbox
});

// Your webhook receives terminal_payment.cancelled
// event.data.object.cancellationReason === 'timeout'

Test webhooks locallyAsk

Use the VINR CLI to receive sandbox events on your local machine without a public URL:

# Install the CLI
npm install -g @vinr/cli

# Login with your test key
vinr login --key sk_test_...

# Forward terminal events to your local server
vinr listen --forward-to localhost:3000/api/webhooks \
  --events terminal_payment.completed,terminal_payment.failed,terminal_payment.cancelled

The CLI prints each event in real time, shows your server's HTTP response, and highlights signature verification failures.


Sandbox rate limits and quotasAsk

Sandbox has the same rate limits as the live API. There is no additional throttling on test accounts, but sandbox data (terminals, payments, events) is automatically purged after 90 days.


Checklist before switching to liveAsk

Work through the Go live checklist — it covers compliance, terminal certification, and the live-mode enablement steps required before processing real card-present transactions.

Was this page helpful?
Edit on GitHub

Last updated on

On this page