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

# Simulate Card Transaction

> Sandbox-only simulated spend or credit on a virtual card

Sandbox only. Triggers a simulated card spend or credit; balance and transaction history update when PayVessel processes the event.


## OpenAPI

````yaml api-reference/openapi.json POST /pms/api/external/request/virtual-cards/{card_id}/mock-transaction/
openapi: 3.1.0
info:
  title: PayVessel API
  description: >-
    PayVessel API for accepting payments, sending money, verifying identities,
    and managing wallets
  version: 1.0.0
servers:
  - url: https://api.payvessel.com
  - url: https://sandbox.payvessel.com
security:
  - {}
paths:
  /pms/api/external/request/virtual-cards/{card_id}/mock-transaction/:
    post:
      tags:
        - Issuing
      summary: Simulate Card Transaction
      description: >-
        Sandbox only. Triggers a simulated card spend (DEBIT) or credit
        (CREDIT). Transaction history and balance update when PayVessel
        processes the event. Not available in production.
      operationId: externalVirtualCardsMockTransaction
      parameters:
        - name: api-key
          in: header
          description: Your Payvessel public API key
          required: true
          schema:
            type: string
        - name: api-secret
          in: header
          description: Your Payvessel secret
          required: true
          schema:
            type: string
        - name: Content-Type
          in: header
          description: Request content type
          required: true
          schema:
            type: string
            enum:
              - application/json
          example: application/json
        - name: card_id
          in: path
          description: PayVessel card ID
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MockCardTransactionRequest'
            examples:
              debit:
                summary: Simulate spend
                value:
                  amount: '1.50'
                  type: DEBIT
      responses:
        '200':
          description: Simulation accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MockCardTransactionResponse'
              examples:
                success:
                  summary: Simulation sent
                  value:
                    status: true
                    message: Simulated transaction sent.
                    data:
                      card_id: 7f219a25-d968-4894-9a8b-ba83fa0bf6ec
                      amount: '1.50'
                      currency: USD
                      type: DEBIT
                      card_balance: '8.50'
                      message: Simulated transaction sent.
        '400':
          description: Validation error (e.g. not sandbox, card not active)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                unauthorized:
                  summary: Invalid credentials
                  value:
                    error: 401
                    message: Unauthorized. Please check your API key.
        '403':
          description: Forbidden request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    MockCardTransactionRequest:
      type: object
      required:
        - amount
      properties:
        amount:
          type: string
          description: Transaction amount in USD (e.g. 1.50)
          example: '1.50'
        type:
          type: string
          enum:
            - DEBIT
            - CREDIT
          default: DEBIT
          description: DEBIT simulates a card spend; CREDIT simulates a refund or credit
    MockCardTransactionResponse:
      type: object
      properties:
        status:
          type: boolean
          description: Indicates whether the request succeeded
        message:
          type: string
          description: Human-readable result message
        data:
          type: object
          description: Simulation result
          properties:
            card_id:
              type: string
              format: uuid
              description: PayVessel card ID
            amount:
              type: string
              description: Amount sent to the simulator
            currency:
              type: string
              description: USD
            type:
              type: string
              description: DEBIT or CREDIT
            card_balance:
              type: string
              description: Card balance after simulation (may update again via webhook)
            message:
              type: string
              description: Simulation result message
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string

````