#b33fb0n3_docs
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/1402945915072811041
๐ 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.
- b33fb0n3_best-practices, 3 days ago, 17 messages
hi there!
hey ๐
for what do you need help specifically? creating the Subscription? reporting usage? something else?
The overview about it. Like I would like to bill my clients based on usage. I am currently working on a backend. Right now every signed in person can just use it. However, they should pay based on their requests.
So currently for me its clear to have:
- A product as subscription
- The counter
So I know what I need, but I dont know the overall view on how to integrate. There are a lot of pages inside the docs, but no template or similar, where I can look into code. Code is here the important part for me.
I would also like to provide my customer a "free usage". Like: the first X events are free. I also dont know how to do that
I would also like to use payment element inside my integration later. Normally I just handle that with payment intents. I assume that does not work here as its a subscription, right?
have your ead this doc? it should be a good starting point: https://docs.stripe.com/billing/subscriptions/usage-based/implementation-guide?dashboard-or-api=api
Ah thanks, yea, thats the overview I was looking for.
What do you think about the following points:
- I would also like to provide my customer a "free usage". Like: the first X events are free. I also dont know how to do that
- I would also like to use payment element inside my integration later. Normally I just handle that with payment intents. I assume that does not work here as its a subscription, right?
I would also like to provide my customer a "free usage". Like: the first X events are free. I also dont know how to do that
we call this billing credits: https://docs.stripe.com/billing/subscriptions/usage-based/billing-credits/implementation-guide
I would also like to use payment element inside my integration later. Normally I just handle that with payment intents. I assume that does not work here as its a subscription, right?
it would be very similar. instead of directly creating a PaymentIntent, use the PaymentIntent that is created by the Subscription.
so when creating the Subscription, add expand: ['latest_invoice.confirmation_secret'], and then use the client secret to mount the Payment Element.
My customer can create multiple tokens. With each token they can make request against the API. All of the tokens count towards the user, but I assume it would be great for him to see the counts for each token on his one billing. How can I do that?
and when do I create the subscription? Can I even create it without the user notice?
Like:
Sign up: Stripe customer gets created and ID saved in DB
Login: Stripe customer ID set into JWT
Token creation: ???
When the user loads the subscription page? When the user creates a token? When what happens?
My customer can create multiple tokens. With each token they can make request against the API. All of the tokens count towards the user, but I assume it would be great for him to see the counts for each token on his one billing. How can I do that?
you want to retrive usage for a given customer? if so, the doc link I shared earlier has a section about this at the bottom of the page
and when do I create the subscription? Can I even create it without the user notice?
well, that's completely up to you. a common flow if to first create the subscription and collect a payment method. once that's done, give the customer access to your services.
More like: when the customer receives his bill, like his invoice for the subscription I assume its something like:
Product X 123 * 0,25 $ 30,75 $
But what about something like:
Token "X" 123 * 0,25 $ 30,75 $
Token "Y" 157 * 0,25 $ ... $
Token "Z" 227 * 0,25 $ ... $
Then the subscription would have 3 prices, each price with its own meter.
so the user enteres the subscription page, then a request is made to my backend that creates the subscription via stripe and it returns the payment intent secret and ID back to the customer, so he can pay it via payment elements, right?
If he refresh the page, a new subscription will be created and the first one will never be fulfilled, right?
that's the simplest option yes. but you could also:
- reuse the same subscription instead of creating a new one
- or use our new flow where you can mount the Payment Element without having a PaymentIntent/Subscriptions, this is explained here: https://docs.stripe.com/payments/accept-a-payment-deferred?platform=web&type=subscription
so each token that is created will receive its own price even if its always the same price?
And the customer at the end will receive one billing, right? Not for each one, right?
So when I have 10 customers and each create 3 tokens, then a total of 30 objects exists, that do all the same just a different counter, right?