Introducing the Chargebee CLI

Retrieve usages for an invoice as PDF

Open in Postman

Advanced Usage-Based Billing

For high-scale usage ingestion, use Advanced Usage-Based Billing with the Usage Events API. The Usage Events API supports schemaless event ingestion at scale, including individual events, batch ingestion, and usage file ingestion.

Retrieves usages record for an invoice in PDF file format. This endpoint is part of the Usages API for Automated Metered Billing.

For Usage-Based Billing invoices, you can optionally group a metered feature's usage by its configured group-by attributes. Automated Metered Billing continues to render the existing ungrouped usage PDF.

Availability

Support for adding GROUP BY to metered features and retrieving usage grouped by attributes is an upcoming capability and is not generally available yet. It will be made available in the coming weeks.

Use Cases

Sample Request

Open in Postman

Sample Result[JSON]

URL Format

POST https://[site].chargebee.com/api/v2/usages/pdf

Input Parameters

disposition_type
optional, enumerated string, default=attachment

Determines the pdf should be rendered as inline or attachment in the browser.

Enum Values
attachment

PDF is rendered as attachment in the browser

inline

PDF is rendered as inline in the browser

invoice
Parameters for invoice
pass parameters as invoice[<param name>]
group_by[0..n]
Parameters for group_by. Multiple group_by can be passed by specifying unique indices.
pass parameters as group_by[<param name>][<idx:0..n>]

Returns

Download object

Resource object representing download