Configure Mai Application Global Balance Sharing

Configure allow_consume_global. After it is enabled, eligible pay-as-you-go Applications can continue to use the account global balance when their own balance is insufficient.

Preparation

export PLATFORM_TOKEN='your account token'
export APPLICATION_ID='your Application ID'

API Overview

Item Content
Method POST
URL https://moses.platform.acedata.cloud/api/v1/applications/{application_id}/update-allow-consume-global/
Authentication Account Token
Body JSON
curl -X POST \
  "https://moses.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}'

A successful response returns the updated Application object. Please rely on allow_consume_global in the response, rather than assuming that the request value has necessarily been saved.

Applications of the Period type are not allowed to consume the global balance. Even if true is requested, the server will keep this field as false.

Error Handling

  • 401: The Account Token is invalid or missing.
  • 403: The current account is not the owner of this Application.
  • 404: The Application ID does not exist.

For global balance top-up entry points and available plans, refer to the platform console and the actual plans returned by order creation; do not assume that a Wallet type plan exists.

Applications Authorized for Overdraft

When the read-only field allow_overdraft=true of a pay-as-you-go Application is set, the Application can continue deducting charges from its own balance even if the balance becomes negative, and it will not switch to the global account due to insufficient balance. Applications without overdraft enabled still follow allow_consume_global; after switching, whether overdraft is allowed is determined by the settings of the global Application from which the actual charges are deducted.