---
title: "Upload usage data to Stripe for billing invoice."
method: POST
path: "/_api/_admin/_billing/usage/report"
tags: ["Administration"]
---

# Upload usage data to Stripe for billing invoice.

`POST /_api/_admin/_billing/usage/report`

## Request

- The document declares no server URL.
- Auth: one of:
  - API key in header `Authorization`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/macrometa/apis/macrometa-api-reference/docs/_api/_admin/_billing/usage/report/post.ts> (a function with typed inputs; its response is checked against the schema)

Upload usage data to Stripe for billing invoice. Requires administrator permissions.

## Request body

- BillingUsageCreate
  - `tenant` string, string: (Optional) The ID of the tenant.
  - `start` string, string: Start date-time in 'YYYY-MM-DD HH:MM:SS' format.
  - `end` string, string: End date-time in 'YYYY-MM-DD HH:MM:SS' format.
  - `overwrite` boolean: (Optional) Overwrite existing usage data.

## Response `200`

Upload usage data to stripe for billing invoice.

- object
  - `code` integer: HTTP response code.
  - `error` boolean: Flag if there is an error in response. _False_ for this response.
  - `message` string: _OK_ if successfully generated aggregated usage data for billing. An error description is displayed if an error occurs.

## Other responses

- `400`: Failed due to missing or malformed data. Verify that all parameters are complete.
- `401`: Failed because you do not have administrator permissions.
- `403`: Failed to validate because you do not have access to the server.
- `404`: Failed to find specified tenant.
- `429`: Too many requests.

---

[API](https://skmtc.dev/macrometa/apis/macrometa-api-reference.md) - [All operations](https://skmtc.dev/macrometa/apis/macrometa-api-reference/llms.txt) - [OpenAPI document](https://skmtc.dev/macrometa/apis/macrometa-api-reference/revisions/2006b6d7f31d?raw)
