ChargebeeAPI

Create a usage

Idempotency Supported
Try in API Explorer

Creates a usage record for an item price in a subscription. The item price must belong to a metered item.

Max Usages

The maximum number of usages that can be recorded for the entire lifetime of a subscription is 5000. Contact Support if you want this limit to be increased for your site.

Sample Request

URL Format

POST https://[site].chargebee.com/api/v2/subscriptions/{subscription-id}/usages

Input Parameters

id
optional, string, max chars=100

A unique and immutable id for the usage. If not provided, it is autogenerated.

item_price_id
required, string, max chars=100

The id of the item price to which this usage belongs. The item price must be a part of the subscription or should have been part of it historically.

quantity
required, string, max chars=40

The quantity specified for this usage record.

usage_date
required, timestamp(UTC) in seconds

The time at which this usage occurred. Chargebee bills only those usages whose usage_date falls within a time when the subscription status was active or non_renewing. However, the remaining usage records are still stored and are retrievable.

Note: If usage_date corresponds to a time already invoiced, then it is stored but never invoiced unless the invoice is regenerated .

note
optional, string, max chars=500

A note for this usage record. This note is not displayed on any customer-facing document or interface such as invoice PDFs or Hosted Pages .

Returns

usageUsage object

Resource object representing usage