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
| Parameter | Required | Description |
|---|---|---|
{{apiUrl}} | Yes | C3 Portal API URL. |
{{customerId}} | Yes | Microsoft Customer ID used to retrieve consumption details for a specific customer. |
{{pageSize}} | Yes | Number of consumption records to return per page. |
{{startIndex}} | Yes | Starting index of the result set. Used for pagination. |
{{month}} | Yes | Calendar month number (1 = January, 2 = February, ..., 12 = December). |
{{year}} | Yes | Billing year. Only the current year and the previous year are supported. |
{{date}} | No | Specific day within the selected month and year for which consumption data should be returned. |
{{subscriptionId}} | No | Azure subscription identifier used to filter results for a specific subscription. |
{{entitlementId}} | No | Azure subscription entitlement identifier. Applicable only to Azure Plan subscriptions. |
{{resourceGroup}} | No | Azure Resource Group name used to return data for a specific resource group. |
{{resourceName}} | No | Azure resource name used to return data for a specific resource. |
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
| Header | Value |
|---|---|
| Authorization | Bearer <access_token> |
| Content-Type | application/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
| Property | Description |
|---|---|
| OperationType | Reserved for internal use. Can be ignored. |
| Status | Indicates the result of the request. Possible values: Success, Error. |
| RequestCorrelationID | Unique identifier generated by C3 for request tracking and troubleshooting. |
| ErrorMessage | Contains the error message if request processing fails. |
| ErrorDetail | Contains additional error information. |
| Data | Collection of consumption report records. |
Consumption Report Attributes
| Attribute | Description |
|---|---|
| SubscriptionName | Name of the Azure Plan or subscription associated with the consumption record. |
| EntitlementName | Name of the Azure subscription under the Azure Plan. Returns null for legacy Azure subscriptions. |
| EntitlementId | Unique identifier of the Azure subscription under the Azure Plan. Returns null for legacy Azure subscriptions. |
| AdditionalInfo | Additional usage information provided by Microsoft. |
| ReservationId | Reservation identifier extracted from the usage data, when applicable. |
| MeterId | Unique identifier of the Azure meter associated with the consumed resource. |
| ProductId | Microsoft product identifier associated with the consumption record. |
| SkuId | Stock Keeping Unit (SKU) identifier provided by Microsoft. |
| ConsumedService | Azure service responsible for the recorded consumption. |
| ResourceURI | Resource URI provided by Microsoft in the usage data. |
| BenefitOrderId | Unique identifier of the Azure Savings Plan order. Applicable only to eligible usage records. |
| BenefitId | Unique identifier of the Azure Savings Plan associated with the consumption record. |
| BenefitType | Indicates whether the usage is covered by an Azure Savings Plan or billed at pay-as-you-go rates. |
| ID | Sequential record number within the API response. |
| TenantId | Microsoft Customer ID associated with the consumption record. |
| SubscriptionId | Azure Subscription ID. |
| AzureResourceGroupName | Name of the Azure Resource Group containing the resource. |
| AzureResourceCategory | Resource category reported by Microsoft. |
| AzureResourceSubCategory | Resource subcategory reported by Microsoft. |
| AzureResourceType | Azure resource type. |
| AzureResourceName | Name of the Azure resource. |
| ChargeDate | Date on which the resource consumption occurred. |
| Quantity | Total quantity of usage billed. |
| Unit | Unit of measurement used for billing. |
| ChargeForCustomer | Amount billed to the customer, including any configured margin. |
| ChargedByMS | Amount charged by Microsoft. |
| ChargeForReseller | Amount charged to the reseller, where applicable. |
| Location | Azure region where the resource consumption occurred. |
| Tags | Azure 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
| Property | Description |
|---|---|
| OperationType | Reserved for internal use. Can be ignored. |
| Status | Indicates the outcome of the request. Possible values: Success, Error. |
| RequestCorrelationID | Unique identifier generated by C3 for request tracking and troubleshooting. |
| ErrorMessage | High-level error message describing the failure. |
| ErrorDetail | Additional information about the error. |
| Data | Collection of validation error details. |
Validation Error Attributes
| Attribute | Description |
|---|---|
| Attribute | Name of the request parameter that failed validation. |
| AttributeKey | Internal identifier associated with the validation attribute. |
| Message | Validation error code. |
| DefaultMessage | Human-readable validation error message. |
| Value | Invalid value supplied in the request. |