How to set limitation of the queries for a member? Answered
Hi,guys.
I am planning to make a SAAS. It can provide data query service for several different levels of users (e.g. similarweb.com).
There are 3 different subscription plans:
1. Free plan.
2. Paid plan: there is a fixed amount of usage.
3.Enterprise plan: no usage quota.
There are the following query limits:
1. The number of queries per day for a single user.
For example, free users can only query a maximum of 100 times per day.
2. The number of inquiries a single user can make within a fixed number of days.
For example, a free user can get up to 3,000 queries within 30 days, a paid user can get 10,000 queries, and a higher level corporate user can get unlimited queries.
3. When the user's usage quota is exhausted within a specified period of time, he/she can purchase additional points to get more queries. There is no time limit on the use of these additional points.
I'm a product designer with Python skills but not familiar with JavaScript. i've watched tons of videos on the official YouTube channel these days, but still don't know how to do this using member stack.
I also spent a lot of time asking Rey but it gave two different solutions.
1. create a custom field query_remaining for each plan. then use the query_remaining field to record the number of times the user has used it. Update this field each time the user queries the data.
2. use something like AWS API Gateway to do this. Unfortunately, I don't have experience in using this.
I'm wondering if memberstack's current product features will meet my needs? Or is there an easy way to do this.
Appreciate for your help.
Comments
1 comment
I like Reybots first solution. You can store the number of remaining queries in a custom fields. You can also use JSON or Metadata. Link to learn more about all three. https://docs.memberstack.com/hc/en-us/articles/7389627062299-Custom-Fields-vs-Metadata-vs-JSON
Please sign in to leave a comment.