#zelda.zonk
1 messages ยท Page 1 of 1 (latest)
No. You can create Checkout first to generate a Subscription, and then generate Subscription Schedule from it tho
ok thanks.
my client wants the ability for users to add many items to cart (that are one-time products) and create installment plan is this possible ?
so make up a subscription schedule that consists of one-time products
im referring to https://stripe.com/docs/billing/subscriptions/subscription-schedules/use-cases#installment-plans
if i have to go with custom flow checkout instead of stripe checkout thats fine
Yes that's purely Subscription Schedule. To use this flow you may want to separately collect the customer payment info, ie. via a Checkout in Setup mode, before calling these API
right ok, so i can create a Subscription Schedule via api using non-recurring products? one-time products?
ok so this works ``` $checkout_session = Cashier::stripe()->checkout->sessions->create([
'mode' => 'setup',
'payment_method_types' => ['card'],
'success_url' => 'http://guitar-tutor-app.test/checkout/success',
'cancel_url' => 'http://guitar-tutor-app.test/checkout/cancel',
]);```
now when doing $stripe->subscriptionSchedules->create([ 'customer' => '{{CUSTOMER_ID}}' , 'start_date' => 'now', 'end_behavior' => 'cancel', 'phases' => [ [ 'items' => [ [ 'price' => '{{PRICE_ID}}' , 'quantity' => 1, ], ], 'iterations' => 6, ], ], ]); can items array BE prices by those of one-time products?
It should be recurring prices of a Product
yeah i just got error "All phase items prices must be recurring."
Product doesn't matter, but the Price needs to have recurring.interval as the Doc mentioned
can i change the price of an item in phases using inline price object?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Yes using price_data here
ok thanks.
so i cant really use subscription schedules with one-time products then?
is there a another stripe way to allow user to payment monthly increments of total cart value (which comprises of one-time products) ?
actually wait on that im going to test something
ok i was able to create subscription schedule with one-time products using inline price object.
'customer' => $stripeCustomer->id,
'start_date' => 'now',
'end_behavior' => 'cancel',
'phases' => [
[
'items' => [
[
'price_data' => [
'currency' => 'aud',
'unit_amount' => 1500, // Amount in cents
'product' => 'prod_OPvGBiqv7l91bv', // Replace with the product ID
'recurring' => [
'interval' => 'month', // Other interval options are also available
],
],
],
[
'price_data' => [
'currency' => 'aud',
'unit_amount' => 1500, // Amount in cents
'product' => 'prod_OPvFbKvGLCaVqk', // Replace with the product ID
'recurring' => [
'interval' => 'month', // Other interval options are also available
],
],
],
],
'iterations' => 4, // Number of iterations (months in this case)
],
],
]);```
so effectivly its creating a new RECURRING price id for those products, but they are specific to that subscription schedule, and are not added to the product as prices correct ?
I think after the schedule runs, these recurring prices will become visible in the Product ๐
damn
I'm not sure how you define "one-time products". Products doesn't need to define one time or not, but the Prices inside it, need to be either one time or recurring
So it's no harm to have one Product, some one time prices inside it, then in the future some recurring price generated inside it
sorry i meant one-time prices, like recurring or one-time
yeah but ill end up having a ton of recurring prices in the product (created with price inline object) for every checkout where userwants payment plan.
this is what chatGPT says about Price Object "As of my last knowledge update in September 2021, prices created inline using the Price object within a subscription schedule are not added to the product prices in the Stripe Dashboard. **The inline prices are specific to the subscription schedule and are not reflected as standalone prices within the product.
**
When you create a Price object inline within a subscription schedule, you are defining a pricing configuration for that specific subscription schedule. These inline prices are used for the duration of the subscription schedule and are not saved as separate prices associated with the product in the Stripe Dashboard.
If you want to create standalone prices that are associated with the product and can be reused across different subscription schedules or products, you would need to create those prices directly in the Stripe Dashboard or via the Stripe API. These standalone prices will appear under the "Prices" section of the product in the Stripe Dashboard.
Always refer to the latest Stripe documentation or resources for the most accurate and up-to-date information, as features and functionalities might have evolved since my last update."
but your saying thats not the case right?
Hmm not too sure about that, Let's test it out in Test mode
is there a way to use the time feature in dashboard to forward the time to test whether the recurring price gets added to product after the schedule runs
It's called Billing Clock, you create it on a Customer, and yes I believe it should work when you test Subscription Schedule
using Subscription schedules, is there a way to prevent user cancelling subscription until end date? as i dont want user with installment plan cancelling before they have paid it all off
customers can only cancel if you call the API on their behalf so you can simply refuse to do it and not give them the option
they cant cancel through customer portal?
they can, if you are using that and you have that option enabled in it
ok so if i use customer portal, can i disable cancel subscription IF it is a subscription schedule only? so still allow users to cancel normal subscriptions?
no, it's not that customisable
ok thanks.
so when talking with @frank lion - i am when creating a subcription schedule, using inline price objects, and my worry was do the new product prices get added to products in stripe dashboard with every inline price, Orakaro said yes after schedule run ends. but i just tested with testclock and it doesnt. So inline price objects are one time prices, linked just to that subscription correct?
by inline you mean using price_data?
yes
'customer' => $stripeCustomer->id,
'start_date' => 'now',
'end_behavior' => 'cancel',
'phases' => [
[
'items' => [
[
'price_data' => [
'currency' => 'aud',
'unit_amount' => 1500, // Amount in cents
'product' => 'prod_OPxsLbbBO5tIeO', // Replace with the product ID
'recurring' => [
'interval' => 'month', // Other interval options are also available
],
],
],
[
'price_data' => [
'currency' => 'aud',
'unit_amount' => 1500, // Amount in cents
'product' => 'prod_OPxsNhEvQMtrL6', // Replace with the product ID
'recurring' => [
'interval' => 'month', // Other interval options are also available
],
],
],
],
'iterations' => 3, // Number of iterations (months in this case)
],
],
]); ```
then I think those don't get shown in the Dashboard or List Price endpoints unless you specifically retrieve them
ok great!
my use case is this: my client wants the ability for users to add many items to cart (that are one-time prices) and create installment / payment plan. Should I use recurring payments or subscription schedules? The invoice would consist on one-time prices only. which would be better you think?
SubscriptionSchedules are what we recommend for installment plans
ok great. is there a limit to how many inline prices you can create on a product?
not that I know of