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

# 设置 AceDataCloud Application 全局余额共享

> Platform 集成指南 - Ace Data Cloud

设置 `allow_consume_global`。开启后，符合条件的按量 Application 在自身余额不足时可继续使用账户全局余额。

## 准备工作

* 创建并安全保存 [Account Token](https://platform.acedata.cloud/documents/platform-token)。
* 从[服务申请列表](https://platform.acedata.cloud/documents/platform-application-list)取得本人拥有的 `application_id`。

```shell theme={null}
export PLATFORM_TOKEN='你的账户令牌'
export APPLICATION_ID='你的 Application ID'
```

## 接口概览

| 项 | 内容 |
| - | - |
| 方法 | `POST` |
| URL | `https://platform.acedata.cloud/api/v1/applications/{application_id}/update-allow-consume-global/` |
| 鉴权 | Account Token |
| Body | JSON |

```shell theme={null}
curl -X POST \
  "https://platform.acedata.cloud/api/v1/applications/${APPLICATION_ID}/update-allow-consume-global/" \
  -H "Authorization: Bearer ${PLATFORM_TOKEN}" \
  -H 'Content-Type: application/json' \
  -d '{"allow_consume_global": true}'
```

成功返回更新后的 Application 对象。请以响应中的 `allow_consume_global` 为准，而不是假设请求值一定被保存。

> `Period` 类型的 Application 不允许消耗全局余额。即使请求 `true`，服务端也会将该字段保持为 `false`。

## 错误处理

* `401`：Account Token 无效或缺失。
* `403`：当前账户不是该 Application 的所有者。
* `404`：Application ID 不存在。

全局余额的充值入口和可用套餐以平台控制台及[订单创建](https://platform.acedata.cloud/documents/platform-order-create)返回的真实套餐为准；不要假设存在 `Wallet` 类型套餐。

## 相关接口

* [获取 Application 详情](https://platform.acedata.cloud/documents/platform-application-detail)
* [获取 Application 列表](https://platform.acedata.cloud/documents/platform-application-list)
* [创建充值订单](https://platform.acedata.cloud/documents/platform-order-create)


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