#muhammad-talha-zubair_api
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/1332056919317282898
📝 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.
- muhammad-talha-zubair_api, 1 day ago, 15 messages
Just to explain things in detail a bit.
I am implementing a system for my web application
In which user can pay the amount in one go. Or user can choose to pay in 6 months.
I checked the docs for the schedule subsctription. I think that can work in my case
But the problem i am facing that i cannot identify the flow for it.
That can handle both the scenario
Pay as one full amount or Pay in x months where total amount is splitted in each months.
And also i would need to save the information in my database as well.
To track the webhook details...
Hello I’m trying to create my account
@hollow umbra looks like you're in the wrong place, this thread is for someone else's question.
- If you have your own thread please chat there.
- If you have a question or a followup to a closed thread use one of the buttons in https://discord.com/channels/841573134531821608/842637025524842496 to get help (we don't reopen closed threads).
Note that posting inappropriate messages in other people's threads is against the rules. No worries if this was just an honest mistake, but anyone who violates the rules multiple times will be removed from this server.
Ok is there a way you can help me
@dusty pivot I'll be with you in one moment!
sure
@hollow umbra No, please stop talking in this thread. If you continue I will have to remove you from the server.
@hollow umbra Please follow the instructions in the message above.
@dusty pivot We have a guide for using Subscription Schedules for installment payments here, which I think might be what you're looking for? https://docs.stripe.com/billing/subscriptions/subscription-schedules/use-cases#installment-plans
Actually @opaque steppe i already checked that
I am having this confusion
that for subscription schedule i will need to create products
but in my website i want to have both the functionality
to pay up front all amount or pay in installements
so in that case. for full payment i don't need to create product? and if user want to pay in the installements then i need to create the product?
or is there any way to create product and for same product i can pay the product in one go and also can pay the product in subscription schedules
It depends on how you're handling the single, one-off payments. If you're just creating a Payment Intent directly for that, then no, a Product isn't required for that approach. But for the Susbcription Schedule approach you do need a Product, yes.
actually i am still planning on how to do that. i was thinking is it possible to use the product in the payment intent as well?
No, if you use Payment Intents directly you can't use a Product. Payment Intents are low-level payment objects and have no concept of things like Products, line items, etc.
There's a short video here that might help clarify how objects are related to each other: https://stripe.com/docs/payments/tour#payment-objects
ok give me some time . let me watch the video
Hi there 👋 I'm jumping in as my teammate needs to step away soon. Please let me know if there are any questions that remain after you go through that video and I'll be happy to help.
yes
Actually as you must have read the previous conversation as well
What should be the optimal solution stripe docs recommend in my case?
That depends on the experience you want to offer. There are multiple approaches to solve this within Stripe.
Should i create products only when the subscription schedule is selected by users.
I actually was thinking what stripe recommends for it.
Whether or not you should create Product objects ahead of time or dynamically will depend on whether your product catalog and pricing is more fixed (the former would likely be better) or more dynamic (the latter would likely be better then). But you'll also need to take into account things like your reporting requirements.
ok. Is there any way in stripe where for both cases i use product?
Weather user wants to pay full amount or subscription schedule. Can we use same product for both type of payments?
Sure, if you create Invoices for your one-time payments. (They'll have to use different Price objects, since Invoices would use one-time Prices and Subscriptions would use recurring Prices. But they can use the same Products).
https://docs.stripe.com/invoicing
let me check
The link you shared does not accept payment automatically. It just send invoice emails.
I think i will go with the first solution that i elaborate before
I will pay payment intent if user wants to pay one full time
and for the installement i can create the product and pay using subscription schedule.
There comes another questions. When i create product i should set the recurring payment or something there?
Or subscription schedule will handle this automatically?
I just create product with name and price
Create a customer
Add payment method to customer
And then pay the product using customer id and his default payment method as subscription schedule.
Your question was about Invoices only being able to accept payments if a link is sent. The Stripe Elements tab in the step that I linked to shows how to use Elements to accept a payment for an Invoice on your own page.
ok. I would prefer the first solution. Can you confirm the flow that i am thinking.
I would strongly recommend reviewing our documentation for Billing, where this flow is explained.
https://docs.stripe.com/billing/subscriptions/overview
You do need to specify that a Price is recurring when you create it. The different supported pricing models are discussed in more detail here:
https://docs.stripe.com/products-prices/pricing-models
Nice. So that means i would only need to create the product and set the price. And when passed to subscriptionSchedule api it will automatically handle that in background to consider it recurring ...
You will explicitly tell us the Price is recurring when you create it, via the recurring hash:
https://docs.stripe.com/api/prices/create#create_price-recurring
ok let me check one thing
I think now i got that.
1- Create product
2- Create price for the product that will be recurring
3- Create customer
4- Create payment method for the customer
5- Pay the customer with the price using the subscriptionSchedule api
These are the steps in total for the implementation.
That's a very simplified version of the flow. Step 4 should either be handled by the first payment for the Subscription, or via a Setup Intent. You likely don't want to be creating Payment Methods directly. But our guides walk through that.
Yeah. Need to send here the simplied version. But i think the right one?
Mhm
And yes about the payment method i will add the card information using stripe elements
on frontend side
and attach the payment methods to customer
and so on
that i already done. no worries on that.
Thanks for the detail answered.
Any time! Glad we could help
There is one question still remaning... if you can answer
Sure?
1- One scenario is product is deleted? Can we do that? Does that delete the price as well? And does that affect the existing subscription?
2- Second scenario is product details with price is updated? I think in that case a new price is created. and we pay the customer using that new price id?
You can't delete a Product if it has any Prices associated with it.
Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good is only possible if it has no SKUs associated with it.
https://docs.stripe.com/api/products/delete
Correct
Note that you can not change a price’s amount in the API. Instead, we recommend creating a new price for the new amount, switch to the new price’s ID, then update the old price to be inactive.
https://docs.stripe.com/products-prices/manage-prices#edit-price
I see.
So until price is change. I need to use same price id for the customer subscriptoin.
Let suppose initially i create a product and price. For all the customer who subscribe to it. I will use the same price id that is created at first for all the subscriptions.
And when the price is change. We create the new price and make the previous price inactive and for new customer who make subscriptions we use the new price id?
And when we make the previous price inactive it does not affect the previous subscriptions?
Yup, exactly.
And we offer what we call Test Clocks, which let you test all of this behavior rapidly (without having to wait days/weeks/months for Subscriptions to progress through their lifecycle) so you can see exactly how this will all behave.
https://docs.stripe.com/billing/testing/test-clocks
Cool. One last question. Can i get the latest price for a product or i need to save that in my database?
We have an endpoint for listing Price objects:
https://docs.stripe.com/api/prices/list
When using it you can use the filter parameters shown there, like active and product and type to narrow down the results to find the specific Price(s) you're looking for.
Storing the ID in your own database may have better performance though.
ok thanks i will check these. thanks for the answers.