UsageGraduated
Usage priced on tiers, graduated: the period's total quantity is split across the tiers, each part at its tier's price.
Example: pages up to 1,000 at 5 (USD 0.05), up to 10,000 at 3, then 1. 4,800 pages cost 1,000 × 0.05 + 3,800 × 0.03 = USD 164.00.
- pricing
Type const:UsageGraduatedrequiredThe pricing type. It decides the charge's other fields and how it bills.
- billingType: enum
Frequency How often the charge is billed: every 1, 3, 6 or 12 months, or with
CustomeverybillingFrequencyCustomMonthsmonths. Amounts (the price, credit benefits) are per billing period: a quarterly fee is charged once a quarter.valuesMonthlyQuarterlySemi-AnnuallyAnnualCustom - billingType: integer
Frequency Custom Months min:1With
billingFrequency: Custom, the length of the billing period in months. - billingType: enum
Type When each period is billed.
Advance: at the start of the period, for the period ahead.Arrears: at the end, for the period just ended. Usage charges, and the overage of seats that come with credits, are always billed in arrears. Default:Arrearsfor usage charges,Advancefor the rest.valuesAdvanceArrears - charge
Type const:usageread-onlySet by Spondo Billing from
pricingType: the kind of charge. Returned, never sent. - eventType: string
Name The signal event name this charge counts. Every signal sent with this
eventNameadds to the charge. Required unless the charge names ameterId. - meterType: string
Id A meter of the charge's product (
mtr_…) to bill in place ofeventName: each signal counts its quantity on the meter. SendeventNameormeterId, not both. A charge on a meter takes nopricingInput: the meter says what each signal counts. - priceType:
Points Properties: 6One price point per currency. An order uses the one in its currency, else the first. Each carries the tiers the period's quantity is priced on.
- pricingType:
Input Properties: 1Where a charge that counts signals reads each signal's quantity. Without it, a signal counts the number in
data.quantity, else 1. There is no formula language: the quantity is one number read from the signal. It is read once, when the signal arrives, with thepricingInputof a charge on the customer's active orders that prices its event. - pricing
Model const:graduatedPricingread-onlySet by Spondo Billing from
pricingType: how the charge is priced. Returned, never sent. - signalType: enum
Type What a usage charge bills for:
activity(work done) oroutcome(a result delivered, such as a resolved ticket). Both bill the same way; it labels the charge.valuesactivityoutcome
{
"pricingType": "UsageGraduated",
"eventName": "document_uploaded",
"pricingInput": {
"path": "pages"
},
"billingFrequency": "Monthly",
"billingType": "Arrears",
"pricePoints": [
{
"currency": "USD",
"unitPrice": 0,
"tiers": [
{
"upperBound": 1000,
"unitAmount": 5
},
{
"upperBound": 10000,
"unitAmount": 3
},
{
"upperBound": null,
"unitAmount": 1
}
]
}
]
}