#lucas

1 messages · Page 1 of 1 (latest)

terse lanternBOT
gloomy orchid
#

(i'll note that - it seems like it decided that it should change the SubscriptionSchedule in order to make sure to keep the current Invoice as-is and tag on the fact that the next Invoice should change, if I'm reading the event logs correctly)

wise vine
#

Hey @gloomy orchid! Apologies for the wait. Let me circle back here in a couple of minutes

gloomy orchid
#

take your time! thank you

stark gale
#

what I'm noticing is that it schedule an update to the Subscription
What does that mean? What does it schedule?

#

Also immediately update the Product Prices on the upcoming Invoice
that doesn't make sense, an upcoming invoice is by definition upcoming, it's for the next cycle

#

How exactly are you updating your Subscription?

#

cc @gloomy orchid

gloomy orchid
#

yeah - unfortunately i cancelled the subscription but i can still show you some of the breadcrumbs.

#

ill show you some code too, one second

#

i swap subscription items in and out, here's how i add the new one -

  await stripe.subscriptionItems.create({
    subscription: sub.id,
    proration_behavior: 'none',
    price: standalonePrice,
    quantity: 1,
  });

here's how i remove the old one -

await stripe.subscriptionItems.del(grouperSubItem.id, {
              proration_behavior: 'none',
            });
#

just as some background for us - probably helps understand our use case -

our subscriptions are a means to an end to get a recurrence cadence to ship medical items. we just want to ensure that a charge happens at the right time before the individual runs out of supply of their current medication, and it'll always be the same price

stark gale
#

honestly, I would recommend never using that API if you are swapping multiple

#

but ultimately there's nothing "scheduled" here, the change is immediate

#

Can you share a concrete Subscription id for me to look at?

gloomy orchid
#

ah okay, ill make that change, thanks for the info

#

the subscr id is sub_1LaoLBEk6sr5GyDh3D8RvgVl

#

oh actually - this is a test subscription i was using earlier in august to experiment with subscription schedules, would that have something to do with it? would that cause the subscription to try to restart the schedule?

stark gale
#

not restart but yet it would reflect a change in the phase

#

so yeah mostly just ignore schedules and you should be all set

gloomy orchid
#

oh okay cool

#

while i have you - looking at /update -

  • i'd set the items array with the appropriate intended price and that array will overwrite the current array attached to the subscription?
  • i'd set proration_behavior to none?

any other issues come to mind for you in order to keep the current billing cadence and dollar amount?

stark gale
#

it's not an override, it's a merge. You have to add the 2 prices and remove the old one explicitly

#

and up to you for proration, I'm not sure why you decided to disable proration

gloomy orchid
#

ohh. i see deleted now, gotcha

#

i just always want the exact dollar amount, never any more or less based on a window of time or anything. so i think none is what im looking for to enable that use case

#

alright, well, thanks for the help @stark gale ! i love how quick you guys always are to jump in and provide your expertise