Aqueduct supports different types of price functions. These can be used individually or combined to express more complex business models in a price model. You can create price models using the API or the Aqueduct dashboard.
Variables for a price function can either be fixed, or "allow dynamic values", which allows you to set new values at subscription creation time, along with minimum/maximum boundaries, instead of fixing the variable values at price model creation time.
Price function type | Variables | Billing calculation | Examples |
---|---|---|---|
per-unit | unitCount : numberrate : number | total = unitCount * rate This function supports prorations. A $30 a month plan that starts halfway through the month and is billed at the end of the month would be charged $15 the first month. | per-unit functions can be used to bill a monthly subscription at $10 per seat for 5 seats. Variables for this example: unitCount: 5 rate: $10.00 billingFrequency: monthly |
percentage | amount : number | output of another price functionpercent : number | total = amount * percent This function can use a specified amount or the output for other pricing functions. | Percent functions can be used to represent a 50% discount on the first month Variables for this example: amount: Sum of all other price functions. percent: 50 |
tiered-per-unit-meter | meter : string, refers to the event name that you're using for this metertiers : List of {tierCutoff: number rate: number } billable event associated with this meter are: eventName : stringcustomerId: string data : {count: number } | Sums the numbers of events that falls under each tier by that tier's rate. For example: 90 events with tier 0-25 = $5 25-50=$4 50-100=$3 25 5 = 125 (for 0-25 events) 25 4 = 100 (for 26-50 events) 40 * 3 = 120 (for 51-90) Total = $225 (from adding up all tiers 125 + 100 + 120) | Per unit meter is used to represent a service provider that charges $100 per hour and provided 20 hours of work. Variables for this example: meter: hourly_work_cody tiers: { rate: $100 } eventName: hourly_work_code (the event name and meter name must match) data: { count: 20 } |