Set Global Balance Sharing for AceDataCloud Platform Applications

Toggle the allow_consume_global switch for a specific Application—when enabled, if the balance of that Application is exhausted, it will automatically deduct from your account's global recharge balance pool, preventing a single service from becoming suddenly unavailable.

Suitable for:

  • API integration in production environments, concerned about the temporary exhaustion of a single service's quota affecting business.
  • One-time recharge for the entire account, allowing multiple services to share without needing to purchase packages for each service separately.

ℹ️ This interface belongs to the AceDataCloud Platform Management API, with a unified prefix of https://platform.acedata.cloud/api/v1/. For the complete interface index, see Get AceDataCloud Platform Documentation List.

Interface Overview

Item Content
Method POST
URL https://platform.acedata.cloud/api/v1/applications/{application_id}/consume_global/
Authentication ✅ Requires account token
Content-Type application/json

Authentication Instructions (How to Obtain Account Token)

Request Header:

Authorization: Bearer platform-v1-92eb****629c

How to obtain the account token: Log in to AceDataCloud PlatformAccount Token Console. For details, see Manage AceDataCloud Platform Account Tokens.

Path Parameters

Parameter Type Required Description
application_id UUID The Application ID to modify

Request Body

Field Type Required Description
allow_consume_global boolean true to enable global balance sharing, false to disable

Request Example

cURL

# Enable
curl -X POST 'https://platform.acedata.cloud/api/v1/applications/82f57141-2323-4453-8730-60f7d833a2da/consume_global/' \
  -H 'accept: application/json' \
  -H 'authorization: Bearer platform-v1-92eb****629c' \
  -H 'content-type: application/json' \
  -d '{"allow_consume_global": true}'

# Disable
curl -X POST 'https://platform.acedata.cloud/api/v1/applications/82f57141-2323-4453-8730-60f7d833a2da/consume_global/' \
  -H 'authorization: Bearer platform-v1-92eb****629c' \
  -H 'content-type: application/json' \
  -d '{"allow_consume_global": false}'

Python

import requests

app_id = "82f57141-2323-4453-8730-60f7d833a2da"
resp = requests.post(
    f"https://platform.acedata.cloud/api/v1/applications/{app_id}/consume_global/",
    headers={
        "accept": "application/json",
        "authorization": "Bearer platform-v1-92eb****629c",
        "content-type": "application/json",
    },
    json={"allow_consume_global": True},
    timeout=10,
)
print(resp.status_code, resp.json())

Node.js

const appId = '82f57141-2323-4453-8730-60f7d833a2da'
const r = await fetch(
  `https://platform.acedata.cloud/api/v1/applications/${appId}/consume_global/`,
  {
    method: 'POST',
    headers: {
      authorization: 'Bearer platform-v1-92eb****629c',
      'content-type': 'application/json',
    },
    body: JSON.stringify({ allow_consume_global: true }),
  }
)
console.log(await r.json())

Response Example (HTTP 200)

Returns the updated Application object, structured the same as Get AceDataCloud Platform Service Application Details:

{
  "id": "82f57141-2323-4453-8730-60f7d833a2da",
  "service_id": "38ecf158-36f2-42f2-8e7f-6786cdfc2452",
  "remaining_amount": 100.0,
  "used_amount": 12.34,
  "paid": true,
  "allow_consume_global": true,
  "...": "..."
}

Note that the allow_consume_global field has been toggled.

Error Handling

HTTP Code Meaning
400 invalid Request body missing allow_consume_global or value is not boolean
401 not_authenticated Missing account token
403 permission_denied This Application does not belong to you
404 not_found Application does not exist

Practical Tips

When to Enable

  • API integration in production environments, where a single call failure affects business continuity.
  • When a large amount of "general balance" has already been added to the account and you want any service to be able to consume it.

When to Disable

  • Testing environments, where you want to use free quotas as a hard limit, failing immediately when exceeded for easier troubleshooting.
  • To prevent a newly integrated service from consuming a large amount of quota abnormally (observe for a week first).

How Global Balance is Accumulated

  • By creating a recharge order on AceDataCloud Platform, selecting the package type as Wallet (recharge wallet) when funds enter the global balance pool.
  • Selecting the package type as Usage (specific service) will only enter the corresponding Application's balance, not shared with the global pool.