> ## 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 API guide - 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'
```

## API 概要

| 項目 | 内容 |
| - | - |
| メソッド | `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` タイプのプランが存在すると仮定しないでください。

## 関連 API

* [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.