Based on the context provided, it seems that the API endpoint you are trying to use is for the Consumption API, which is not supported for checking Azure credit balance for a billing account under Microsoft Customer Agreement. Instead, you can use the Azure Billing and the Consumption APIs to programmatically get the credit balance for your billing account. The examples shown below use REST APIs. Currently, PowerShell and Azure CLI are not supported.
To check the Azure credit balance for your billing account, you need to use the following API endpoint:
https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Billing/billingProfiles/{billingProfileId}/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}/balance?api-version=2021-08-01-preview
Please replace {billingAccountId}, {billingProfileId}, and {enrollmentAccountId} with the appropriate values.
If you are viewing Azure credits at the billing account scope and the billing account has more than one billing profile, the Azure credits page will show a table with a summary of Azure credits for each billing profile. Select a billing profile from the list, select payment methods and then Azure credits to view details for a billing profile.
To get the credit balance for your billing account, you can make a GET request to the above API endpoint. The API response returns estimated and current balance for the billing profile. The following elements are returned in the API response:
- estimatedBalance: The estimated amount of credits you have after considering all billed and pending transactions.
- currentBalance: The amount of credits as of your last invoice. It doesn't include any pending transactions.
- pendingCreditAdjustments: The adjustments like refunds that are not yet invoiced.
- expiredCredit: The credit that expired since your last invoice.
- pendingEligibleCharges: The credit eligible charges that are not yet invoiced.
Please note that you must have an owner, contributor, reader, or invoice manager role on the billing profile or owner, contributor, or reader role on the billing account to view Azure credit balance for a billing profile. To learn more about the roles, see Understand Microsoft Customer Agreement administrative roles in Azure.
References: