Skip to main content

Documentation Index

Fetch the complete documentation index at: https://usenaive.ai/docs/llms.txt

Use this file to discover all available pages before exploring further.

Virtual cards give your agents the ability to make purchases autonomously. Create a card, fund it through a checkout flow, and assign it to agents who need to spend on behalf of the company.

CLI First

# Create cardholder and card
naive cards create-cardholder --first-name John --last-name Doe --billing-line1 "123 Main St" --billing-city "SF" --billing-state CA --billing-postal-code 94105
naive cards create --name "Marketing" --spending-limit 10000

# Check funding/issuance state
naive cards check-payment <card-id>

Tools

ToolTypeDescription
cards_cardholderSetupView the company’s cardholder
cards_create_cardholderSetupCreate a Stripe Issuing cardholder
cards_update_cardholderSetupUpdate cardholder details
cards_listCoreList all virtual cards
cards_createCoreCreate a virtual card (returns checkout URL)
cards_detailsCoreGet card credentials (PAN/CVC or redeem code)
cards_check_paymentCoreCheck if funding completed and issue card
cards_retry_issueRecoveryRetry failed card issuance
cards_topupCoreTop up card spending limit (returns checkout URL)
cards_refundRecoveryRefund a failed card’s payment
cards_cancelCoreCancel/deactivate a card
cards_assignManagementAssign an agent to a card
cards_unassignManagementRemove agent assignment
cards_assignmentsManagementList agents assigned to a card
cards_log_transactionTrackingLog a manual spend transaction
cards_transactionsTrackingList card transactions

Card Providers

ProviderCard TypeLimitCardholder Required?
Stripe IssuingVirtual Visa/MastercardNo maximumYes
ReloadlyPrepaid gift card (Visa)$150.00 maxNo

Cardholder Setup (Stripe Issuing)

Before creating Stripe Issuing cards, you must create a cardholder once per company. This registers identity information with Stripe for KYC compliance.
curl -X POST https://api.usenaive.ai/v1/cards/cardholder \
  -H "Authorization: Bearer nv_sk_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "firstName": "John",
    "lastName": "Doe",
    "email": "john@acme.com",
    "billingLine1": "123 Main St",
    "billingCity": "San Francisco",
    "billingState": "CA",
    "billingPostalCode": "94105",
    "dobDay": 15,
    "dobMonth": 6,
    "dobYear": 1990
  }'
Reloadly prepaid cards do not require a cardholder. You can skip this step if you only use provider: "reloadly".

Creating a Card

Card creation follows a checkout flow — you receive a checkout_url for the card’s initial funding.
1

Create the card

curl -X POST https://api.usenaive.ai/v1/cards \
  -H "Authorization: Bearer nv_sk_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Marketing Card",
    "spending_limit_cents": 10000,
    "provider": "stripe_issuing"
  }'
Response:
{
  "card": {
    "id": "card-uuid",
    "name": "Marketing Card",
    "status": "pending_payment",
    "spendingLimitCents": 10000,
    "provider": "stripe_issuing"
  },
  "checkout_url": "https://checkout.stripe.com/c/pay/cs_live_...",
  "session_id": "cs_live_...",
  "expires_at": "2026-05-04T07:00:00.000Z",
  "hint": "Open the checkout URL to fund the card. After payment, use check-payment to issue.",
  "next_steps": [{ "command": "naive cards check-payment card-uuid", "description": "Check payment and issue card" }]
}
2

Complete payment

Open the checkout_url in a browser and complete the payment. The checkout session expires after 30 minutes.
3

Issue the card

After payment, check the status and issue the card:
curl -X POST https://api.usenaive.ai/v1/cards/card-uuid/check-payment \
  -H "Authorization: Bearer nv_sk_your_key"
If payment succeeded, the card is issued automatically and the response returns status: "active".
4

Get card credentials

Once active, retrieve the full card number and CVC:
curl https://api.usenaive.ai/v1/cards/card-uuid/details \
  -H "Authorization: Bearer nv_sk_your_key"
