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

# Create a Card

> Creates a card for a customer from a card product (see `GET /cards/products`).

Your ops balance (`cards_visa` or `cards_mastercard`, depending on the product brand) is debited of the
initial load plus the product fees: `card_fee` and the service fee on the load. The KYC tariff applies when
the customer's KYC is approved.

The card is returned with `status: pending` and issued asynchronously. You are notified by webhook:
`card.activated` when the card is ready, or `card.creation_failed` if it could not be issued — in that case
the full amount is refunded to the same `cards_visa` or `cards_mastercard` balance.

The call is refused when the customer is not `active`, when its verification level is below the product's
`required_level`, when it already holds the maximum number of cards for this product, or when the amount is
outside the product's initial load range.




## OpenAPI

````yaml POST /cards
openapi: 3.1.0
info:
  title: KemyCard API
  version: '1.0'
  description: >
    KemyCard API allows you to issue virtual and physical cards, manage KYC/POA
    verification,

    create crypto wallets, virtual bank accounts, and purchase gift cards.
  contact:
    name: KemyCard API Support
    email: hi@kemycard.com
servers:
  - url: https://api.kemycard.com/v1
    description: Production
security:
  - BearerAuth: []
tags:
  - name: Customers
    description: Manage your customers
  - name: Card Products
    description: Browse the card product catalog
  - name: Cards
    description: Issue and manage cards
  - name: KYC
    description: Identity verification
  - name: POA
    description: Proof of address verification
  - name: Wallets
    description: Crypto wallets
  - name: Virtual Accounts
    description: Virtual bank accounts
  - name: Gift Cards
    description: Gift card catalog and purchases
  - name: Balance
    description: Operational balances and transaction history
  - name: Webhooks
    description: Webhook endpoints and delivery management
paths:
  /cards:
    post:
      tags:
        - Cards
      summary: Create a card
      description: >
        Creates a card for a customer from a card product (see `GET
        /cards/products`).


        Your ops balance (`cards_visa` or `cards_mastercard`, depending on the
        product brand) is debited of the

        initial load plus the product fees: `card_fee` and the service fee on
        the load. The KYC tariff applies when

        the customer's KYC is approved.


        The card is returned with `status: pending` and issued asynchronously.
        You are notified by webhook:

        `card.activated` when the card is ready, or `card.creation_failed` if it
        could not be issued — in that case

        the full amount is refunded to the same `cards_visa` or
        `cards_mastercard` balance.


        The call is refused when the customer is not `active`, when its
        verification level is below the product's

        `required_level`, when it already holds the maximum number of cards for
        this product, or when the amount is

        outside the product's initial load range.
      operationId: createCard
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCardRequest'
      responses:
        '201':
          description: Card creation initiated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardSuccessResponse'
        '400':
          $ref: '#/components/responses/InsufficientBalance'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/ValidationError'
components:
  schemas:
    CreateCardRequest:
      type: object
      required:
        - customer_code
        - product_code
        - name_on_card
      properties:
        customer_code:
          type: string
          format: uuid
          example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
        product_code:
          type: string
          format: uuid
          description: Code of the card product, from `GET /cards/products`
          example: 019abc12-3456-7890-abcd-ef0123456789
        name_on_card:
          type: string
          minLength: 3
          maxLength: 20
          description: Label of the card, 3 to 20 characters
          example: John Doe
        amount:
          type: number
          description: >
            Initial load in USD. Required when the product has
            `initial_load.required: true`, within

            `initial_load.min` and `initial_load.max`. Ignored otherwise.
          example: 100
    CardSuccessResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        data:
          $ref: '#/components/schemas/Card'
        meta:
          $ref: '#/components/schemas/Meta'
    Card:
      type: object
      properties:
        code:
          type: string
          format: uuid
        customer_code:
          type: string
          format: uuid
        product_code:
          type: string
          format: uuid
        brand:
          type: string
          enum:
            - MASTERCARD
            - VISA
        category:
          type: string
        name_on_card:
          type: string
          example: John Doe
        status:
          type: string
          enum:
            - pending
            - active
            - frozen
            - cancelled
            - failed
          description: >
            `pending` — being issued. `active` — usable. `frozen` — payments
            declined until unfrozen.

            `cancelled` — terminated, the remaining balance was returned to your
            ops balance.

            `failed` — could not be issued, the amount was refunded.
        balance:
          type: number
        currency:
          type: string
        last_four:
          type: string
          nullable: true
          description: Null until the card is issued
        expiry:
          type: string
          nullable: true
          description: Expiry date, MM/YY. Null until the card is issued
          example: 12/29
        fees:
          type: object
          description: >-
            What was debited from your `cards_visa` or `cards_mastercard`
            balance when the card was created
          properties:
            card_fee:
              type: number
              example: 30
            service_fee:
              type: number
              example: 5
            total_charged:
              type: number
              description: Initial load + card fee + service fee
              example: 135
        created_at:
          type: string
          format: date-time
    Meta:
      type: object
      properties:
        request_id:
          type: string
          example: a4f8e2c1b3d97056
        mode:
          type: string
          enum:
            - test
            - live
          example: test
        timestamp:
          type: string
          format: date-time
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          properties:
            code:
              type: string
              example: VALIDATION_ERROR
            message:
              type: string
              example: Missing required fields.
            details:
              type: object
              nullable: true
        meta:
          $ref: '#/components/schemas/Meta'
  responses:
    InsufficientBalance:
      description: Insufficient ops balance
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error:
              code: INSUFFICIENT_BALANCE
              message: Insufficient ops balance.
              details:
                required: 50
                available: 10
                balance_type: cards_mastercard
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error:
              code: RESOURCE_NOT_FOUND
              message: Resource not found.
              details: null
    ValidationError:
      description: Validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API key (sk_test_... or sk_live_...)

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.