Introducing the Better Auth Chargebee plugin: Use it to handle subscriptions, billing, and auth seamlessly.
Chargebeechargebee API

List grant blocks

Returns a list of grant blocks meeting all the conditions specified in the filter parameters below.

Sample Request

Sample Result[JSON]

URL Format

GET https://[site].chargebee.com/api/v2/grant_blocks

Input Parameters

limit
optional, integer, default=10, min=1, max=100

Specifies the maximum number of resources to return per page.

Default and Hard Cap

  • Optional parameter; if omitted, a server-defined default is applied.
  • Values exceeding the server's maximum limit are capped (clamped) to the allowed maximum.

Example → limit = "50"

offset
optional, string, max chars=1000

Opaque cursor indicating the current position in the result set for pagination.

Behavior

  • To fetch the next page, pass the next_offset value returned in the previous response.
  • The value is opaque and must not be parsed, modified, or constructed manually.

Example → offset = "["1771176208000","96000000006"]"

sort_by[<sort-order>]
optional, object

optional, string filter

Specifies the field used to sort the result set.

Supported attributes

  • created_at
  • effective_from
  • expires_at

Sort Order

  • asc (ascending order)
  • desc (descending order)

Example → sort_by[desc] = "effective_from"

This sorts grant blocks by effective_from in descending order (latest effective time first).

Filter Params

For operator usages, see the Pagination and Filtering section.
subscription_id[<operator>]

required, string filter

Filters results by subscription identifier. This is the subscription whose grant blocks you are listing.

Supported operators : is

Example → subscription_id[is] = "1mGETgZVF2umUZq"

Supported operators: is
unit_id[<operator>]

optional, string filter

Filters results by unit identifier. For example, a credit unit id such as ai_credits.

Supported operators : is

Example → unit_id[is] = "ai_credits"

Supported operators: is
effective_from[<operator>]

optional, timestamp(UTC) in seconds filter

Filter by when blocks become effective (effective_from).

Supported operators : after, before, on, between (per List operations).

Example → effective_from[after] = "1765283483"

Supported operators: after, before, on, between
expires_at[<operator>]

optional, timestamp(UTC) in seconds filter

Filter by grant expiry (expires_at).

Supported operators : after, before, on, between (per List operations).

Example → expires_at[before] = "2863729974"

Supported operators: after, before, on, between
created_at[<operator>]

optional, timestamp(UTC) in seconds filter

Filter by when the grant block was persisted (created_at).

Supported operators : after, before, on, between.

Example → created_at[between] = "[1771175750, 1771175800]"

Supported operators: after, before, on, between

Returns

next_offset
optional, string, max chars=1000

This attribute is returned only if more resources are present. To fetch the next set of resources use this value for the input parameter offset.

Grant block object
Resource object representing grant_block