Agent Operations

Issue an agent card

Changed on

Issue a virtual card for the authenticated agent. The card belongs to the agent's customer, who must have KYC status APPROVED and have accepted the cardholder agreement where the platform requires one. Its spend counts against the agent's policy limits as the agent's sends do, and Grid's default agent merchant-category blocks apply. Requires the ISSUE_CARDS permission; reading the card afterwards needs MANAGE_CARDS.

Standard card (kind omitted or STANDARD): as POST /cards with agentId does for the platform. While any of the agent's standard cards is not CLOSED, including one the platform issued for it, the request is rejected with AGENT_CARD_EXISTS. New cards start in status: "PROCESSING" and follow the same status transitions and card.status_change webhooks as cards issued with POST /cards.

Purchase card (kind: PURCHASE): a single-use card for one online purchase of amount, paid from the customer's Embedded Wallet with the agent's delegated key. Available only where the platform enables agent purchase cards. Its limit (purchase.spendLimit) is amount plus an allowance for tax and shipping, and that limit is evaluated against the agent's policy as a send of the same amount would be:

  • Under the policy's approval threshold, and with defaultExecutionMode AUTO, the card is issued at once and returned with 201.

  • Otherwise the request becomes an ISSUE_PURCHASE_CARD agent action in PENDING_APPROVAL, returned with 202, and the AGENT_ACTION.PENDING_APPROVAL webhook fires. The card is issued when the action is approved with POST /agents/{agentId}/actions/{actionId}/approve; the action then carries cardId. Poll GET /agents/me/actions/{actionId} for the outcome.

  • A request the policy denies outright (over a spending limit, or a funding account the policy does not allow) is rejected with 403.

The card is closed by its first approved authorization, and Grid closes it if it is still unused at purchase.expiresAt. Purchase cards are not counted by the one-standard-card rule, but an agent may hold only a limited number of open purchase cards, counting those awaiting approval; beyond that the request is rejected with PURCHASE_CARD_LIMIT_REACHED.

Recurring purchase card (kind: PURCHASE, recurring: true): for a subscription, a card saved with a merchant, a hotel or car rental, or an order that ships in parts. Available only where the platform enables recurring purchase cards. The card locks to the first merchant that charges it and declines every other merchant; that merchant may charge it again, up to amount in any trailing month (from a charge back to the same date a month earlier), with no allowance added. It always becomes an ISSUE_PURCHASE_CARD action awaiting the customer's approval and is returned with 202, whatever the policy's approval threshold or execution mode, though a request the policy denies is still rejected with 403. Its charges count against the agent's policy limits as they are authorized. It has no purchase.expiresAt and stays open until the customer or platform closes it (PATCH /cards/{id} with status: CLOSED, a substatus and a reason). Pausing the agent does not close it, but its charges are declined while the agent is paused; deleting the agent freezes it, and POST /agents/{agentId}/card-handover with kind=PURCHASE can move it to the customer's next agent. Recurring cards have their own, smaller limit on open cards, counting those awaiting approval, and do not use up the room for single-use cards. Card details are never returned here; request them with POST /agents/me/cards/{cardId}/reveal.

Card issuance cannot be reversed, so an Idempotency-Key header is required. Keys are scoped to the agent: a retry by the same agent with the same key returns what the first request created, whatever has changed since, and another agent's key never matches. For a purchase card, a retry returns the issued card with 201, or the action with 202 while it is pending, rejected or failed.

post/agents/me/cards

Request

  • Base URL
    https://api.lightspark.com/grid/2025-10-13
  • URL
    https://api.lightspark.com/grid/2025-10-13/agents/me/cards
  • Auth
    HTTP bearer

Headers

Idempotency-Keystring required
Example:550e8400-e29b-41d4-a716-446655440000

A unique identifier for the request, up to 255 characters, scoped to the agent. A retry carrying the same key returns the card created by the first request; reusing a key for a different card request is rejected with 409.

Request body

fundingSourcestring required

Internal account id that funds the card. The account must belong to the agent's customer and be denominated in a card-eligible currency; otherwise the request is rejected with INVALID_INPUT. A PURCHASE card must be funded from an Embedded Wallet on which the agent holds an active delegated key.

kind'STANDARD' | 'PURCHASE'

How an agent card is used and funded.

