Price a Usage change before applying it
quote_usage_changeEstimate the cost of a usage change before applying it. Check if the change is allowed and get current charges plus next-term recurring cost, then show the amount to the customer for confirmation.
Instructions
Prices an intended Usage change without applying it, and checks that it is allowed: what the customer would be charged now, and, with next_term, what their recurring cost would become. Read-only -- nothing is written. Call it before add_feature_consumption, set_feature_current_quantity or set_feature_enabled whenever the change is billable, and show the amount to the end customer for confirmation before the write. Pass exactly one of increment, quantity_current or is_enabled, matching the Feature's type.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| increment | No | Quantity that would be added, for a Consumption or Limitation Feature. | |
| next_term | No | Also return the estimated recurring cost for the next billing period. | |
| date_stamp | No | When the change happened, ISO 8601 in UTC. Defaults to now. A future date is not supported. | |
| is_enabled | No | State it would be set to, for an OnOff Feature. | |
| feature_ref | Yes | Shared reference of the Feature (ReferenceFeature). | |
| customer_ref | Yes | Shared reference of the customer. | |
| subscription_id | No | Which subscription the Usage belongs to. Needed when the customer has several running. | |
| quantity_current | No | Absolute quantity it would be set to, for a Limitation Feature. |