你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Balances - Get By Billing Account
Gets the balances for a scope by billingAccountId. Balances are available via this API only for May 1, 2014 or later.
GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/balances?api-version=2024-08-01
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
billing
|
path | True |
string |
BillingAccount ID |
api-version
|
query | True |
string |
Version of the API to be used with the client request. The current version is 2023-03-01. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
OK. The request has succeeded. |
|
Other Status Codes |
Error response describing why the operation failed. |
Security
azure_auth
Azure Active Directory OAuth2 Flow.
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name | Description |
---|---|
user_impersonation | impersonate your user account |
Examples
Balances
Sample request
GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.Consumption/balances?api-version=2024-08-01
Sample response
{
"id": "/providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.Billing/billingPeriods/201702/providers/Microsoft.Consumption/balances/balanceId1",
"name": "balanceId1",
"type": "Microsoft.Consumption/balances",
"properties": {
"currency": "USD ",
"beginningBalance": 3396469.19,
"endingBalance": 2922371.02,
"newPurchases": 0,
"adjustments": 0,
"utilized": 474098.17,
"serviceOverage": 0,
"chargesBilledSeparately": 0,
"totalOverage": 0,
"totalUsage": 474098.17,
"azureMarketplaceServiceCharges": 609.82,
"billingFrequency": "Month",
"priceHidden": false,
"overageRefund": 2012.61,
"newPurchasesDetails": [
{
"name": "Promo Purchase",
"value": 1
}
],
"adjustmentDetails": [
{
"name": "Promo Credit",
"value": 1.1
},
{
"name": "SIE Credit",
"value": 1
}
]
}
}
Definitions
Name | Description |
---|---|
Adjustment |
List of Adjustments (Promo credit, SIE credit etc.). |
Balance |
A balance resource. |
Billing |
The billing frequency. |
Error |
The details of the error. |
Error |
Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message. Some Error responses:
|
New |
List of new purchases. |
AdjustmentDetails
List of Adjustments (Promo credit, SIE credit etc.).
Name | Type | Description |
---|---|---|
name |
string |
the name of new adjustment. |
value |
number |
the value of new adjustment. |
Balance
A balance resource.
Name | Type | Description |
---|---|---|
etag |
string |
The etag for the resource. |
id |
string |
The full qualified ARM ID of an event. |
name |
string |
The ID that uniquely identifies an event. |
properties.adjustmentDetails |
List of Adjustments (Promo credit, SIE credit etc.). |
|
properties.adjustments |
number |
Total adjustment amount. |
properties.azureMarketplaceServiceCharges |
number |
Total charges for Azure Marketplace. |
properties.beginningBalance |
number |
The beginning balance for the billing period. |
properties.billingFrequency |
The billing frequency. |
|
properties.chargesBilledSeparately |
number |
Charges Billed separately. |
properties.currency |
string |
The ISO currency in which the meter is charged, for example, USD. |
properties.endingBalance |
number |
The ending balance for the billing period (for open periods this will be updated daily). |
properties.newPurchases |
number |
Total new purchase amount. |
properties.newPurchasesDetails |
List of new purchases. |
|
properties.overageRefund |
number |
Overage Refunds |
properties.priceHidden |
boolean |
Price is hidden or not. |
properties.serviceOverage |
number |
Overage for Azure services. |
properties.totalOverage |
number |
serviceOverage + chargesBilledSeparately. |
properties.totalUsage |
number |
Azure service commitment + total Overage. |
properties.utilized |
number |
Total Commitment usage. |
tags |
object |
Resource tags. |
type |
string |
Resource type. |
BillingFrequency
The billing frequency.
Name | Type | Description |
---|---|---|
Month |
string |
|
Quarter |
string |
|
Year |
string |
ErrorDetails
The details of the error.
Name | Type | Description |
---|---|---|
code |
string |
Error code. |
message |
string |
Error message indicating why the operation failed. |
ErrorResponse
Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.
Some Error responses:
429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" header.
503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" header.
504 Gateway Timeout - Service timed out while processing the request. Reduce the date range in the request, if possible.
Name | Type | Description |
---|---|---|
error |
The details of the error. |
NewPurchasesDetails
List of new purchases.
Name | Type | Description |
---|---|---|
name |
string |
the name of new purchase. |
value |
number |
the value of new purchase. |