Hey Manuel,
You’ve got a number of problems here to solve;
- Storing minutes remaining per user
- Tracking top-up purchases, and associating that with a user
- Logging the usage history, and account legder of +/- minutes transactions
- Possibly displaying that usage history to a user
If you’re OK just displaying the that number Pietro’s suggestion to store it in a custom user field is a good one, however currently I think it can only bound to an editable input field on the User Account screen, which means your users (1) can ONLY see the number there, and (2) they can edit it, by default.
To overcome that, you can hide that editable field, and then write some script to take the contents of that field and display the number as non-editable text.
You can edit / update the values in those custom fields in the designer, so, so far, you don’t need the API for anything to accomplish this.
If you want to display a ledger, and a summary total, the approach the easiest approach I’ve found on internal sites is to create a Google Sheet for each user to track their info, and then store that readonly sheet URL in the user custom field.
Then, you can pull the contents of that sheet ( or a summary tab, and display it as a table, along with that total amount, and no one can edit the sheet data or minutes remaining except you.
That gets you about 90% of the way there, with the obvious gap being that you have to watch for new orders, and manually add those top-up purchases into the right spreadsheet, for the right person.
These are the Webflow features you want in order for this to be better integrated, so keep an eye out for them in coming months. Hopefully we’ll see them emerging;
- The ability for ECommerce to capture the currently-logged-in UserID on a purchase.
- The ability to easily retrieve User custom field data with script
- The ability to bind User custom field data to element in the same way you can do CMS binding, so that you can e.g. have a readonly “Minutes remaining” appear at the top of every page when a user is logged in.