Use this endpoint to get account remaining, account lifetime spending cap and account total spend by account ids. The users should only be able to get the budget info of ad accounts that have account level cap, and they have access to. The number of account IDs cannot be 0 or more than 500, if more than 20 IDs, return the first 500
Request
End Point https://business.newsbreak.com/business-api/v1/balance/getAccountBudgetInfo
Method POST
Header
| Field | Required | Data Type | Description |
|---|---|---|---|
| Access-Token | Y | string | Authorized access token. |
Request Parameters
| Field | Required | Data Type | Description |
|---|---|---|---|
| accountIds | Y | string[] | IDs of account. |
Example
curl --location --request POST 'https://business.newsbreak.com/business-api/v1/balance/getAccountBudgetInfo' \
-H 'Content-Type: application/json' \
-H 'Access-Token:{{Access-Token}}' \
-d '{
"accountIds": [
"123", "234", "456"
]
}'
Response
Response Parameters
| Field | Data Type | Description |
|---|---|---|
| code | int | Status code, see Return Codes. |
| errMsg | string | Error message when code!=0. |
| data | object | Response object. |
| └── list | object[] | Each row is an account budget info. |
| └── accountId | string | Ad Account ID. |
| └── accountRemaining | double | budget remaining in the account. |
| └── accountSpendingCap | double | account level spending cap. |
| └── accountTotalSpend | double | total spent in the account. |
| └── canViewBudget | boolean | true means can view this account's budget. |
| └── failMessage | string | reason why cannot view this account's budget. |
Example
{
{
"code": 0,
"data": {
"list": [
{
"accountId": "123",
"accountRemaining": "800.0",
"accountSpendingCap": "1000.0",
"accountTotalSpend": "200.0",
"canViewBudget": true
},
{
"accountId": "234",
"canViewBudget": false,
"failMessage": "No access"
},
{
"accountId": "456",
"canViewBudget": false,
"failMessage": "No account spending cap is set for this account"
}
]
}
}