Create metered usage record

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

This endpoint allows you to create a usage record for a subscription usage-based billing product. Use this to report the actual consumption.

Usage Reporting

When creating a usage record, you need to specify:

  1. The subscription ID
  2. The usage-based billing product ID
  3. The number of consumed units

Response

Upon successful creation, the API response will include the ID of the created usage record. This ID can be used to update the status of the record between active and inactive if needed.

Special Considerations for Percentage and Percentage-step Models

For pricing models based on percentages (percentage and percentage-step), there are special considerations:

  • Unit ranges and consumed units represent monetary values in their smallest denomination (e.g., cents, øre)
  • The platform supports currencies with up to three decimal places (e.g., BHD, JOD, KWD, OMR, and TND)

Important Note on Currency Precision

When using currencies with three decimal places:

  • Amounts must be rounded to the nearest ten units of the smallest denomination
  • A value of 10,234.254 TND should be rounded to either 10,234.25 or 10,234.26
  • These values should then be converted to their smallest denomination: 1023425 or 1023426

Ensure that you report the correctly rounded and converted values when using these pricing models.

Related Endpoints

Path Params
string
required

Subscription handle

string
required

Usage-based billing handle

Body Params
int64
required
> 0

Number of units to record for the usage-based billing product.

string

Date the merchant selected as the usage record date.

string

Inclusive start of the usage service period in the subscription timezone. Must be sent together with period_to.

string

Inclusive end of the usage service period in the subscription timezone. Must be sent together with period_from.

string

Defines the pricing strategy for the usage-based billing product. Accepted values are: fixed or flexible. fixed - The subscription's usage-based billing product will not reflect any price changes applied to the base usage-based billing product. flexible - The subscription's usage-based billing product will dynamically reflect all price changes applied to the base usage-based billing product. This parameter is required if the 'Auto-add to Subscription on Usage' feature is enabled for the usage-based billing product.

string

Optional idempotency key scoped to the subscription metered billing product. Submitting the same handle again returns the existing record instead of creating a duplicate. Allowed characters: a-z, A-Z, 0-9, _, ., -, @

Responses

Language
Credentials
Basic
base64
:
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json