> ## Documentation Index
> Fetch the complete documentation index at: https://gnosispay-feat-v2-auth-module.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Virtual Card

> Create a virtual card for the authenticated user. Virtual cards are issued
instantly and can be used for online transactions. If the user does not yet
have a cardholder, one is created automatically using the provided phone
number (required for first card creation).



## OpenAPI

````yaml https://core.prod.gnosispay.com/user-api/openapi.json post /cards/virtual
openapi: 3.1.0
info:
  title: User Service
  version: 0.0.0
servers: []
security: []
tags:
  - name: Health
  - name: Auth
  - name: User
  - name: Cards
  - name: Phone
  - name: PCI
  - name: Terms
  - name: Source of Funds
paths:
  /cards/virtual:
    post:
      tags:
        - Cards
      summary: Create Virtual Card
      description: >-
        Create a virtual card for the authenticated user. Virtual cards are
        issued

        instantly and can be used for online transactions. If the user does not
        yet

        have a cardholder, one is created automatically using the provided phone

        number (required for first card creation).
      operationId: Cards_createVirtualCard
      parameters: []
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateVirtualCardRequest'
      responses:
        '202':
          description: Accepted - Virtual card creation accepted (pending process)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateVirtualCardSuccess'
        '400':
          description: Bad Request - User has no account
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateVirtualCardBadRequestBody'
        '401':
          description: Unauthorized - Invalid JWT
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: User not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable - Phone number required or invalid format
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Server error - Virtual card creation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '502':
          description: Bad Gateway - Cardholder creation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - BearerAuth: []
components:
  schemas:
    CreateVirtualCardRequest:
      type: object
      required:
        - cardName
      properties:
        cardName:
          type: string
          minLength: 1
          maxLength: 50
        phone:
          type: string
          minLength: 6
          maxLength: 20
    CreateVirtualCardSuccess:
      type: object
      required:
        - cardId
      properties:
        cardId:
          $ref: '#/components/schemas/uuid'
      description: Accepted - Virtual card creation accepted (pending process)
    CreateVirtualCardBadRequestBody:
      type: object
      oneOf:
        - $ref: '#/components/schemas/CreateVirtualCardValidationError'
        - $ref: '#/components/schemas/CreateVirtualCardBusinessError'
      discriminator:
        propertyName: kind
        mapping:
          validation:
            $ref: '#/components/schemas/CreateVirtualCardValidationError'
          business:
            $ref: '#/components/schemas/CreateVirtualCardBusinessError'
      description: >-
        Discriminated 400 body for POST /cards/virtual. The `kind` field is
        additive

        and not a breaking change. Clients can keep reading `success` and
        `error`.
    Error:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          type: string
    uuid:
      type: string
      format: uuid
    CreateVirtualCardValidationError:
      type: object
      required:
        - kind
        - success
        - error
      properties:
        kind:
          type: string
          enum:
            - validation
        success:
          type: boolean
          enum:
            - false
        error:
          $ref: '#/components/schemas/ValidationErrorDetail'
    CreateVirtualCardBusinessError:
      type: object
      required:
        - kind
        - success
        - error
      properties:
        kind:
          type: string
          enum:
            - business
        success:
          type: boolean
          enum:
            - false
        error:
          type: string
    ValidationErrorDetail:
      type: object
      required:
        - name
        - message
      properties:
        name:
          type: string
          enum:
            - ValidationError
        message:
          type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: Bearer

````