#jco_best-practices
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1405504378399621240
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- jco_code, 5 days ago, 8 messages
But this would be weird as it would heavily restrict them from getting it for another server
Can you elaborate more here? Not sure I understand the context here
different tenants on their account
Not sure how this models in Stripe either
As i understand the docs, if i have two plans "server ai" and "server pro", when the user subscribes to say "server pro" on server a, they cannot subscribe to it again on server b.
No, that's not true. You can model that quite easily in a couple of ways:
- Increment the quantity of the 'Server AI' item on the sub to reflect
nservers (e.g.quantity: 2) - Have multiple concurrent subscriptions for the same customer, one for each server
That sounds simple enough, but would it not mean they are all billed on the same date? Meaning a user might end up paying twice for the same server?
And how would I record on stripe the server IDs so that the webhook accurately sends the data to the backend?
but would it not mean they are all billed on the same date? Meaning a user might end up paying twice for the same server?
Yes, if you use thequantity: nmodel
And how would I record on stripe the sever IDs so that the webhook accurately sends the data to the backend?
You could leverage metadata on the line item: https://docs.stripe.com/api/subscriptions/create#create_subscription-items-metadata
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Obviously that way you'd need n items per server
Is there a way to do this, without relying on the quantity, to prevent the chance that a user pays twice for a server?
I dont want a user paying say $5 for a server on the 1st of the month and then adds another for another $5 on the 20th, then on the 1st of the next month they have to pay for both servers, of end up getting 20 days free for the first server as it makes them pay for both on the 20th of the next month.
Then you'd likely need to model it as multiple subscriptions
I see, so make a new product per server?
Why would you need a new product? Your product catalog should model the plans your offer inside your service (e.g. 'Server AI', 'Server Pro'). They don't need to be unique for every customer/server
(I'm also testing something else in parallel)
Oh so how would I model it as multiple subscriptions?
Is that what you are testing?
No something else: https://docs.stripe.com/billing/subscriptions/mixed-interval
Well a cus_xxx can have multiple concurrent subscriptions. So in your hypothetical scenario cus_abc can have sub_123 that is subscribed to 'Server AI' for server X and sub_456 that is subscribed to 'Server Pro' for server Y
They can be billed separately, accordingly to the billing intervals
Of course that is assuming I understand your product model
The cus_abc has server a, b and c. They want to upgrade them all to pro. But they added pro to server a on the 1st, b and c on the 20th for example.
I am trying to handle that situation so that they can add the same product tier to multiple servers on the dashboard, allowing for their servers to have the same perks etc, but maintain the monthly billing cycle for each server individually, meaning they dont get a unified bill, and can manage each server plan individually etc.
I dont think mixed interval would work for that, looking at it... As I cannot see a way to start this using a checkout session
Yeah it doesn't work on Checkout today so unfortunately multiple subs is your only options
So how would I do that? New product per server or just a new subscription and add the metadata to the lineitem on creation?
The latter
I don't see why you'd need a new Product/Price per server unless I'm misunderstanding
OK, and would each sub for say server pro, on different servers, be billed individually on the day it was created each month?
I am just trying to understand how to let a customer subscribe to the pro tier on multiple servers, and not have unified billing. Using a checkout session.
Yes each subscription would have a unique billing date according to when it was started
Ok as long as that works properly, I think I would have to make an automated cancel sub button on my site, instead of relying on the billing portal as it would just show as multiple of the same subscription based on testing.
Yes exactly