Link
✎

How do I implement usage-based billing or metering?

Question

I want to charge per API call or per processed document. Can NetLicensing meter usage?

Answer

Yes, that’s the Pay-per-Use model. Customers buy credit packs (QUANTITY license templates, say 1,000 credits each). When your application validates, it reports what was used, either afterwards with usedQuantity (post-payment) or upfront with reserveQuantity (pre-payment). NetLicensing sends back remainingQuantity, and when that reaches zero, valid turns false and the customer buys more.

What one credit means is your call. Report usage in batches rather than unit by unit, and keep unreported usage on your side until the call goes through, so nothing gets lost.

For limits that don’t get used up, like seats or storage, Quota is the better fit. There’s more in Usage-Based Software Licensing.

Last updated · Edit this page on GitHub