flowglad/pay-skills/card-sessions

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Create and redeem Flowglad Pay card sessions to securely access virtual card details (PAN, CVV, expiry). Use this skill when an agent or application needs to retrieve card numbers through the scoped-token security model.

Install

npx vskill@latest install flowglad/pay-skills/card-sessions

SKILL.md

Card Sessions

Abstract

Card sessions are the secure mechanism for accessing virtual card details (number, CVV, expiry) in Flowglad Pay. A session is created against a payment method, which returns a short-lived scoped JWT token. That token is then used to redeem the session and retrieve card details. This two-step flow ensures card details never leak into MCP tool contexts or long-lived API key scopes.


Table of Contents

  1. Security Model — CRITICAL
  2. Create a Card Session — CRITICAL
  3. Redeem a Card Session — CRITICAL
  4. Check Session Status — MEDIUM
  5. Audit Redemptions — MEDIUM
  6. Session Lifecycle — LOW

1. Security Model

Impact: CRITICAL — misunderstanding this causes auth failures

Card details are never returned by:

  • Standard API key authenticated endpoints
  • MCP tools (intentionally omitted from AI context windows)

Instead, card details require a scoped redeem token — a short-lived HS256 JWT with:

  • scope: card-session:redeem:{paymentMethodId}
  • sub: user ID
  • Expiry matching the session TTL

The token is returned when creating a session and must be passed via the X-Scoped-Token header when redeeming.


2. Create a Card Session

Creates a session and returns a scoped redeem token.

REST API
POST /v1/card-sessions
Header: X-API-Key: <api-key>
Content-Type: application/json

Request body:

json
{
"paymentMethodId": "pm_abc123",
"ttlSeconds": 300,
"maxRedeemCount": 1
}
FieldTypeRequiredDefaultValidation
paymentMethodIdstringYes—Must start with pm_
ttlSecondsintegerNo30030–3600
maxRedeemCountintegerNo11–10

Response (200):

json
{
"session": {
"id": "cs_xyz789",
"userId": "usr_abc",
"paymentMethodId": "pm_abc123",
"status": "active",
"maxRedeemCount": 1,
"redeemCount": 0,
"expiresAt": "2026-03-11T12:05:00.000Z",
"createdAt": "2026-03-11T12:00:00.000Z",
"updatedAt": "2026-03-11T12:00:00.000Z"
},
"redeemToken": "eyJhbGciOiJIUzI1NiIs..."
}
CLI
bash
fgp card-sessions create <payment-method-id> [--ttl 300] [--max-redemptions 1] [--json]
MCP Tool
create_card_session(paymentMethodId, ttlSeconds?, maxRedeemCount?)

Important: The MCP tool returns session metadata and a hint, but does NOT return card details. You must use the REST API redeem endpoint with the scoped token.


3. Redeem a Card Session

Exchanges a scoped token for card details. This is the only way to get card PAN/CVV/expiry.

REST API
POST /v1/card-sessions/{id}/redeem
Header: X-Scoped-Token: <redeem-token>
Content-Type: application/json

No request body required. Authentication is via the scoped token only (not the API key).

Response (200):

json
{
"number": "4242424242424242",
"expMonth": 12,
"expYear": 2027,
"cvc": "123"
}
CLI
bash
fgp card-sessions redeem <session-id> --token <redeem-token> [--json]
Shortcut: Create + Redeem in One Step

The fgp card command creates a session and immediately redeems it:

bash
fgp card [--payment-method-id pm_abc123] [--json]

If using an agent-scoped API key, this automatically resolves the agent's payment method ID.

Error Responses
StatusCodeMeaning
401UNAUTHORIZEDMissing or invalid scoped token
403FORBIDDENToken scope doesn't match session's payment method
404NOT_FOUNDSession not found
409CONFLICTSession expired, exhausted, or invalid status

4. Check Session Status

REST API
GET /v1/card-sessions/{id}
Header: X-API-Key: <api-key>

Response: Same session object as create (without redeemToken).

CLI
bash
fgp card-sessions get <session-id> [--json]
MCP Tool
get_card_session(id)

5. Audit Redemptions

List all redemption records for a session, including IP addresses and timestamps.

REST API
GET /v1/card-sessions/{id}/redemptions
Header: X-API-Key: <api-key>

Response:

json
{
"redemptions": [
{
"id": "csr_abc",
"cardSessionId": "cs_xyz789",
"ipAddress": "203.0.113.42",
"redeemedAt": "2026-03-11T12:01:30.000Z"
}
]
}
CLI
bash
fgp card-sessions redemptions <session-id> [--json]
MCP Tool
get_card_session_redemptions(id)

6. Session Lifecycle

Sessions progress through these statuses:

active → redeemed (after maxRedeemCount reached)
active → expired (after TTL elapses)
redeemed → scrubbed (vault reference destroyed, card details permanently removed)
expired → scrubbed
  • active: Can be redeemed (redeemCount < maxRedeemCount, not past expiresAt)
  • redeemed: All redemptions used, card details still in vault temporarily
  • expired: TTL elapsed, no further redemptions possible
  • scrubbed: Card details permanently purged from vault

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
1
7-day trend score
0

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/flowglad/pay-skills/card-sessions/badge)](https://verified-skill.com/skills/flowglad/pay-skills/card-sessions)

Something wrong with this skill or its page? Tell us.