Response (Stripe Issuing):
{
  "card_id": "card-uuid",
  "name": "Marketing Card",
  "provider": "stripe_issuing",
  "number": "4242424242424242",
  "cvc": "123",
  "exp_month": 12,
  "exp_year": 2028,
  "last4": "4242",
  "brand": "Visa",
  "spending_limit_cents": 10000,
  "spent_cents": 0,
  "remaining_cents": 10000
}

Top-Up

Add more funds to an active card’s spending limit:
curl -X POST https://api.usenaive.ai/v1/cards/card-uuid/top-up \
  -H "Authorization: Bearer nv_sk_your_key" \
  -H "Content-Type: application/json" \
  -d '{ "amount_cents": 5000 }'
Returns a checkout_url for the top-up payment, just like card creation.

Agent Assignments

Cards can be assigned to specific agents, controlling which agents have access to spend:
# Assign an agent
curl -X POST https://api.usenaive.ai/v1/cards/card-uuid/assign \
  -H "Authorization: Bearer nv_sk_your_key" \
  -H "Content-Type: application/json" \
  -d '{ "agent_id": "agent-uuid" }'

# List assignments
curl https://api.usenaive.ai/v1/cards/card-uuid/assignments \
  -H "Authorization: Bearer nv_sk_your_key"

# Remove assignment
curl -X DELETE https://api.usenaive.ai/v1/cards/card-uuid/assign/agent-uuid \
  -H "Authorization: Bearer nv_sk_your_key"

Transaction Logging

Track agent spending by logging manual transactions:
curl -X POST https://api.usenaive.ai/v1/cards/card-uuid/log-transaction \
  -H "Authorization: Bearer nv_sk_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "amount_cents": 2500,
    "merchant_name": "AWS",
    "description": "Cloud hosting payment",
    "agent_id": "agent-uuid"
  }'
Stripe Issuing cards also capture transactions automatically via Stripe webhooks. Manual logging is for non-Stripe purchases (e.g., Reloadly cards or offline transactions).

Card Statuses

StatusMeaning
pending_paymentCheckout created, waiting for payment
activeCard is issued and ready to use
issuing_failedPayment succeeded but card issuance failed (can retry)
payment_failedCheckout expired or payment failed
refundedPayment was refunded
canceledCard was deactivated

Error Handling

ErrorCauseRecovery
duplicate_recordCardholder already exists for this companyUse GET to view or PATCH to update
invalid_input (no cardholder)Tried to create Stripe Issuing card without a cardholderCreate a cardholder first
invalid_input (limit too low)Spending limit below $1.00 (100 cents)Increase the spending limit
invalid_input (Reloadly max)Reloadly prepaid card exceeds $150 limitUse Stripe Issuing for higher limits
resource_not_foundCard ID doesn’t exist or belongs to another companyUse GET /v1/cards for valid IDs
provider_errorStripe or Reloadly API error during issuanceUse retry-issue or refund

Typical Workflows (Agent Perspective)

Creating and using a Stripe Issuing card

1. GET /v1/cards/cardholder
   → cardholder: null — need to create one

2. POST /v1/cards/cardholder { firstName, lastName, billing..., dob... }
   → cardholder created

3. POST /v1/cards { name: "Agent Card", spending_limit_cents: 10000 }
   → checkout_url: "https://checkout.stripe.com/..."
   → Share with user: "Fund the card at this URL"

4. [User completes checkout]

5. POST /v1/cards/<id>/check-payment
   → status: "active", last4: "4242"

6. GET /v1/cards/<id>/details
   → number, cvc, expMonth, expYear — ready to use

7. POST /v1/cards/<id>/log-transaction { amount_cents: 2500, merchant_name: "AWS" }
   → Transaction logged

Creating a Reloadly prepaid card

1. POST /v1/cards { name: "Prepaid Card", spending_limit_cents: 5000, provider: "reloadly" }
   → checkout_url — fund via Stripe Checkout

2. [User completes checkout]

3. POST /v1/cards/<id>/check-payment
   → status: "active" — Reloadly gift card issued

4. GET /v1/cards/<id>/details
   → number (redeem code), pin, redeem_instructions