#ikm_docs

1 messages ¡ Page 1 of 1 (latest)

supple whaleBOT
#

👋 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/1359045954459664385

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

quartz aspen
#

Hi! Can I clarify what you are aiming to do? Your customer is charged MYR 100 on 1 May, you update the subscription on 15 May to a MYR 200/mth price. You want the customer to be charged MYR 200 immediately for the entire May and still have paid the MYR 100 for May as well?

graceful cliff
#

We ran a credit based subscription and each subscription payment will increment the credits for a customer. So if a customer have RM100 subscription on 1 May, and they change their subscription to RM200 on 15 May, we want the customer to be charged RM200 on 15 May. So technically, the customer will pay a total of RM300 in May month.

quartz aspen
#

Let me look into this.

graceful cliff
#

Thanks a lot!

quartz aspen
#

Thanks for waiting! There currently isn't a way for you to charge your customer the MYR 200 immediately. If you don't want to prorarte and keep the billing cycle as well, you will need to update the subscription with proration_behavior: none and then create a one-off invoice for the MYR 200 in May. You can link that Invoice to the subscription: https://docs.stripe.com/api/invoices/create#create_invoice-subscription

graceful cliff
#

Thanks for the response!

I noticed that there's a billing_cycle_anchor parameter for subscription update. I wonder if I can just use it like this:

const subscription = await stripe.subscriptions.update(
  sub_id,
  {
    items: [
        {
           id: sub_item_id,
          price: price_id,
        },
      ],
    billing_cycle_anchor: 'now',
    proration_behavior: 'none',
  }
);

or it will have a considerable delay from the change to invoice payment.

quartz aspen
#

What do you mean by this: or it will have a considerable delay from the change to invoice payment.?

graceful cliff
#

Our previous method is to use the stripe customer portal for user to change their subscriptions. But when the user changed their subscription, the payment/renew date are set to next day instead.

quartz aspen
#

I noticed that there's a billing_cycle_anchor parameter for subscription update. I wonder if I can just use it like this:

If you use this, what it does is that it will make 15 May the new billing cycle date and charge MYR 200 immediately for 15 May to 15 June. And then the subsequent invoices will be 15 Jun - 15 Jul , 15 Jul - 15 Aug, etc.

#

I am still a little unsure about your secodn question.