#NotP_Dot
1 messages ยท Page 1 of 1 (latest)
hello! looks like you have to pass in a pre-created product : https://stripe.com/docs/api/subscriptions/create#create_subscription-add_invoice_items-price_data
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
ahh okay
by any change is there a way to perform the following - create a subscription with a one time payment. But that one time payment could be any cost and not necessarily a pre defined product
hmmm, so you have two items - item #1 is a one time payment, item #2 is the recurring payment?
they're technically the same product with two prices. One for the initial payment, and after that a subscription that gets charged per month
the product is a certification course, a user pays a one time fee for the certification course of 100 dollars and after that a 10 dollars fee per month for access to the learning platform and some fees
sorry if its a bit confusing
just to make sure i understand this correctly, to illustrate this with an example : Sep 1 - i pay the one time fee, Oct 1 (and every month henceforth) - i pay the $10 fee?
yes
but the one time fee could vary depending on the product. The subscription fee every month is the same $10 dollars
but you do have a fixed price for the one time fee right (although it may differ based on the product)? It's not that the customer decides how much they want to pay
yes its a fixed price for the one time fee
I just didn't wanna keep track of strip price Ids in a external db
to pass in the add_invoice_items
for stripe.Subscription.create
then i will suggest that you look into subscription schedules instead : https://stripe.com/docs/billing/subscriptions/subscription-schedules
you can schedule it such that the customer pays $x for month 1, then update the subscription to pay $y for subsequent months
would I not have to create priceIds still?
apologies for the many questions, just wanna understand the best approach for this
you don't have to pre-define Prices
but you still have to pre-define the Product at least
yeah I have a list of the products in my db.
in case you haven't seen it yet, you can use test clocks to mimic the passing of time : https://stripe.com/docs/billing/testing/test-clocks
Thank you for that
I understand the schedule with phases but what would I use to charge them for the initial payment. I am a bit confused in terms of the steps
does stripe.SubscriptionSchedule.create not require the subscription to be already created?
it doesn't require the subscription to already be created. You can create a subscription first, then create a Subscription Schedule to manage it, and update the phases in the Subscription Schedule. Or alternatively just create the Subscription Schedule
Can you let me know if these steps are what you'd do
1- create stripe.SubscriptionSchedule.create
2- create phase 1 for the one time payment
3 - create phase 2 for the subscription every month
how are you planning to collect the payment method details from your user - are you using Stripe Checkout or a Payment Element? that might help decide whether to create a subscription first
at the moment via stripe elements from the frontend if that's the answer you're looking for
I think the big issue that I am running into is if the user purchases multiple products
product 1 = course = one time fee + monthly subscription
product 2 = course tshirt = one time fee
combining these two products and create a single payment is my biggest issue lol
i don't really see a problem though, like you mentioned before, you can use add_invoice_items
yeah that's my goal but I realized add_invoice_items requires pre created priceIds from stripe
but it doesn't? you can pass in the details here : add_invoice_items.price_data
to generate a Price inline, instead of passing in a Price id
you can ? I though it was more of add_invoice_items=[{"price": 'price_1LkxfpxxxxxxxxxxxdsMuC8oH6O'}],
why don't you test it out, it'd be easier for you to understand
yes, apologies for the questions I can simply test out
Thank you for your much help Alex
nono, i'm happy to answer your questions, you just seemed a bit confused over how it works. And sometimes i find the best way to go about things is to just test it out
you're absolutely right. just a bit new to Stripe and picking up where old developers left off lo l
maaaan, that's difficult
going back to another question - whether to create the Subscription Schedule, or create a Subscription then create the Subscription Schedule from the Subscription
i think it would be better to create the Subscription first, then pay for that, and create a Subscription Schedule from the Subscription
the reason being that when you create a Subscription Schedule, the Subscription is already active, even if you haven't collected payment for the first invoice yet
yeah I think I set up something similar last week with Installments.