Proration
prorationCompute a prorated charge or refund for a partial billing period. PREMIUM (license).
Typical input {"amount_per_period": 90, "days_used": 10, "days_in_period": 30} returns {"days_used": 10, "days_in_period": 30, "prorated_charge": 30.0, "prorated_refund": 60.0, "answer": 30.0}.
Use when a plan starts, ends, or changes mid-period. Not for splitting a full amount into scheduled payments (installment_plan). Errors: on invalid, missing, or malformed input this tool never raises a protocol error — it returns {"error": ""} (for example {"error": "need amount > 0 and 0 <= days_used <= days_in_period"}). Every call is read-only and idempotent, so after correcting the input it is always safe to retry.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days_used | Yes | Days of the period consumed; 0 to days_in_period. | |
| refund_mode | No | If true, "answer" is the refund amount instead of the charge. Default false. | |
| days_in_period | No | Length of the billing period in days; at least 1. Default 30. | |
| amount_per_period | Yes | Full-period price; must be greater than 0. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||