Hi HN,
We've put together a framework showing how to build an on-demand billing system similar to AWS', with charges calculated according to the region and type of instance selected by the customer.
It is suitable for companies for which a billable metric can have multiple prices based on its properties, such as cloud computing platforms (see below) and identity verification platforms (e.g. $2 for a bank verification and 3$ for a document verification).
It uses Lago's API and UI, which is open-sourced (AGPLv3) https://github.com/getlago/lago