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: content/billing/using-the-new-billing-platform/automating-usage-reporting.md
+6-6
Original file line number
Diff line number
Diff line change
@@ -10,25 +10,25 @@ topics:
10
10
- Enterprise
11
11
- Billing
12
12
- REST
13
-
permissions: 'Enterprise owners and billing managers'
13
+
permissions: 'Enterprise owners, organization owners, and billing managers'
14
14
product: '{% data reusables.billing.enhanced-billing-platform-product %}'
15
15
---
16
16
17
17
You can automatically pull data from {% data variables.product.github %} to populate the business systems you use to monitor costs and usage using the REST API. If you haven't used the {% data variables.product.github %} REST API before, the following articles are a good starting point, see [AUTOTITLE](/rest/using-the-rest-api).
18
18
19
-
## Using the billing platform `/usage` endpoint to retrieve metered usage details for an enterprise
19
+
## Using the billing platform `/usage` endpoint to retrieve metered usage details for an enterprise or organization
20
20
21
-
The enhanced billing platform provides a single REST API `/usage`endpoint that you can use to report on the use of all metered products. The usage data provided by this endpoint is available only to enterprise owners and enterprise billing managers, so you will need to authenticate with {% data variables.product.github %}.
21
+
The enhanced billing platform provides REST API `/usage`endpoints that you can use to report on the use of all metered products in an enterprise or an organization. The usage data provided by the enterprise endpoint is available to enterprise owners and enterprise billing managers, and the data provided by the organization endpoint is available to organization owners within an enterprise and organization owners within an organization account. You will need to authenticate with {% data variables.product.github %}.
22
22
23
23
* If you use the GitHub CLI, use the `gh auth login` command to authenticate.
24
24
* Otherwise, you will need to create a {% data variables.product.pat_v1 %}, see [Creating a {% data variables.product.pat_v1 %}](/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic).
25
25
26
-
When you call the`/usage` endpoint, you must specify the enterprise that you want data for and, by default, usage for the current year that does not belong to a cost center is reported. You can reduce the scope of data returned by the endpoint using query parameters.
26
+
When you call a`/usage` endpoint, you must specify the enterprise or organization that you want data for and, by default, usage for the current year that does not belong to a cost center is reported. You can reduce the scope of data returned by the endpoint using query parameters.
27
27
28
28
* Define a specific time period by setting one or more of the following parameters: `year`, `month`, `day`, and `hour`.
29
-
* Define a cost center to report on by identifier using the `cost_center_id` query parameter.
29
+
* Define a cost center to report on by identifier using the `cost_center_id` query parameter. This query parameter is only available for the enterprise-level endpoint.
30
30
31
-
For more detailed information and an example call and response, see [Get billing usage report for an enterprise](/rest/enterprise-admin/billing?apiVersion=2022-11-28#get-billing-usage-report-for-an-enterprise).
31
+
For more detailed information and an example call and response, see [Get billing usage report for an enterprise](/rest/enterprise-admin/billing?apiVersion=2022-11-28#get-billing-usage-report-for-an-enterprise) or [Get billing usage report for an organization](/rest/billing/enhanced-billing?apiVersion=2022-11-28#get-billing-usage-report-for-an-organization).
32
32
33
33
<!-- expires 2025-07-01 -->
34
34
## Migrating from the endpoints used for the previous billing platform
0 commit comments