> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mag3nt.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Issue a new virtual payment card

> Creates a card backed by your treasury balance. Provide `tx_hash` for UI pay-and-issue flow (card starts as PENDING_FUNDING). Omit `tx_hash` to allocate from pre-funded balance.




## OpenAPI

````yaml /openapi.yaml post /api/issue
openapi: 3.1.0
info:
  title: mag3nt API
  version: '2026-06-04'
  description: >
    Payment infrastructure for AI agents. Issue virtual cards, pay for API
    access via x402/AP2/MPP protocols, and settle in USDC on Base.
  contact:
    name: mag3nt
    url: https://mag3nt.com
  license:
    name: Proprietary
    url: https://github.com/mag3nt-com/mag3nt-node/blob/main/LICENSE
servers:
  - url: https://mag3nt.com
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Payments
    description: Universal outbound protocol payments
  - name: Cards
    description: Virtual payment card lifecycle
  - name: Keys
    description: Developer API key management
  - name: Funding
    description: Treasury deposits and balances
  - name: x402
    description: HTTP 402 payment protocol
  - name: AP2
    description: Agent-to-Agent Payment Protocol
  - name: MPP
    description: Micropayment Protocol with streaming
  - name: Pay Links
    description: Shareable payment URLs
  - name: Withdrawals
    description: Withdraw unspent funds back to wallet
  - name: Settlement
    description: On-chain settlement status
  - name: Webhooks
    description: Signed payment.settled notifications for sellers
  - name: Status
    description: System health and configuration
externalDocs:
  description: mag3nt documentation
  url: https://docs.mag3nt.com
paths:
  /api/issue:
    post:
      tags:
        - Cards
      summary: Issue a new virtual payment card
      description: >
        Creates a card backed by your treasury balance. Provide `tx_hash` for UI
        pay-and-issue flow (card starts as PENDING_FUNDING). Omit `tx_hash` to
        allocate from pre-funded balance.
      operationId: cardsCreate
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - purpose
                - limit_amount
              properties:
                purpose:
                  type: string
                  description: Human-readable label for the card
                  example: Research Agent
                limit_amount:
                  type:
                    - number
                    - string
                  description: Maximum spend in USDC
                  example: 50
                network:
                  type: string
                  default: eip155:8453
                asset:
                  type: string
                  default: USDC
                tx_hash:
                  type: string
                  description: On-chain funding transaction hash (optional)
                mcc_locks:
                  type: string
                  description: Comma-separated merchant category codes
                single_use:
                  type: boolean
                  default: false
                expires_in:
                  type: number
                  description: Hours until expiry (0 = never)
            example:
              purpose: Research Agent
              limit_amount: 50
              network: eip155:8453
      responses:
        '200':
          description: Card created
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  card:
                    $ref: '#/components/schemas/Card'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Insufficient balance
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BalanceError'
components:
  schemas:
    Card:
      type: object
      properties:
        id:
          type: string
          example: sx_a66a6666-1234-5678-9abc-def012345678
        token:
          type: string
          example: tok_3b9fe670-abcd-efgh-ijkl-mnopqrstuvwx
        purpose:
          type: string
          example: Research Agent
        limit_amount:
          type:
            - number
            - string
          example: 50
        status:
          type: string
          enum:
            - ACTIVE
            - FROZEN
            - EXPIRED
            - USED
            - CLOSED
            - PENDING_FUNDING
            - FUNDING_FAILED
          example: ACTIVE
        mcc_locks:
          type: string
          example: ''
        single_use:
          type: integer
          enum:
            - 0
            - 1
          example: 0
        expires_at:
          type:
            - string
            - 'null'
          format: date-time
        funding_network:
          type: string
          example: eip155:8453
        funding_asset:
          type: string
          example: USDC
        wallet_address:
          type: string
          example: 0x1234...abcd
        balance:
          type:
            - number
            - string
          example: 0
        remaining:
          type:
            - number
            - string
          example: 50
        created_at:
          type: string
          format: date-time
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          example: Card not found
    BalanceError:
      type: object
      required:
        - error
        - available
        - requested
      properties:
        error:
          type: string
          example: Insufficient balance
        available:
          type:
            - number
            - string
          example: 40
        requested:
          type:
            - number
            - string
          example: 50
        network:
          type: string
          example: eip155:8453
        asset:
          type: string
          example: USDC
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: API key prefixed with 'Bearer sx_live_...'

````