KindDescription
STANDARDA card issued for the agent, by the platform with POST /cards or by the agent with POST /agents/me/cards. The customer holds the card details and its spend comes from the customer's account; that spend counts against the agent's policy limits as the agent's sends do. The agent can read the card, tighten its merchant categories, and freeze it.
PURCHASEA single-use virtual card the agent issued for one online purchase with POST /agents/me/cards. It is funded from the customer's Embedded Wallet, its spend counts against the agent's policy limits, and it closes after its first approved authorization or when it expires unused. A recurring purchase card (purchase.recurring) is instead locked to the first merchant that charges it, may be charged there again up to its monthly limit, and stays open until it is closed. The agent reads its number, expiry and CVV through POST /agents/me/cards/{cardId}/reveal.
amountinteger

The purchase amount in the smallest unit of USD. Required for kind: PURCHASE and rejected otherwise. Grid adds an allowance for tax and shipping to set the card's limit; see AgentPurchaseCardDetails. For a recurring card it is the monthly limit itself, with no allowance added, so include tax and shipping in it. Each platform sets the largest amount an agent may ask for, separately for single-use and recurring cards; a larger one is rejected with INVALID_INPUT.

descriptionstring

What the card is for, such as the merchant and item, shown to the customer when they approve it. Allowed only with kind: PURCHASE.

recurringboolean

Request a recurring purchase card: one that locks to the first merchant that charges it and may be charged there again, up to amount in any trailing month (from a charge back to the same date a month earlier), until it is closed. Use it for a subscription, a card saved with a merchant, a hotel or car rental, or an order that ships in parts. It always needs the customer's approval, whatever the agent's policy says, and is available only where the platform enables recurring purchase cards. true is allowed only with kind: PURCHASE; false is accepted with any kind.

Example request

{
  "fundingSource": "InternalAccount:019542f5-b3e7-1d02-0000-000000000002",
  "amount": 4999,
  "description": "Running shoes from example-store.com"
}

Response

Card created. A standard card starts in PROCESSING while the issuer provisions it. A purchase card is returned with purchase set.

agentIdstring required

The agent the card belongs to.

agentCardKind'STANDARD' | 'PURCHASE' required

How an agent card is used and funded.

KindDescription
STANDARDA card issued for the agent, by the platform with POST /cards or by the agent with POST /agents/me/cards. The customer holds the card details and its spend comes from the customer's account; that spend counts against the agent's policy limits as the agent's sends do. The agent can read the card, tighten its merchant categories, and freeze it.
PURCHASEA single-use virtual card the agent issued for one online purchase with POST /agents/me/cards. It is funded from the customer's Embedded Wallet, its spend counts against the agent's policy limits, and it closes after its first approved authorization or when it expires unused. A recurring purchase card (purchase.recurring) is instead locked to the first merchant that charges it, may be charged there again up to its monthly limit, and stays open until it is closed. The agent reads its number, expiry and CVV through POST /agents/me/cards/{cardId}/reveal.
effectiveBlockedMccsstring[] required

Every merchant category code the card declines: blockedMccs plus the categories Grid blocks for agent cards, unless the platform lifted those defaults (defaultMccBlocksLifted).

Example response

{
  "card": {
    "id": "Card:019542f5-b3e7-1d02-0000-000000000010",
    "customerId": "Customer:019542f5-b3e7-1d02-0000-000000000001",
    "platformCardId": "card-emp-001",
    "pinStatus": "OK",
    "pinUnblockAvailableAt": "2026-10-15T15:00:00Z",
    "last4": "4242",
    "expMonth": 12,
    "expYear": 2029,
    "fundingSource": "InternalAccount:019542f5-b3e7-1d02-0000-000000000002",
    "cardCapabilities": {
      "supportsVelocityLimits": true,
      "supportsPanReveal": true,
      "supportsDigitalWalletTokenization": true
    },
    "maxNetworkRiskScore": 700,
    "allowedMccs": [
      "5411"
    ],
    "blockedMccs": [
      "7995"
    ],
    "agentId": "Agent:019542f5-b3e7-1d02-0000-000000000042",
    "currency": "USD",
    "processorRef": "card_b81c2a4f",
    "issuerRef": "lead_card_7a1b9c3d",
    "createdAt": "2026-05-08T14:10:00Z",
    "updatedAt": "2026-05-08T14:11:00Z"
  },
  "agentId": "Agent:019542f5-b3e7-1d02-0000-000000000042",
  "effectiveBlockedMccs": [
    "7995",
    "6051"
  ],
  "purchase": {
    "amount": 4999,
    "spendLimit": 5749,
    "currency": "USD",
    "description": "Running shoes from example-store.com",
    "fundingSource": "InternalAccount:019542f5-b3e7-1d02-0000-000000000002",
    "expiresAt": "2026-10-26T15:30:00Z"
  }
}

Changes

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the new optional request property

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status