Billable Dimensions
Properties to calculate the cost of a product or service.
Price Model
Basic pricing
In a basic price model, each unit of a product or service is assigned a fixed cost.
For example, consider a company offering cloud storage services at a rate of $0.5 per gigabyte (GB).
In this scenario, the unit amount
is set to $0.5, indicating that each GB costs $0.5.
For 10 units, 10 x 0.5(unit amount) = 5
, $5 in total.
Tierd pricing
In tiered pricing, the cost of a given unit depends on the tier range that it falls into, defined by upper and lower bounds.
For example, the first 5 GB costs $0.5 each, 6-10 GB costs $0.3 each, and all subsequent GBs cost $0.2 each.
Tier Range (GB) | Price per GB ($) |
---|---|
1 - 5 | $0.5 |
6 - 10 | $0.3 |
11+ | $0.2 |
For 4 units, 4 x 0.5 = 2
, $2 in total.
For 8 units, 5 x 0.5 + 3 x 0.3 = 3.4
, $3.4 in total.
For 15 units, 5 x 0.5 + 5 * 0.3 + 5 * 0.2 = 5
, $5 in total.
Bulk pricing
In bulk pricing, units are billed in predefined bundles (bulk sizes).
For example, if the bulk size is 5, then 4 units will be billed as 5 and 6 units will be billed at 10.
For 4 units: 1 bulk x 5 (bulk amount) = $5
, $5 in total.
For 6 units: 2 bulks x 5 (bulk amount) = $10
, $10 in total.
Bulk Size | Bulk Amount |
---|---|
5 | $5 |
Volume pricing
In volume pricing, the total number of units determines the cost per unit for all units.
For example, if you've bought 8 units, total price will be 8 x 0.5(unit price) + 5(flat fee) = 9
, $9 in total.
Once you've bought more than 10 units, say 15 units, the total price will be
15 x 0.4(unit price) + 0.0(flat fee) = 6
, $6 in total.
Number of Units | Price per Unit ($) | Flat Fee ($) |
---|---|---|
1 - 10 | $0.50 | $5.00 |
11+ | $0.40 | $0.00 |
Percentage pricing
Percentage pricing applies a per-event rate (e.g., per-payment) expressed as a percentage of the transaction value. For example, if the price is set as following
Percentage rate | Flat Fee ($) |
---|---|
0.25 | $3.00 |
For a payment of $100, the charge will be
100 x 0.25(percentage rate) + 3(flat fee) = 27
, $27 in total.
Tiered percentage pricing
Tiered percentage pricing applies when a per-event (e.g., per-payment) rate is expressed as a percentage of the transaction value with several tiers.
For example, if the price is set as following
Number of Units | Percentage rate | Flat Fee ($) |
---|---|---|
1 - 10 | 0.25 | $3.00 |
11+ | 0.2 | $1.00 |
For a payment of 9, the charge will be 9 x 0.25(percentage rate) + 3(flat fee) = 5.25
, $5.25 in total.
For a payment of 20, the charge will be 10 x 0.25(percentage rate) + 3(flat fee) + 10 x 0.20(percentage rate) + 1(flat fee) = 8.5
, $8.5 in total.
Matrix pricing
In matrix pricing, the cost depends on combinations of two or more properties.
For example, if the price is set as following
Property 1 | Property 2 | Price per Unit ($) |
---|---|---|
partner = aws | region = us-east-1 | $0.5 |
partner = aws | region = us-west-1 | $0.3 |
partner = gcp | $0.4 |
Default price: $0.2
E2E Testing Plan
- Basic pricing
price := PriceModelBasic{
UnitAmount: 0.5
}
- With Count metric
- Tiered pricing
price := PriceModelTiered{
Tiers: []PriceModelTieredConfig{
{
FirstUnit: 1,
LastUnit: 1000,
UnitAmount: 0.5
},
{
FirstUnit: 1001,
LastUnit: 2000,
UnitAmount: 0.3
},
{
FirstUnit: 2001,
LastUnit: 0,
UnitAmount: 0.2
}
}
}
- With Unique Count metric
- Bulk pricing
price := PriceModelBulk{
BulkSize: 1000,
BulkAmount: 0.5
}
- With Sum metric
- Volume pricing
price := PriceModelVolume{
Volume: []PriceModelVolumeConfig{
{
FirstUnit: 1,
LastUnit: 1000,
UnitAmount: 0.5
},
{
FirstUnit: 1001,
LastUnit: 0,
UnitAmount: 0.4
}
},
}
- With Max metric
- Percentage pricing
price := PriceModelPercentage{
PercentageRate: 0.05
FlatFee: 0.3
}
- With Latest metric
- Tiered percentage pricing
price := []PriceModelTieredPercentageConfig{
{
PercentageRate: 0.05,
FirstUnit: 1,
LastUnit: 1000
},
{
PercentageRate: 0.01
FirstUnit: 1001,
LastUnit: 0
}
}
- With Count metric
- Matrix pricing
price := PriceModelMatrix{
DefaultUnitAmount: 0.2,
Prices: []PriceModelMatrixConfig{
{
Properties: [{
Name: "partner",
Value: "gcp"
}],
UnitAmount: 0.4
},
{
Properties: [{
Name: "partner",
Value: "aws"
Name: "region",
Value: "us-east-1"
}],
UnitAmount: 0.5
},
{
Properties: [{
Name: "partner",
Value: "aws"
Name: "region",
Value: "us-west-1"
}],
UnitAmount: 0.3
}
}
}
- With SUM metric