Wallgent
Guides

Cards & Issuing

Issue virtual cards linked to Wallgent wallets with spending controls and real-time authorization.

Overview

Wallgent integrates with Stripe Issuing to let your AI agents create and use virtual cards. Cards are linked to wallets — spending draws from the wallet balance, and policies control how much and where the card can be used.

Card types:

TypeDescription
PERSISTENTReusable card for ongoing subscriptions and purchases
SINGLE_USEOne-time card that is automatically cancelled after capture

Cardholders

Before issuing cards, create a cardholder to associate billing information.

Create a Cardholder

POST /v1/cards/cardholders

Request Body

FieldTypeRequiredDescription
namestringYesCardholder name
emailstringNoContact email
phonestringNoContact phone
billingAddressobjectYesBilling address (see below)

Billing Address

FieldTypeRequiredDescription
line1stringYesStreet address
line2stringNoApartment, suite, etc.
citystringYesCity
statestringYesState/province
postalCodestringYesPostal code
countrystringYesISO 3166-1 alpha-2 country code
{
  "name": "Research Agent Corp",
  "email": "agent@company.com",
  "billingAddress": {
    "line1": "123 Main St",
    "city": "San Francisco",
    "state": "CA",
    "postalCode": "94105",
    "country": "US"
  }
}

Issuing Cards

Create a Card

POST /v1/cards

Request Body

FieldTypeRequiredDescription
walletIdstringYesWallet to fund the card from
typestringYesPERSISTENT or SINGLE_USE
spendingLimitsarrayNoSpending limit rules

Spending Limit Object

FieldTypeRequiredDescription
amountstringYesMaximum spend for the interval
intervalstringYesper_authorization, daily, weekly, monthly, yearly, all_time
categoriesstring[]NoRestrict to specific MCC categories
const card = await wg.cards.create({
  walletId: 'wal_01J...',
  type: 'PERSISTENT',
  spendingLimits: [
    { amount: '500.00', interval: 'monthly' },
    { amount: '100.00', interval: 'per_authorization' },
  ],
});

List Cards

GET /v1/cards?walletId=wal_01J...

Returns all cards for the organization, optionally filtered by wallet.

Get Card Details

GET /v1/cards/:id

Returns card metadata (last4, brand, status). Does not include the full card number or CVC.

Get Sensitive Card Details

GET /v1/cards/:id/details

Returns the full card number, CVC, and expiry. Requires the cards:sensitive_read permission. Every access is audit-logged for PCI-DSS compliance.

{
  "number": "4242424242424242",
  "cvc": "123",
  "expMonth": 12,
  "expYear": 2027
}

Card Management

Freeze / Unfreeze

PATCH /v1/cards/:id
{ "status": "INACTIVE" }

Set status to INACTIVE to freeze or ACTIVE to unfreeze.

Update Spending Limits

PATCH /v1/cards/:id
{
  "spendingLimits": [
    { "amount": "1000.00", "interval": "monthly" }
  ]
}

Cancel a Card

DELETE /v1/cards/:id

Permanently cancels the card. This cannot be undone.


Authorization Flow

When a card is used at a merchant, Stripe sends a real-time authorization request:

  1. Stripe checks the card's spending limits and status
  2. The authorization amount is held against the wallet balance
  3. On capture, the hold is converted to a permanent debit
  4. On reversal, the hold is released

List Authorizations

GET /v1/cards/:id/authorizations

Returns the authorization history for a card.


Webhook Events

EventDescription
card.createdCard was created
card.updatedCard status or limits changed
card.cancelledCard was cancelled
card.authorization.approvedAuthorization was approved
card.authorization.declinedAuthorization was declined
card.authorization.capturedAuthorization was captured (funds debited)
card.authorization.reversedAuthorization was reversed (hold released)
card.refund.createdRefund was issued to the card

MCP Tools

ToolDescription
wallgent_create_cardCreate a virtual card linked to a wallet
wallgent_list_cardsList cards, optionally by wallet
wallgent_freeze_cardFreeze a card to stop spending
wallgent_unfreeze_cardUnfreeze a card to resume spending

Permissions

PermissionRequired For
payments:writeCreate cards, create cardholders, update/cancel cards
payments:readList cards, get card details, list authorizations
cards:sensitive_readAccess full card number and CVC

On this page