#thibault_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/1419568095806226465
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
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.
- thibault_api, 6 days ago, 6 messages
Hi! Looking into your query!
Thanks for waiting! I have a few follow up questions.
by using webhooks at the end of the subscription by setting a different phase 1
What do you mean by above?
You mentioned setting a different phase 1. And then you also mentioned you update the phase 0. Can you clarify more on this?
When a customer buy a new product (increase the quantity), we want to charge him immediately using the prorate system. In this situation, we update the phase to 0.
When a customer decrease the quantity in his subscription, we want to charge him at the appropriate quantity, that's why we update the phase 1.
Is there a reason why you update the existing phase (phase 0) for an increase in quantity while creating a new phase (phase 1) for a decrease in the quantity?
Because all our webhook logic is based on invoice paid event generation. That's why when we increase a quantity, we want a new invoice to be generated immediately (by updating the phase 0). When a customer decrease the quantity, we want to follow the classic subscription workflow just by reduce the quantity in the next iteration.
Sorry still looking into this... Give me a moment.
Thanks for waiting! If you make a change to phase 0, charge the customer automatically, the update to the quantity will still take place even if the payments fails. If you want to revert back, you will need to update the quantity back manually.
Another option is to update the subscription directly and use pending_if_incomplete [0]. If the payment is unsuccessful, the changes will remain pending.
However, there are some important considerations:
- Any updates you make directly to the subscription might conflict with future phase transitions defined in the schedule [1]
- When the subscription schedule transitions to its next phase, it will override any pending updates that haven't been applied yet [2]
- The schedule phase transition will still occur regardless of payment success (unlike the pending update behavior)
[0] https://docs.stripe.com/billing/subscriptions/pending-updates
[1] https://docs.stripe.com/billing/subscriptions/subscription-schedules#subscription-schedule-sub-updates
[2] https://docs.stripe.com/billing/subscriptions/pending-updates#pending-sub-schedules
Ok thanks for your answer. Another small question, imagine a scenario where i have an annual subscription (in the exact same subscription management i've described before), i update the phase 0 with a quantity from 2 to 3 but my payment fail for any reason. We have configured our stripe account to cancel subscription if an invoice is in late payment of 60 days. Does it mean that the subscription will be canceled even if the customer had 2 valid products before the update?
What do you mean by 'even if the customer had 2 valid products before the update'? 2 valid payments?
No i mean, before the operation, the customer had a valid subscription with quantity = 2
Then yes, we'll still cancel the subscription according to your dunning settings if the payment/retries fail
Ok thanks