# Create card

> Create a prepaid virtual card for a specified cardholder and card product.

```yaml
openapi: 3.1.0
info:
  title: Create card
  version: 1.0.0
  description: Create a prepaid virtual card for a specified cardholder and card product.
paths:
  /api/v1/merchant/card/createCard:
    post:
      summary: Create card
      description: Create a prepaid virtual card for a specified cardholder and card
        product.
      parameters:
        - name: ApiKey
          in: header
          required: true
          description: Issuing API key request header assigned by Onerway.
          schema:
            type: string
            description: Issuing API key request header assigned by Onerway.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                clientRequestId:
                  type: string
                  description: Idempotent request ID for card creation.
                cardholderId:
                  type: integer
                  description: Cardholder ID to associate with the card.
                productId:
                  type: integer
                  description: Card product ID confirmed with Onerway.
                amount:
                  type: number
                  description: Initial deposit amount for the card.
                  x-onerway-constraints:
                    - kind: rule
                      text: Must be greater than 0 and support up to 2 decimal places.
              required:
                - clientRequestId
                - cardholderId
                - productId
                - amount
            examples:
              default:
                summary: Create card
                value:
                  amount: 100
                  cardholderId: 300001
                  clientRequestId: REQ_20260101_001
                  productId: 1
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  respCode:
                    type: string
                    description: Business response code. `20000` means success.
                  respMsg:
                    type: string
                    description: Response message.
                  data:
                    type:
                      - object
                      - "null"
                    properties:
                      cardId:
                        type: integer
                        description: Newly created card ID.
                    description: Created card information.
                    x-onerway-value:
                      nullable: true
                      when:
                        en: Returned as `null` when card creation fails.
                        zh: 开卡失败时返回 `null`。
              examples:
                success:
                  summary: Success
                  value:
                    respCode: "20000"
                    respMsg: success
                    data:
                      cardId: 100001
```
