Enhanced billing platform
Use the REST API to get billing usage information from the enhanced billing platform.
Get billing usage report for an organization
Gets a report of the total usage for an organization. To use this endpoint, you must be an administrator of an organization within an enterprise or an organization account.
Note: This endpoint is only available to organizations with access to the enhanced billing platform. For more information, see "About the enhanced billing platform."
Tokens de acceso específicos para "Get billing usage report for an organization"
Este punto de conexión funciona con los siguientes tipos de token pormenorizados:
- Tokens de acceso de usuario de la aplicación de GitHub
- Token de acceso a la instalación de la aplicación de GitHub
- Tokens de acceso personal específico
El token pormenorizado debe tener el siguiente conjunto de permisos:
- "Administration" organization permissions (read)
Parámetros para "Get billing usage report for an organization"
Nombre, Tipo, Descripción |
---|
accept string Setting to |
Nombre, Tipo, Descripción |
---|
org string RequeridoThe organization name. The name is not case sensitive. |
Nombre, Tipo, Descripción |
---|
year integer If specified, only return results for a single year. The value of |
month integer If specified, only return results for a single month. The value of |
day integer If specified, only return results for a single day. The value of |
hour integer If specified, only return results for a single hour. The value of |
Códigos de estado de respuesta HTTP para "Get billing usage report for an organization"
status code | Descripción |
---|---|
200 | Billing usage report response for an organization |
400 | Bad Request |
403 | Forbidden |
500 | Internal Error |
503 | Service unavailable |
Ejemplos de código para "Get billing usage report for an organization"
Si accedes a GitHub en GHE.com, reemplaza api.github.com
por el subdominio dedicado de la empresa en api.SUBDOMAIN.ghe.com
.
Ejemplo de solicitud
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/organizations/ORG/settings/billing/usage
Billing usage report response for an organization
Status: 200
{
"usageItems": [
{
"date": "2023-08-01",
"product": "Actions",
"sku": "Actions Linux",
"quantity": 100,
"unitType": "minutes",
"pricePerUnit": 0.008,
"grossAmount": 0.8,
"discountAmount": 0,
"netAmount": 0.8,
"organizationName": "GitHub",
"repositoryName": "github/example"
}
]
}