In this topic:

How to add a usage rule to a service?

The Billing API provides a way to add a new usage rule to the service after the order has been created. For adding a usage rule, use one of the provided templates depending on the needed usage rule specification, type, and rule type.

With the Billing API, you can retrieve existing usage rules on a service, create a new rule, update, and delete the desired usage rule.

Adding a usage rule on a service

Here you can find examples of how to add the following usage rules to a service. This list of examples is not exhaustive and should be used as a general guideline rather than index of all possible configurations.


Retrieving usage rules on a service

Use this endpoint to retrieve the specified usage rule:

GET https://examples.gotransverse.com/billing/2/services/{service_id}
/recurring-price/usage-rules/{id}

Use this endpoint to retrieve all existing usage rules on the service:

GET https://examples.gotransverse.com/billing/2/services/{service_id}
/recurring-price/usage-rules

Updating a usage rule on a service

To update the desired usage rule use the following endpoint and specify the parameters that you want to update in the request body:

PUT https://examples.gotransverse.com/billing/2/services/{service_id}
/recurring-price/usage-rules/{id}

Deleting a usage rule on a service

To delete the usage rule that you no longer need, use the following endpoint:

DELETE https://examples.gotransverse.com/billing/2/services/{service_id}
/recurring-price/usage-rules/{id}

Top