# 创建卡片

> 为指定持卡人和卡产品创建预付虚拟卡。

```yaml
openapi: 3.1.0
info:
  title: 创建卡片
  version: 1.0.0
  description: 为指定持卡人和卡产品创建预付虚拟卡。
paths:
  /api/v1/merchant/card/createCard:
    post:
      summary: 创建卡片
      description: 为指定持卡人和卡产品创建预付虚拟卡。
      parameters:
        - name: ApiKey
          in: header
          required: true
          description: Onerway 分配的发卡 API key 请求 Header。
          schema:
            type: string
            description: Onerway 分配的发卡 API key 请求 Header。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                clientRequestId:
                  type: string
                  description: 开卡幂等请求 ID。
                cardholderId:
                  type: integer
                  description: 与卡片关联的持卡人 ID。
                productId:
                  type: integer
                  description: 与 Onerway 确认的卡产品 ID。
                amount:
                  type: number
                  description: 卡片初始充值金额。
                  x-onerway-constraints:
                    - kind: rule
                      text: 必须大于 0，最多支持 2 位小数。
              required:
                - clientRequestId
                - cardholderId
                - productId
                - amount
            examples:
              default:
                summary: 创建卡片
                value:
                  amount: 100
                  cardholderId: 300001
                  clientRequestId: REQ_20260101_001
                  productId: 1
      responses:
        "200":
          description: 成功
          content:
            application/json:
              schema:
                type: object
                properties:
                  respCode:
                    type: string
                    description: 业务响应码；`20000` 表示成功。
                  respMsg:
                    type: string
                    description: 响应信息。
                  data:
                    type:
                      - object
                      - "null"
                    properties:
                      cardId:
                        type: integer
                        description: 新创建的卡片 ID。
                    description: 创建后的卡片信息。
                    x-onerway-value:
                      nullable: true
                      when:
                        en: Returned as `null` when card creation fails.
                        zh: 开卡失败时返回 `null`。
              examples:
                success:
                  summary: 成功
                  value:
                    respCode: "20000"
                    respMsg: success
                    data:
                      cardId: 100001
```
