How to add a usage rule to an order item

When creating an order, you can add a new usage rule to the order item. In the request body, indicate the type of usage rule that you want add, its specification, allowance, rate, and charge category.

Note: In the payload for creating an order, the usage_rules entity is placed within order_item_prices.

Likewise, the Gotransverse Billing API provides a way to add usage rules to order items and retrieve the existing ones.

Retrieving usage rules on order items

You can retrieve existing usage rules available on order items by IDs.

Use this endpoint to retrieve all usage rules associated with a given order item:

GET https://example.gotransverse.com/billing/2/order-items/{order_item_id}/recurring-price/usage-rules

Use this endpoint to retrieve a specified usage rule associated with a given order item:

GET https://example.gotransverse.com/billing/2/order-items/{order_item_id}/recurring-price/usage-rules/{id}

Adding usage rules to order items

Here you can find examples of how to add the common usage rule types to order items. This list of examples is not exhaustive and should be used as a general guideline rather than index of all possible configurations.

Note: For details and parameter definitions, refer to the Usage rule templates or Billing API Reference documentation.