> ## 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.