#melchncookie-subscriptions
1 messages · Page 1 of 1 (latest)
What are you actually trying to accomplish here?
do you really want to restrict signups like you asked, or are you trying to solve the issue of multiple submissions on the button click?
Not allowing a user to have 4 identical monthly subscriptions on their account. I was wondering if there is a way stripe would return an error when we try to create an identical subscription or if I should build in an additional stripe subscription check on my side
Yea, you'd need to build this logic on your end if you actually want to prevent that. for example, would you want to block the user if they came back the next day and did the same thing to sign up again?
eg, its not a double click scenario: what result do you want?
That makes sense, the goal would be to return an error to our user if they found themselves in this use case. Since my system only tracks one subscription Id. If they cancel the subscription from my system it will only cancel one of them
Gotcha - then in that case yes you'd want to apply some logic in your application to check this. You can either record something in the customer metadata, or refer to the existence of subscriptions by retrieving subscriptions belonging to that customer
Thanks for the help! One last question, is there any special way to run automated scripts that don't interfere with the rates from user events, or is it up to my script to slow down so it doesn't rate limit the site? I remember seeing an article about it somewhere but I don't fully remember
Yea you need to b careful to throttle your requests - don't unleash a script without adding some pacing to it.
You can read about rate limits here: https://stripe.com/docs/rate-limits#common-causes-and-mitigations
And in this video my colleague shows how you can self-limit to throttle batched requests: https://www.youtube.com/watch?v=gx1xxGv2Ljs (see around 20min mark)