Get Azure Consumption Report

Prev Next

Retrieves Azure consumption data for a customer with support for pagination and filtering by subscription, entitlement, resource group, resource, and date.

URL

{{apiUrl}}/api/azureConsumption/v3/customer/{{customerId}}/page/{{pageSize}}/startindex/{{startIndex}}/month/{{month}}/year/{{year}}?date={{date}}&subscriptionId={{subscriptionId}}&entitlementId={{entitlementId}}&resourceGroup={{resourceGroup}}&resourceName={{resourceName}}

Endpoint Parameters

ParameterRequiredDescription
{{apiUrl}}YesC3 Portal API URL.
{{customerId}}YesMicrosoft Customer ID used to retrieve consumption details for a specific customer.
{{pageSize}}YesNumber of consumption records to return per page.
{{startIndex}}YesStarting index of the result set. Used for pagination.
{{month}}YesCalendar month number (1 = January, 2 = February, ..., 12 = December).
{{year}}YesBilling year. Only the current year and the previous year are supported.
{{date}}NoSpecific day within the selected month and year for which consumption data should be returned.
{{subscriptionId}}NoAzure subscription identifier used to filter results for a specific subscription.
{{entitlementId}}NoAzure subscription entitlement identifier. Applicable only to Azure Plan subscriptions.
{{resourceGroup}}NoAzure Resource Group name used to return data for a specific resource group.
{{resourceName}}NoAzure resource name used to return data for a specific resource.
Billing Month Note

The specified month represents the month in which Microsoft generated the bill. The consumption data returned corresponds to the previous month.

Example

  • June 2020 billing period returns consumption data for May 2020.

Request Headers

HeaderValue
AuthorizationBearer <access_token>
Content-Typeapplication/json

Request Body

No request body is required for this endpoint.

Use the optional query parameters to filter the consumption report results.

Successful Response

Response Structure

{
  "OperationType": null,
  "Status": "Success",
  "RequestCorrelationID": "f2cdf3b3-7043-463a-be65-ee6470ee11ac",
  "ErrorMessage": null,
  "ErrorDetail": null,
  "Data": [...]
}

Response Properties

PropertyDescription
OperationTypeReserved for internal use. Can be ignored.
StatusIndicates the result of the request. Possible values: Success, Error.
RequestCorrelationIDUnique identifier generated by C3 for request tracking and troubleshooting.
ErrorMessageContains the error message if request processing fails.
ErrorDetailContains additional error information.
DataCollection of consumption report records.

Consumption Report Attributes

AttributeDescription
SubscriptionNameName of the Azure Plan or subscription associated with the consumption record.
EntitlementNameName of the Azure subscription under the Azure Plan. Returns null for legacy Azure subscriptions.
EntitlementIdUnique identifier of the Azure subscription under the Azure Plan. Returns null for legacy Azure subscriptions.
AdditionalInfoAdditional usage information provided by Microsoft.
ReservationIdReservation identifier extracted from the usage data, when applicable.
MeterIdUnique identifier of the Azure meter associated with the consumed resource.
ProductIdMicrosoft product identifier associated with the consumption record.
SkuIdStock Keeping Unit (SKU) identifier provided by Microsoft.
ConsumedServiceAzure service responsible for the recorded consumption.
ResourceURIResource URI provided by Microsoft in the usage data.
BenefitOrderIdUnique identifier of the Azure Savings Plan order. Applicable only to eligible usage records.
BenefitIdUnique identifier of the Azure Savings Plan associated with the consumption record.
BenefitTypeIndicates whether the usage is covered by an Azure Savings Plan or billed at pay-as-you-go rates.
IDSequential record number within the API response.
TenantIdMicrosoft Customer ID associated with the consumption record.
SubscriptionIdAzure Subscription ID.
AzureResourceGroupNameName of the Azure Resource Group containing the resource.
AzureResourceCategoryResource category reported by Microsoft.
AzureResourceSubCategoryResource subcategory reported by Microsoft.
AzureResourceTypeAzure resource type.
AzureResourceNameName of the Azure resource.
ChargeDateDate on which the resource consumption occurred.
QuantityTotal quantity of usage billed.
UnitUnit of measurement used for billing.
ChargeForCustomerAmount billed to the customer, including any configured margin.
ChargedByMSAmount charged by Microsoft.
ChargeForResellerAmount charged to the reseller, where applicable.
LocationAzure region where the resource consumption occurred.
TagsAzure resource tags associated with the usage record.

Error Response

The API validates all supplied parameters before processing the request.

If one or more parameters are invalid, the API returns a 400 (Bad Request) response containing validation details.

Sample Error Response

{
  "OperationType": null,
  "Status": "Error",
  "RequestCorrelationID": "fe8ff19e-b9eb-4a43-af0f-418e86b9b200",
  "ErrorMessage": "ERROR_DESC_BAD_INPUT",
  "ErrorDetail": "ERROR_DESC_BAD_INPUT",
  "Data": [
    {
      "Attribute": "TenantId",
      "AttributeKey": "TENANT_ID",
      "Message": "INVALID_CUSTOMER_ID",
      "DefaultMessage": "Invalid Customer ID",
      "Value": "b8177a6b-868a-44e4-9bf7-b13dd5a13d01"
    }
  ]
}

Validation Error Properties

PropertyDescription
OperationTypeReserved for internal use. Can be ignored.
StatusIndicates the outcome of the request. Possible values: Success, Error.
RequestCorrelationIDUnique identifier generated by C3 for request tracking and troubleshooting.
ErrorMessageHigh-level error message describing the failure.
ErrorDetailAdditional information about the error.
DataCollection of validation error details.

Validation Error Attributes

AttributeDescription
AttributeName of the request parameter that failed validation.
AttributeKeyInternal identifier associated with the validation attribute.
MessageValidation error code.
DefaultMessageHuman-readable validation error message.
ValueInvalid value supplied in the request.