#coach-leyton_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/1217285875176706128
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
test
hello! are you upgrading to a new version?
Hi! technically yes. Starting a new code-base and this new-version will have access to the new version of the API
Will my old code (On the old code-base, using the old version of the Stripe .NET library) still operate as normal? Or must it be updated?
your old code will still work. We do generally always recommend upgrading to the latest version so you have access to newer features
That's good news
In my new project, I'm using the newer version of the Stripe .NET library, and therefore it's more up-to-date with the current latest API. How does the removal of the "recurring" option within a price update change things for me? I can't even remember what it did tbh
For example, here's the old code:
await _stripePriceService.UpdateAsync(price.Id, new Stripe.PriceUpdateOptions()
{
Active = plan.Active,
Recurring = new Stripe.PriceRecurringOptions()
{
TrialPeriodDays = plan.TrialPeriodDays
}
}, null, cancellationToken);
I can't remember why I ever needed to specify a "Recurring" object there
Remove support for recurring on Price#update - there's no replacement for this. We no longer allow updating the Price's recurring data after it's been created via the API. Really though, if you need to change the Price, you should ideally create a new Price
wait, you don't allow the updating of a price at all?
sorry, we allow you to update certain parameters
but not whether it's recurring
if you look at the API docs here : https://docs.stripe.com/api/prices/update, you can see there's no recurring parameter now
What does it mean for a price to "recur" again? Isn't it the Subscription that manages the frequency of payments?
Or does that information (for example, monthly or annually) exist on the Price itself, and the Subscription just uses a particular Price, and charges the customer at the interval specified by the Price?
if that makes sense, and wasn't rambling nonsense
A Price can be either one-time or recurring. You pass in a Price in the line_items when creating a Subscription : https://docs.stripe.com/api/subscriptions/create#create_subscription-items-price
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I seeeeeee
and those subscription line-items can be a list of items, where some may use a one-time price, and some may be a recurring price?
so for example, I could specify two line items when creating a subcription. One for a one-time sign-up fee, and then another for a recurring subscription fee
well, you only can pass in recurring prices here : https://docs.stripe.com/api/subscriptions/create#create_subscription-items, you pass in one-time prices here : https://docs.stripe.com/api/subscriptions/create#create_subscription-add_invoice_items
In essence though, yes, you can specify two line items when creating a subcription. One for a one-time sign-up fee, and then another for a recurring subscription fee
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
One last thing, if I ever wanted to update the trialPeriodDays of a price, the approach now is to archive it, and make a new one?
hrm, the current recommended flow is to set the trial on the Subscription instead : https://docs.stripe.com/api/subscriptions/create#create_subscription-trial_period_days
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
why would the API allow to specify the trialPeriodDays on the Price and the Subscription at the same time?
I presume the trialPeriodDays on the Subscription overrides the one on the Price if they're both specified and have different values?
I presume the trialPeriodDays on the Subscription overrides the one on the Price if they're both specified and have different values?
Integer representing the number of trial period days before the customer is charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. See Using trial periods on subscriptions to learn more.
why would the API allow to specify the trialPeriodDays on the Price and the Subscription at the same time?
We don't recommend setting the trialPeriodDays on the Price. If you look at the Price object in the API docs, it no longer has trialPeriodDays : https://docs.stripe.com/api/prices/create
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I see. Cool, thank you for your help!