Virtual Card Integration Guide (End-to-End)

Introduction

This guide walks you through the entire lifecycle of a virtual card: from user registration to card issuance, funding, spending, and handling webhook events.

It’s designed to help developers build a working card implementation quickly, using only essential endpoints and best practices.

What You’ll Build

A complete card experience:

Register a user

Create a virtual card

Top up the card

Handle a transaction

Process a refund or reversal

Freeze, unfreeze, or terminate the card

Listen for real-time webhooks

Prerequisites

Your API key

Webhook endpoint set up and reachable

Understanding of your wallet or funding flow (e.g., float, stablecoin)

1.

Register the Card User

All cards must be tied to a registered card user.

Request
Register User Request
Response
Register User Response

➡️ Store card_user_id — you’ll need it to create cards and fetch transactions.

2.

Create a Virtual Card

Now issue a card for the user.

Request
Create Card Request
Response
Create Card Response

➡️ Store cardId — you’ll use it for top-ups and spend tracking.

3.

Top Up the Card

Fund the card so it can be used.

Response
Top Up Card Response

At this point, the card is ready for use.

4.

Handle Card Spend

Once the user uses the card (e.g., Netflix, Spotify), you’ll get a webhook.

Webhook: virtualcard.transaction.debit

Webhook: virtualcard.transaction.debit

➡️ Use this to update user transaction history and deduct from UI balance.

5.

Handle Refunds and Reversals

Sometimes merchants reverse or refund charges.

Webhook: virtualcard.transaction.refund

Webhook: virtualcard.transaction.refund

Webhook: virtualcard.transaction.reversed

Webhook: virtualcard.transaction.reversed
6.

Freeze, Unfreeze, or Terminate the Card

Freeze:

POST /api/v1/virtualcards/freeze

Unfreeze:

POST /api/v1/virtualcards/unfreeze

Terminate:

POST /api/v1/virtualcards/terminate

➡️ Card cannot be recovered after termination.

7.

Webhook Summary

EventUse
virtualcard.created.successCard issued
virtualcard.topup.successTop-up confirmed
virtualcard.transaction.debitSpend confirmed
virtualcard.transaction.refundRefund received
virtualcard.transaction.reversedPre-auth or silent transaction reversed
virtualcard.transaction.declinedSpend failed
virtualcard.transaction.declined.terminatedCard terminated after too many fails
virtualcard.transaction.terminated.refundRefund to closed card, credited to float

Developer Notes

Use idempotency keys for top-ups and card creation

Always verify webhook signatures (see webhook doc)

Track card status in your database (active, frozen, terminated)

Do not store CVV post-creation

Display maskedPan only after user authentication

Did you find this page useful?