#pro-pooja_api

1 messages · Page 1 of 1 (latest)

glossy houndBOT
#

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

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

torpid ferryBOT
#

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.

lament oak
#

Hi there 👋 can you confirm you're referring to the most recent Invoice for that Subscription? If so, can you elaborate on what about it you weren't expecting or have concerns with?

atomic gulch
#

Yes, referring to most recent invoice

#

I have created a subscription with 5 items, then downgraded to 3 item,s and then again upgraded to 6 items using Api, if a customer has downgraded in the same month and adds the same amount £ of items in the same month, they wouldn’t be charged any additional money that month because they’ve returned to the same level plan. If they go above the plan amount they were on before with items they’d be charged immediately

#

It has charged £15 for last invoice where it should charge only £5

#

Are you there?

lament oak
#

Yes, I'm looking at the Invoice, trying to piece together what you're describing.

#

This looks expected. You only had prorations on for the quantity change from 0 -> 3, so that's the only adjustemented we calculated prorations for.

atomic gulch
#

User already paid for this invoice-in_1PBFvXGVCe8mF8QWhpy5peeX

#

So, it is 2->0->3, difference is 1

lament oak
#

You didn't tell us that though. You didn't create prorations for the downgrade.

#

It sounds like our prebuilt proration behavior likely isn't what you want for your flow. You may need to fully suppress our behavior and implement your own if that's the case.

atomic gulch
#

For the downgrade user won't be charged anything

lament oak
#

Understood, and it doesn't change my above guidance.

atomic gulch
#

What should be the workaround to implement this?

lament oak
#

Likely you would want to always set proration_behavior to none, and build your own flow for determining how much the proration amount your customer should be charged is, based on your desired logic. Then you can create Invoice Items for the Subscription to charge your customers for those prorations.

atomic gulch
#

You mean, we have to create the invoice via API with the applicable amount?

lament oak
#

No.

#

I was suggesting you create Invoice Items:
https://docs.stripe.com/api/invoiceitems/create
Using the subscription parameter to tie them to a specific Subscription so they'll be included on the Invoices created by that Subscription:
https://docs.stripe.com/api/invoiceitems/create#create_invoiceitem-subscription

Then you can create an Invoice for the Subscription, to pull in the pending Invoice Items that need to be paid:
https://docs.stripe.com/api/invoices/create
again, using the subscription parameter here to do this action for the Subscription you're adjusting:
https://docs.stripe.com/api/invoices/create#create_invoice-subscription

atomic gulch
#

Would it charge the customer immediately?

lament oak
#

If you immediately create the Invoice and process a payment for it.

#

This is a flow you'll need to build, so you will have a lot of control over how it behaves.

atomic gulch
#

Is there any flag or param that should be added in update subscription api to create an immediate invoice or sepearte api is needed tp create an invoice?