#manuel_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/1382727867405959188
📝 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.
- manuel_api, 5 days ago, 69 messages
hey there, taking a look
ok ty
ok, what seems to be happening is that your once type coupon is being consumed on the invoice produced by this subscription update: https://dashboard.stripe.com/test/logs/req_xP3En2bc8hcOBx
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
but its a zero amount invoice becuase of the changes you made, the prorations net out to zero
so really the coupon provides no discount in terms of payments, but it is consumed and removed
Whats the outcome you were expecting, instead of this?
ohh ok
what I hope is that the coupon will remain in the subscription
but the problem is that the next invoices to be charged will be with a value of 0.00, any idea how to prevent this?
what I hope is that the coupon will remain in the subscription
can you say more?
In that case, say, what would you expect to see on the invoice you produced, and what would you expect on the next invoice?
yeah no problem. The idea is that the subscription contains the coupon applied but that the following invoices if the customers wants to add more products to their subscriptions the coupon its has to be not applied because this causes the invoices to be set at 0.00$ :c
on the invoice at the time the coupon is applied I expect it to be 0.00 but not 0.00 on the next invoice if the customer upgrade/modify the subscription.
Are you saying you expect this large coupon to lead to a customer balance to be applied to future invoices as they happen?
That was the behaviour for amount_off coupons in the past, but it was changed a long time ago, in 2013: https://docs.stripe.com/upgrades#2013-10-29
The "overflow" of an amount off coupon is just discarded now
Yes, as long as they do not modify their subscriptions.
In this case, it applied to the 0euro invoice, was completely used, and removed
It sounds like you perhaps want to set some customer credit balance instead:
https://docs.stripe.com/invoicing/customer/balance#modifying
In your case, you could set that amount as a customer credit balance, then it would work as you describe, paying down future invoices until depleted
If the customer changes their subscription and you want to remove that credit, you'd need to adjust that again
Alternatively you could use a recurring amount off coupon matching the expected amount of the subscribed price for N months
That might be more along the lines of your goal
ok i understand
ok if i use the recurring amount discount coupon will it not cause the following invoices to be made at 0.00?
It would reduce the future invoices by the discount/coupon amount specified. Isn't that what you want, though?
the problem would be the prorate, right?
You should test the behaviour in test mode / sandbox to ensure it works the way you'd like, but if not then you may want to evaluate setting credit balance like i suggested as an alternative
yes, I will also keep it in mind, could you give me some information or example about that credit balance
Take a look at the doc here: https://docs.stripe.com/invoicing/customer/balance
but, briefly, this would be a running balance on the customer that would be used to pay down invoices.
It's used automatically for cases where an invoice has a negative balance, too, to have that amount credited to a future invoice to reduce payment.
ok I understand, sometimes I see invoices with negative balance. Can it also be due to that?
existing credit won't push an invoice to a negative balance, the negative balance would be for other reasons like a large proration credit that outweighs a smaller proration charge
that negative balance is that added to the customer credit to reduce a future invoice
np!
so if I do it with the credit balance of each csutomer it will avoid generating invoices in 0.00 and in negative balance when I modify your subscription
👋 stepping in as synthrider needs to step away
The Credit Balance (assuming it is positive) reduces the amount of the next finalized Invoice.
However it won't make that Invoice negative.... the most it would reduce it is to $0.00
If it would reduce more than that, it would just remain in the Customer Credit Balance for the following Invoice.
Overall the best thing to do here is to test this stuff out!
That will give you the best understanding of how it all works.
but all those coupons are not 100%, they are created with amounts not percents
and do not cover 100% of the subscription price, only a part of it
Okay... is there a specific Invoice where you are seeing unexpected behavior?
If the coupon isn't 100% off then you wouldn't see a $0 Invoice just due to the Coupon
There would be something else causing that as well
what happens is that when a coupon is applied to the subscription then some time later if the customer wants to modify his subscription by adding more items to it generates invoices of 0.00 regardless of the % or the amount, it will always be 0.00.
Great, looking
tyy
!!!
🙏🏻
if you need more context for that invoice, the customer modified his subscription and a discount was applied to his subscription after which he wanted to make a modification by purchasing an additional item. Which on the invoice for that item was a negative balance but there are other cases so instead of being a negative balance it is a total of 0.00.
Okay so what happened is that you applied a one-time Coupon for €411 off: https://dashboard.stripe.com/logs/req_DZul7FfZxqvlRc. You applied that Coupon to the Subscription without any Invoice generation involved in that Coupon which means it covers the next charge: https://docs.stripe.com/api/coupons/create?api-version=2025-05-28.preview#create_coupon-duration
Then you updated the Subscription to delete one of the Subscription Items, which creates a proration item for the unused time of the Subscription Item you deleted. That is the 14x-€4.23+tax which leads to the -€71.57. For the other new Subscription Item that was added, the 15x€17.00 for price_1RTSXqDtLlgoCDIrdxEhScyh, the previously mentioned Coupon still covers this Subscription Item as it is what is responsible for the next Charge here. That means that Invoice Item is 15x€17.00-411 = -€xxxx but with a Coupon you can't create a negative line item so it just equals €0.00 for that Invoice item.
So in short the Coupon still applies to the new item here because it is the next Charge for the Subscription after the Coupon was applied which then combined with the proration item leads to the negative Invoice.
ok, would there be a way that when modifying the subscription (which would be at the time of applying the coupon) the proration would not be applied?
or how would I do so that the following invoices are not 0.00 or negative balance?
or avoid these cases
If you don't want proration then when you update the Subscription to the new Price (and remove the old one) you set proration_behavior: 'none': https://docs.stripe.com/api/subscriptions/update?api-version=2025-05-28.preview#update_subscription-proration_behavior, the downside here is that an Invoice is not cut in this case.
Also, as another point, why are you not just updating the Subscription Item here when increasing the quantity by 1? You are currently deleting the Subscription Item and creating a new one.
But it would be much cleaner, and avoid some of the proration stuff, to just update the Subscription Item quantity
I'm talking about in: https://dashboard.stripe.com/logs/req_7nGqsUg9kh4obz
Overall the absolute cleanest thing to do here is to just use the default proration behavior which would mean that proration items would be generated but handled at the next billing period.
That means the Coupon would apply to the actual next full Invoice generated
So it wouldn't be $0 assuming the full amount of that Invoice (the total of all the Subscription Items - proration item) is greater than that amount, which it would be based on the Subsription example you provided.
how can i modify the number of items in a subscription without deleting them? because if i put 1 the item in the subscription remains as 1 and not 14+1
You change the quantity to 15
If you need to you can retrieve the Subscription prior to the update to check the current quantity.
But this is much cleaner than deleting items and creating new ones when really you are just updating the quantity of a pre-existing item.
ok ill take note with that behaviour
I'm going to do some tests and I'll be back then if something else happens 🥲
Thank you so much for your time
Sounds good!