---
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/budgets/{id}/transfer-out": {
      "post": {
        "tags": [
          "预算"
        ],
        "summary": "减少预算余额",
        "description": "预算的余额通过量子账户与预算之间的转账进行管理。此接口用于将预算中的资金回划至量子账户。",
        "operationId": "subBudget",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "预算的UUID。",
            "required": true,
            "schema": {
              "type": "string",
              "description": "预算的UUID。",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BudgetTransferReqDTO"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BudgetTransactionResponse"
                },
                "example": {
                  "code": "000000",
                  "message": "成功",
                  "data": {
                    "id": "e6bb0163-8cd5-4f90-aba5-197b19431734",
                    "accountId": "c83929c5-4ff3-42d4-af6d-56043022ebad",
                    "budgetId": "e9561c9f-a7f6-4356-b2fe-4a4984c33c01",
                    "amount": "1",
                    "fee": "0",
                    "feeDetails": [],
                    "clientTransactionId": "8877665544332211",
                    "transactionDisplayId": "2509161723000095",
                    "type": "1",
                    "status": "CLOSED",
                    "createTime": "1758014613210"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResult"
                },
                "example": {
                  "code": "40001",
                  "message": "参数无效"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "ErrorResult": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "错误码",
            "example": "400001"
          },
          "message": {
            "type": "string",
            "description": "错误信息",
            "example": "参数无效"
          }
        }
      },
      "FeeDetail": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "string",
            "description": "金额"
          },
          "currency": {
            "type": "string",
            "description": "货币代码"
          },
          "feeType": {
            "type": "string",
            "description": "费用类型：0：平台结算费用，1：Apple Pay费用，2：ATM取款费用，3：撤销费用，4：退款费用"
          }
        },
        "description": "交易费用详情"
      },
      "BudgetTransferReqDTO": {
        "required": [
          "accountId",
          "amount",
          "clientTransactionId"
        ],
        "type": "object",
        "properties": {
          "accountId": {
            "type": "string",
            "description": "账户UUID",
            "format": "uuid"
          },
          "amount": {
            "type": "string",
            "description": "影响预算余额的交易金额。"
          },
          "clientTransactionId": {
            "type": "string",
            "description": "用户提供的自定义交易ID。"
          }
        }
      },
      "BudgetTransaction": {
        "required": [
          "accountId",
          "amount",
          "budgetId",
          "clientTransactionId",
          "createTime",
          "fee",
          "feeDetails",
          "id",
          "status",
          "transactionDisplayId"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "交易UUID"
          },
          "accountId": {
            "type": "string",
            "description": "账户UUID"
          },
          "budgetId": {
            "type": "string",
            "description": "预算UUID"
          },
          "cardId": {
            "type": "string",
            "description": "卡片UUID"
          },
          "amount": {
            "type": "string",
            "description": "交易金额"
          },
          "fee": {
            "type": "string",
            "description": "交易费用"
          },
          "feeDetails": {
            "type": "array",
            "description": "交易费用详情",
            "items": {
              "$ref": "#/components/schemas/FeeDetail"
            }
          },
          "clientTransactionId": {
            "type": "string",
            "description": "用户提供的自定义交易ID。"
          },
          "transactionDisplayId": {
            "type": "string",
            "description": "交易显示ID"
          },
          "merchantName": {
            "type": "string",
            "description": "商户名称"
          },
          "mcc": {
            "type": "string",
            "description": "商户类别代码（MCC），存在于消费交易中。"
          },
          "mccCategory": {
            "type": "string",
            "description": "MCC的行业类别，存在于消费交易中。"
          },
          "merchantCity": {
            "type": "string",
            "description": "商户城市，存在于消费交易中。"
          },
          "merchantCountry": {
            "type": "string",
            "description": "商户国家，存在于消费交易中。"
          },
          "merchantState": {
            "type": "string",
            "description": "商户州/省，存在于消费交易中。"
          },
          "merchantZipcode": {
            "type": "string",
            "description": "商户邮政编码，存在于消费交易中。"
          },
          "merchantMid": {
            "type": "string",
            "description": "商户识别号码（MID），存在于消费交易中。"
          },
          "transactionCurrency": {
            "type": "string",
            "description": "原始交易货币"
          },
          "transactionAmount": {
            "type": "string",
            "description": "原始交易金额"
          },
          "type": {
            "type": "string",
            "description": "交易类型：0：转入，1：转出，2：开卡费，3：消费，4：退款，5：退款费，6：交易授权费，7：拒付手续费，8：撤销"
          },
          "status": {
            "type": "string",
            "description": "交易状态"
          },
          "createTime": {
            "type": "string",
            "description": "交易时间戳。",
            "format": "timestamp"
          },
          "detail": {
            "type": "string",
            "description": "交易详情"
          },
          "businessCodeList": {
            "type": "array",
            "description": "业务编码标识。",
            "items": {
              "type": "integer",
              "description": "业务编码标识。",
              "format": "int32"
            }
          },
          "direction": {
            "type": "integer",
            "description": "交易方向：1-入账，2-出账",
            "format": "int32"
          }
        },
        "description": "返回数据"
      },
      "BudgetTransactionResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "返回码"
          },
          "message": {
            "type": "string",
            "description": "错误信息"
          },
          "data": {
            "$ref": "#/components/schemas/BudgetTransaction"
          }
        },
        "description": "预算交易资源"
      }
    },
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "description": "API密钥",
        "name": "x-access-token",
        "in": "header"
      }
    }
  }
}
```