#niceone_api
1 messages ¡ Page 1 of 1 (latest)
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.
- niceone_api, 7 hours ago, 23 messages
- niceone_api, 2 days ago, 18 messages
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1255568407454154853
đ Have more to share? Add details, code, screenshots, videos, etc. below.
Hello! The error message is accurate, you can't add a coupon to a Subscription in this scenario. You would need to change the payment_behavior to something other than pending_if_incomplete and then separately add the coupon after that.
but if I add it separately then it won't be used in proration calculation right?
Can you tell me more about exactly what you're trying to do?
so let's suppose the user has subscription plan for 10$, is in the middle of period (so used 5$) and want to change to 20$ plan, so he would need to pay 5$ when switching to new plan; but I wanted to support adding the coupon so applying e.g. coupon with discount 2$ and use this coupon already during update (so he would need to pay 3$ not 5$)
That makes sense, but how does the pending part factor in?
pending part we use to support the case when during the update you cannot charge him for proraion (ProrationBehavior.ALWAYS_INVOICE) because some action is required like 3ds
Oh, wait, I see...
This is unfortunately something we don't support. You would need to work around it another way, like adding a credit as a negative line item, or adding funds to the Customer's balance instead of using a coupon.
I see, and then after update is done apply the coupon for further use?
Yep. You can try it all in test mode to make sure it works the way you want/expect.
a how to do this? " like adding a credit as a negative line item, or adding funds to the Customer's balance"
We have a feature request internally for supporting coupons on pending updates, and I added a link to this conversation to it, but I can't say when or if it will ever be supported.
I assume I should do this before the update?
Yeah, the more I think about it the more I think a Customer balance adjustment might be best: https://docs.stripe.com/billing/customer/balance
I'm not sure if there's a good way to get a negative line item in there for a pending update.
so I do customer balance adjustment and then (as a separate step) the subscription update?
Yep, and then reverse the balance adjustment if the pending update doesn't pan out/gets canceled.
No problem, good luck with it!
thanks a lot