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

# Create Card

> Create a new virtual card for a specific user



## OpenAPI

````yaml POST /virtual-cards/action/card/{userId}
openapi: 3.1.0
info:
  title: GetMiPay API
  description: >-
    GetMiPay - Your universal gateway to getmipay. API for processing payments,
    payouts, and virtual cards through GetMiPay gateway.
  contact:
    name: GetMiPay Support
    email: support@getmipay.com
  license:
    name: Proprietary
    url: https://getmipay.com/
  version: 1.1.0
servers:
  - url: https://sandbox.getmipay.com/api
    description: Sandbox server
security:
  - bearerAuth: []
tags:
  - name: Authentication
    description: API authentication and token management
  - name: Services
    description: Get available payment services
  - name: Currency
    description: API for converting amounts between different currencies.
  - name: Payments
    description: Collect payments from customers
  - name: Payouts
    description: Send money to customers
  - name: Transactions
    description: Check transaction status
  - name: Balance
    description: Account balance management
  - name: Virtual Cards
    description: Virtual card creation and management
  - name: Webhooks
    description: Webhook endpoints for payment notifications
paths:
  /virtual-cards/action/card/{userId}:
    post:
      tags:
        - Virtual Cards
      summary: Create Virtual Card
      description: Create a new virtual card for a specific user
      parameters:
        - name: userId
          in: path
          description: User ID for whom to create the card
          required: true
          schema:
            type: string
            example: SP6VC
      requestBody:
        description: Virtual card creation details
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VirtualCardRequest'
        required: true
      responses:
        '200':
          description: Virtual card created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VirtualCardResponse'
        '400':
          description: Bad request - invalid card data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized - Missing, invalid, or expired bearer token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    VirtualCardRequest:
      type: object
      required:
        - balance
        - currency
        - card_type
        - category
        - grade
      properties:
        balance:
          type: number
          minimum: 0.01
          example: 10
        currency:
          type: string
          enum:
            - USD
            - EUR
            - XAF
          example: USD
        card_type:
          type: string
          enum:
            - VISA
            - MASTERCARD
          example: VISA
        category:
          type: string
          enum:
            - PERSONAL
            - BUSINESS
          example: PERSONAL
        grade:
          type: string
          enum:
            - BASIC
            - PREMIUM
          example: BASIC
    VirtualCardResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        data:
          type: object
          properties:
            card_id:
              type: string
              example: CARD_123456
            user_id:
              type: string
              example: SP6VC
            card_number:
              type: string
              example: '4111111111111111'
            expiry_date:
              type: string
              example: 12/2026
            cvv:
              type: string
              example: '123'
            balance:
              type: number
              example: 10
            currency:
              type: string
              example: USD
            card_type:
              type: string
              example: VISA
            status:
              type: string
              example: active
            created_at:
              type: string
              format: date-time
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
          example: Invalid KEY
        error_code:
          type: string
          example: INVALID_PUBLIC_KEY
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT bearer token returned by POST /action/auth. Send protected requests
        with: Authorization: Bearer <jwt>. Tokens expire after 24 hours.

````