younifyd
Menu

Retrieve Usage Charges For A Subscription

Retrieve usage charges for a subscription

GET/subscriptions/{subscription-id}/usage_charges

Use it in a workflow

  1. Add a step and choose the Chargebee connector.
  2. Pick the Retrieve Usage Charges For A Subscription action (under Chargebee API).
  3. Fill in the fields below, then reference the result from later steps as {{retrieveUsageChargesForASubscription.response.data}}.

Request

Path parameters

subscription-idstringrequired

Query parameters

limitinteger (int32)

The number of resources to be returned.

Default 10

offsetstring

<p class="mb-2">Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">offset</code> to the value of <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">next_offset</code> obtained in the previous iteration of the API call.</p>

feature_idobject

optional, string filter Unique identifier of the metered [feature](/docs/api/features/feature-object#id) for which usage is tracked. **Supported operators :** is **Example →** *feature_id\[is\] = "fea-user-licenses"*

isstring

Headers

chargebee-request-origin-devicestring

The device from which the customer has made the request

chargebee-request-origin-userstring (email)

The email address of your customer/user. Use this when the email address has only ASCII characters.

chargebee-request-origin-user-encodedstring (email)

The Base64-encoded email address of your customer/user. Use this if the email address has UTF-8 characters. When this header is provided, the header chargebee-request-origin-user is ignored.

chargebee-request-origin-ipstring

The IP address of the customer where the request originated

chargebee-business-entity-idstring

If the site has multiple business entities, you can use this custom HTTP header to specify the business entity for which Chargebee should perform the operation.

Response

Returns 200 with an object. Read it in later steps with {{retrieveUsageChargesForASubscription.response.data.<field>}}.

listarray<object>
usage_chargeobjectrequired10 fields

<div class="api-description"><p class="mb-2">Usage charge represents the current, unbilled usage for a metered feature in a subscription within its active usage period. Each usage charge reflects usage accumulated from the start of the current usage period up to the time of the request. It includes:</p><ul class="list-disc list-outside ml-6 my-4 space-y-2"> <li class="text-base leading-relaxed">the metered feature (<code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">feature_id</code>)</li> <li class="text-base leading-relaxed">the included entitlement for the current period (<code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">included_usage</code>)</li> <li class="text-base leading-relaxed">the total usage recorded so far (<code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">total_usage</code>)</li> <li class="text-base leading-relaxed">any chargeable usage beyond the included entitlement, including on-demand usage and amount (<code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">on_demand_usage</code>, <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">metered_item_price_id</code>, <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">amount</code>)</li> <li class="text-base leading-relaxed">the usage interval (<code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">usage_from</code>, <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">usage_to</code>) used to compute the usage</li> </ul></div>

next_offsetstring

<p class="mb-2">This attribute is returned only if more resources are present. To fetch the next set of resources use this value for the input parameter <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">offset</code>.</p>

json
{
  "list": null,
  "next_offset": null
}

Need more? See the Chargebee guide for connection setup and behaviour shared by every action.