#dancamdev

1 messages · Page 1 of 1 (latest)

nocturne terraceBOT
#

Hello! We'll be with you shortly. 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.

zenith solar
#

depends how you do the update.

storm warren
#

is there a flag to defer it to next payment cycle?

#
await stripe.subscriptions.update(subscription.id, {
            items: [
                {
                    id: subscription.items.data[0].id,
                    price: newPrice,
                },
            ],
        });
#

this is what I have right now

zenith solar
#

again, it depends, check the link. That code might already defer the charge

#

it depends what the item currently was and what you're changing it too for example so I can't say just from code

storm warren
#

I've checked the docs but it isnt very clear, its critical for me to get this right, user must not get charged right away

#

the item isn't changing, I've just updated the price

#

what information can I provide you to give me a bit more of an insight?

zenith solar
#

I don't really need more information

#

I can explain how updates work, one sec

storm warren
#

awesome thanks a lot!

zenith solar
#

https://stripe.com/docs/billing/subscriptions/prorations
https://stripe.com/docs/api/invoices/upcoming
https://stripe.com/docs/billing/subscriptions/prorations#preview-proration

The way proration and updates works in Stripe by default is

  • you have a subscription that is from 1 Oct -> 1 Nov for $100
  • on Oct 20 you change to a plan that is $200
  • we generate two prorations
    -a charge for 10 days of $200
    -a refund for 10 days of $100
  • on 1 Nov, the Invoice has three line items, the charge, the refund, and the $200 for the upcoming Nov 1 -> Dec 1.
#

in that code you shared, if the change you're making is not one of the ones that require immediate payment(see my first link) then it works that way.

storm warren
#

can I skip proration alltogether and just have the users pay 200 on the next billing cycle?

zenith solar
#

sure

#

proration_behavior:"none" exists as an option to pass when updating the subscription.

storm warren
#

awesome, so by passing that I'm sure that:

  • user wont be billed right away
  • user will get the uptodate price on the next billing cycle
#

can you confirm this?

zenith solar
#

that's the idea yes