You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cost-management-billing/manage/review-enterprise-billing.md
+23-9Lines changed: 23 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,31 +20,34 @@ This asynchronous API allows you to generate and download cost reports for your
20
20
21
21
In this article, you learn to retrieve the billing information associated with EA billing accounts, departments, or enrollment accounts using the Cost Details API.
22
22
23
+
> [!TIP]
24
+
> This REST API is ideal for automation scenarios where you need to programmatically retrieve cost data on a regular basis. You can integrate it into scripts, applications, or automated workflows to pull cost reports for analysis, budgeting, or compliance reporting.
25
+
23
26
> [!IMPORTANT]
24
-
> The Cost Details API is asynchronous and report-based. You submit a request to generate a report, poll for its completion, and then download the resulting file from a secure URL.
27
+
> The Cost Details API is asynchronous and report-based. You submit a request to generate a downloadable file (report), poll for its completion, and then download the resulting file from a secure URL.
25
28
26
29
## How the Cost Details API works
27
30
28
31
The Cost Details API uses an asynchronous workflow:
29
32
30
-
1.**Create a report**: Submit a POST request to generate a cost details report for your EA scope
33
+
1.**Create a report**: Submit a POST request to generate a Cost Details report for your EA scope
31
34
2.**Poll for status**: Check the operation status until the report is complete
32
35
3.**Download the report**: Use the provided download URL to get the CSV file with your cost data
33
36
34
37
> [!NOTE]
35
-
> The API supports both **ActualCost** and **AmortizedCost** metrics. ActualCost shows charges as they were billed, while AmortizedCost spreads reservation and savings plans purchases across their term and reallocates costs to the resources that used the reservation or savings plan. For example, a $365 reservation purchase appears as $1.00 daily charges in amortized cost view.
38
+
> The API supports both **ActualCost** and **AmortizedCost** metrics. ActualCost shows charges as they were billed, while AmortizedCost spreads reservation and savings plans purchases across their term and reallocates costs to the resources that used the reservation or savings plan. For example, a 1-year reservation costing $365 will appear in ActualCost as a single charge on the purchase date. In AmortizedCost, that same $365 is spread out as a daily $1.00 charge across the usage that benefits from the reservation.
36
39
37
40
## Working with different EA scopes
38
41
39
42
The Cost Details API supports three EA scopes, each providing different levels of cost aggregation:
40
43
41
44
-**Billing account scope**: Cost details for the entire EA billing account
42
45
-**Department scope**: Cost details aggregated for all accounts in a specific department
43
-
-**Enrollment account scope**: Cost details for a specific enrollment account
46
+
-**Enrollment account scope**: Cost details for a specific account within an enrollment
44
47
45
48
## Step 1: Create a cost details report
46
49
47
-
Submit a POST request to generate a cost details report:
50
+
Submit a POST request to generate a Cost Details report:
48
51
49
52
```http
50
53
POST https://management.azure.com/providers/Microsoft.Billing/{scope}/providers/Microsoft.CostManagement/generateCostDetailsReport?api-version=2025-03-01
@@ -91,8 +94,8 @@ The request body supports the following parameters:
91
94
92
95
-**metric** - The type of report requested. Can be either `ActualCost` or `AmortizedCost`. If not specified, defaults to `ActualCost`.
93
96
-**timePeriod** - The requested date range for your data. Specify `start` and `end` dates in YYYY-MM-DD format. Can't be used alongside invoiceId or billingPeriod parameters.
94
-
-**invoiceId** - The requested invoice for your data. This parameter is only used by Microsoft Customer Agreement customers and can only be used at the Billing Profile or Customer scope. Can't be used alongside billingPeriod or timePeriod parameters.
95
-
-**billingPeriod** - The requested billing period for your data. This parameter is only used by Enterprise Agreement customers. Use the YearMonth format (for example, 202408). Can't be used alongside invoiceId or timePeriod parameters.
97
+
-**invoiceId** - The requested invoice for your data. This parameter is supported for Microsoft Customer Agreement customers at the Billing Profile or Customer scope. Can't be used alongside billingPeriod or timePeriod parameters.
98
+
-**billingPeriod** - The requested billing period for your data. This parameter is supported for Enterprise Agreement customers. Use the YearMonth format (for example, 202408). Can't be used alongside invoiceId or timePeriod parameters.
96
99
97
100
> [!NOTE]
98
101
> If none of the timePeriod, invoiceId, or billingPeriod parameters are provided in the request body, the API returns the current month's cost.
@@ -119,7 +122,18 @@ The initial POST request returns status code 202 (Accepted) with response header
119
122
120
123
When the report is complete, the polling endpoint returns status code 200 (OK) with the report details, including a `blobLink` for downloading the CSV file.
121
124
122
-
## Cost details file fields
125
+
### Key response fields
126
+
127
+
|Response property|Description|
128
+
|----------------|----------|
129
+
|**status**| Status of the report generation (InProgress, Completed, Failed) |
130
+
|**dataFormat**| Format of the generated report (CSV) |
131
+
|**blobCount**| Number of blob files in the report dataset |
132
+
|**byteCount**| Total size of the report dataset in bytes |
133
+
|**blobLink**| Download URL for the Cost Details CSV file |
134
+
|**validTill**| Expiration date/time for the download URL |
135
+
136
+
## Cost Details file fields
123
137
124
138
The downloaded CSV file contains detailed cost and usage data with key fields including:
125
139
@@ -146,4 +160,4 @@ For a complete list of all fields and their descriptions, see [Understand cost d
146
160
-[Get started with Azure REST API](/rest/api/azure/)
147
161
-[Learn more about the Cost Details API](/rest/api/cost-management/generate-cost-details-report)
148
162
-[Get small cost datasets on demand](../automate/get-small-usage-datasets-on-demand.md)
Copy file name to clipboardExpand all lines: articles/cost-management-billing/manage/review-subscription-billing.md
+12-9Lines changed: 12 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,21 +19,24 @@ The Cost Details API, in particular, helps you review and manage your Azure cost
19
19
20
20
This asynchronous API allows you to generate and download cost reports for your subscription.
21
21
22
-
Here, you learn to use the Cost Details API to return subscription billing details for a given date range.
22
+
In this article, you learn to use the Cost Details API to return subscription billing details for a given date range.
23
+
24
+
> [!TIP]
25
+
> This REST API is ideal for automation scenarios where you need to programmatically retrieve cost data on a regular basis. You can integrate it into scripts, applications, or automated workflows to pull cost reports for analysis, budgeting, or compliance reporting.
23
26
24
27
> [!IMPORTANT]
25
-
> The Cost Details API is asynchronous and report-based. You submit a request to generate a report, poll for its completion, and then download the resulting file from a secure URL.
28
+
> The Cost Details API is asynchronous and report-based. You submit a request to generate a downloadable file (report), poll for its completion, and then download the resulting file from a secure URL.
26
29
27
30
## How the Cost Details API works
28
31
29
32
The Cost Details API uses an asynchronous workflow:
30
33
31
-
1.**Create a report**: Submit a POST request to generate a cost details report for your subscription
34
+
1.**Create a report**: Submit a POST request to generate a Cost Details report for your subscription
32
35
2.**Poll for status**: Check the operation status until the report is complete
33
36
3.**Download the report**: Use the provided download URL to get the CSV file with your cost data
34
37
35
38
> [!NOTE]
36
-
> The API supports both **ActualCost** and **AmortizedCost** metrics. ActualCost shows charges as they were billed, while AmortizedCost spreads reservation and savings plans purchases across their term and reallocates costs to the resources that used the reservation or savings plan. For example, a $365 reservation purchase appears as $1.00 daily charges in amortized cost view.
39
+
> The API supports both **ActualCost** and **AmortizedCost** metrics. ActualCost shows charges as they were billed, while AmortizedCost spreads reservation and savings plans purchases across their term and reallocates costs to the resources that used the reservation or savings plan. For example, a 1-year reservation costing $365 will appear in ActualCost as a single charge on the purchase date. In AmortizedCost, that same $365 is spread out as a daily $1.00 charge across the usage that benefits from the reservation.
37
40
38
41
## Step 1: Create a report
39
42
@@ -74,8 +77,8 @@ The request body supports the following parameters:
74
77
75
78
-**metric** - The type of report requested. Can be either `ActualCost` or `AmortizedCost`. If not specified, defaults to `ActualCost`.
76
79
-**timePeriod** - The requested date range for your data. Specify `start` and `end` dates in YYYY-MM-DD format. Can't be used alongside invoiceId or billingPeriod parameters.
77
-
-**invoiceId** - The requested invoice for your data. This parameter is only used by Microsoft Customer Agreement customers and can only be used at the Billing Profile or Customer scope. Can't be used alongside billingPeriod or timePeriod parameters.
78
-
-**billingPeriod** - The requested billing period for your data. This parameter is only used by Enterprise Agreement customers. Use the YearMonth format (for example, 202408). Can't be used alongside invoiceId or timePeriod parameters.
80
+
-**invoiceId** - The requested invoice for your data. This parameter is supported for Microsoft Customer Agreement customers at the Billing Profile or Customer scope. Can't be used alongside billingPeriod or timePeriod parameters.
81
+
-**billingPeriod** - The requested billing period for your data. This parameter is supported for Enterprise Agreement customers. Use the YearMonth format (for example, 202408). Can't be used alongside invoiceId or timePeriod parameters.
79
82
80
83
> [!NOTE]
81
84
> If none of the timePeriod, invoiceId, or billingPeriod parameters are provided in the request body, the API returns the current month's cost.
@@ -142,10 +145,10 @@ When the report is complete, the polling endpoint returns status code 200 (OK) w
142
145
|**dataFormat**| Format of the generated report (CSV) |
143
146
|**blobCount**| Number of blob files in the report dataset |
144
147
|**byteCount**| Total size of the report dataset in bytes |
145
-
|**blobLink**| Download URL for the cost details CSV file |
148
+
|**blobLink**| Download URL for the Cost Details CSV file |
146
149
|**validTill**| Expiration date/time for the download URL |
147
150
148
-
## Cost details file fields
151
+
## Cost Details file fields
149
152
150
153
The downloaded CSV file contains detailed cost and usage data with the following key fields:
151
154
@@ -194,4 +197,4 @@ Other status codes indicate error conditions. The response object explains why t
194
197
-[Get started with Azure REST API](/rest/api/azure/)
195
198
-[Learn more about the Cost Details API](/rest/api/cost-management/generate-cost-details-report)
196
199
-[Get small cost datasets on demand](../automate/get-small-usage-datasets-on-demand.md)
0 commit comments