---
updatedAt: 2026-04-21T06:46:03.000Z
agentTools:
  projectIndex: https://developer.qbitnetwork.com/llms.txt
---

# 创建预算卡

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "量子卡",
    "description": "接口开发者文档",
    "version": "v3"
  },
  "externalDocs": {
    "description": "接口开发者",
    "url": "https://developer.qbitnetwork.com/"
  },
  "servers": [
    {
      "url": "https://api-sandbox.qbitnetwork.com",
      "description": "沙箱环境"
    }
  ],
  "paths": {
    "/open-api/v3/budget-card": {
      "post": {
        "tags": [
          "卡"
        ],
        "summary": "创建预算卡",
        "operationId": "createBudgetCard",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "幂等键（UUID），用于保证变更类请求精准一次执行。",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBudgetCardReqDTO"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CardResponse"
                },
                "example": {
                  "code": "000000",
                  "message": "success",
                  "data": {
                    "id": "d8eda079-6ba7-409e-99c8-ab5f83566fbd",
                    "accountId": "78ad30f2-5794-47c7-b413-62cc599ab203",
                    "userName": "John Doe",
                    "currency": "USD",
                    "bin": "411111",
                    "status": "ACTIVE",
                    "cardLastFour": "4567",
                    "label": "Personal Visa",
                    "balanceId": "0d13f168-339b-4b74-a412-07a6ababcd9c",
                    "budgetId": "c0598084-16d9-4426-b98e-382166afb0eb",
                    "cardholderId": "1963922322985988097",
                    "createTime": "1710813276127",
                    "referenceId": "78ad30f2-5794-47r6-b413-62gh699ab203",
                    "billingAddress": {
                      "addressLine1": "123 Main Street",
                      "addressLine2": "Apt 4B",
                      "city": "New York",
                      "state": "NY",
                      "country": "US",
                      "postalCode": "10001"
                    },
                    "transactionLimits": [
                      {
                        "type": "LIFETIME",
                        "value": "5000.00",
                        "currency": "USD"
                      }
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResult"
                },
                "example": {
                  "code": "40001",
                  "message": "Invalid parameter"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "AddressResource": {
        "type": "object",
        "properties": {
          "addressLine1": {
            "type": "string",
            "description": "地址第一行"
          },
          "addressLine2": {
            "type": "string",
            "description": "地址第二行"
          },
          "city": {
            "type": "string",
            "description": "城市"
          },
          "country": {
            "type": "string",
            "description": "国家"
          },
          "postalCode": {
            "type": "string",
            "description": "邮政编码"
          },
          "state": {
            "type": "string",
            "description": "州/省份"
          }
        },
        "description": "账单地址"
      },
      "CardResource": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "卡片的唯一标识"
          },
          "accountId": {
            "type": "string",
            "description": "账户ID"
          },
          "status": {
            "type": "string",
            "description": "卡片状态。可选值：INACTIVE,CONTROL,ACTIVE,PENDING,FROZEN"
          },
          "currency": {
            "type": "string",
            "description": "货币代码"
          },
          "bin": {
            "type": "string",
            "description": "银行识别号（BIN）"
          },
          "userName": {
            "type": "string",
            "description": "用户名"
          },
          "createTime": {
            "type": "string",
            "description": "卡片创建时间"
          },
          "cardLastFour": {
            "type": "string",
            "description": "卡号后四位"
          },
          "billingAddress": {
            "$ref": "#/components/schemas/AddressResource"
          },
          "label": {
            "type": "string",
            "description": "卡片标签"
          },
          "balanceId": {
            "type": "string",
            "description": "余额ID"
          },
          "budgetId": {
            "type": "string",
            "description": "预算ID（仅预算卡适用）"
          },
          "cardholderId": {
            "type": "string",
            "description": "持卡人ID"
          },
          "referenceId": {
            "type": "string",
            "description": "您为每张卡片分配的唯一标识。该值在每次卡片请求中必须唯一，后续可用于查询或追踪对应卡片。"
          },
          "cardReferenceId": {
            "type": "string",
            "description": "物理卡片的唯一标识"
          },
          "cardMode": {
            "type": "string",
            "description": "卡片模式。例如：VIRTUAL_CARD",
            "enum": [
              "PHYSICAL_CARD",
              "VIRTUAL_CARD"
            ]
          },
          "transactionLimits": {
            "type": "array",
            "description": "限制信息",
            "items": {
              "$ref": "#/components/schemas/TransactionLimitsResource"
            }
          },
          "cardStatusChangeRecordList": {
            "type": "array",
            "description": "卡片状态变更记录列表",
            "items": {
              "$ref": "#/components/schemas/CardStatusChangeRecordResource"
            }
          }
        },
        "description": "返回数据"
      },
      "CardResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "返回码"
          },
          "message": {
            "type": "string",
            "description": "错误信息"
          },
          "data": {
            "$ref": "#/components/schemas/CardResource"
          }
        },
        "description": "卡资源"
      },
      "CardStatusChangeRecordResource": {
        "type": "object",
        "properties": {
          "userId": {
            "type": "string",
            "description": "用户 ID"
          },
          "accountId": {
            "type": "string",
            "description": "账户 ID"
          },
          "cardId": {
            "type": "string",
            "description": "卡片 ID"
          },
          "operationTime": {
            "type": "string",
            "description": "操作时间（毫秒时间戳）"
          },
          "beforeStatus": {
            "type": "string",
            "description": "变更前状态"
          },
          "afterStatus": {
            "type": "string",
            "description": "变更后状态"
          },
          "reasonCode": {
            "type": "string",
            "description": "原因码：7001-通过商户后台创建，7002-通过 API 创建，1001-通过 Open API 关闭，1002-通过商户后台关闭，1003-因风控策略违规关闭，1004-由管理员关闭，1005-因 BIN 停用关闭，1006-因账户注销关闭，1007-卡片到期后自动删除，2001-通过 Open API 激活，2002-通过商户后台激活，3001-通过 Open API 暂停，3002-通过商户后台暂停，5001-由管理员限制，6001-由管理员解除限制"
          },
          "reasonMessage": {
            "type": "string",
            "description": "原因描述"
          },
          "requestUrl": {
            "type": "string",
            "description": "请求 URL"
          }
        },
        "description": "卡片状态变更记录列表"
      },
      "TransactionLimitsResource": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "卡片消费限额类型。配额将在00:00（GMT+8）重置。可选值：DAY,WEEK,MONTH,QUARTER,YEAR,LIFETIME,TRANSACTION,NA"
          },
          "value": {
            "type": "string",
            "description": "卡片消费限额金额"
          },
          "currency": {
            "type": "string",
            "description": "货币代码"
          }
        },
        "description": "限制信息"
      },
      "ErrorResult": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "错误码",
            "example": "400001"
          },
          "message": {
            "type": "string",
            "description": "错误信息",
            "example": "参数无效"
          }
        }
      },
      "CreateBudgetCardReqDTO": {
        "title": "创建预算卡",
        "required": [
          "accountId",
          "binId",
          "budgetId",
          "cardMode",
          "cardholderId",
          "referenceId"
        ],
        "type": "object",
        "properties": {
          "accountId": {
            "type": "string",
            "description": "账户UUID",
            "format": "uuid"
          },
          "binId": {
            "type": "string",
            "description": "卡BIN ID"
          },
          "cardMode": {
            "type": "string",
            "description": "卡片模式。示例：虚拟卡",
            "enum": [
              "PHYSICAL_CARD",
              "VIRTUAL_CARD"
            ]
          },
          "useType": {
            "type": "string",
            "description": "自定义用途类型。示例：在线广告"
          },
          "label": {
            "type": "string",
            "description": "自定义卡片标签或标记"
          },
          "cardholderId": {
            "type": "string",
            "description": "持卡人ID"
          },
          "physicalCardDesignId": {
            "type": "string",
            "description": "实体卡设计ID"
          },
          "referenceId": {
            "type": "string",
            "description": "您为每张卡片分配的唯一标识符。此值在每个卡片请求中必须唯一，稍后将用于查询或跟踪相应的卡片。"
          },
          "budgetId": {
            "type": "string",
            "description": "预算UUID",
            "format": "uuid"
          }
        },
        "description": "创建预算卡"
      }
    },
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "description": "API密钥",
        "name": "x-access-token",
        "in": "header"
      }
    }
  }
}
```