#Mitch528 - Negative Invoice Items
1 messages · Page 1 of 1 (latest)
Hello! You should be able to create negative Invoice Items: https://stripe.com/docs/api/invoiceitems/create#create_invoiceitem-amount
Yes, I can. However, I'm trying to do it on the initial creation of the subscription, so the first invoice.
Can you give me the request ID showing the error you're getting? Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Ah, gotcha. Yeah, unit_amount there must be positive as documented here: https://stripe.com/docs/api/subscriptions/create#create_subscription-add_invoice_items-price_data-unit_amount
Can you tell me more about what you're trying to do? Maybe I can recommend an alternative.
Yeah. I'm trying to basically add a discount line item to the first invoice when a subscription is created. I can't add the invoice item afterwards because the invoice is already finalized.
Have you tried using a coupon? https://stripe.com/docs/api/subscriptions/create#create_subscription-coupon
I have. The issue with the coupons are that they apply every time - even with upgrades. I would need coupons to apply one time for the initial subscription creation and then when upgrading a subscription, it should not apply it again.
@severe basin Is there any alternative way to discount items when creating a subscription or am I out of luck?
You can set the duration of a Coupon to once. Does that not work as expected?
I've tried that before, but if I recall correctly that throws off the proration.
and charges the customer more than it should. It excludes the initial discount from the calculation.
Can you give me an example Subscription ID showing that behavior and explain the desired behavior of that Subscription?
@severe basin Sure. sub_1KK5D84WfFZQ6geYDKpvt22n If you look at the latest invoice, it's $10 where it should be $5
👋 I'm hopping in since @severe basin has to head out soon - let me take a look
Hello! Alright, thanks
Yeah so the issue here is that you have a Coupon w/ a duration of once, but you want the coupon to actually be applied to all updates until the first time it's renewed, correct?
Correct. But If I set it to repeating, then it's applied to each invoice in addition to the proration.
How long did you set it to repeating for? Just one month?
Yep
Do you have an example invoice where it did that?
in_1KK4xi4WfFZQ6geYU1c4HVhT
Yeah I see the issue - let me try and confirm something really quick on my end
Okay
Sorry it's taking a while - I'm seeing some odd behavior with the invoice you sent over and I"m trying to pinpoint what it is
@spare flax Do you mind emailing support@stripe.com and mentioning that you're talking to karbi on Discord? Your usage of proration_behavior: none + billing_cycle_anchor in your subscription creation request is causing odd future repercussions on the future prorations generated. We have to keep looking into it, and emailing us will be easiest way for us to get back in contact with you
With that being said, is there a specific reason you're using proration_behavior: none in your creation request?
Alright, will do that. And yeah, the reason for that is there are some cases where we need to create a subscription when there is no payment method set. iirc, Stripe throws an error when creating a subscription when there is no payment information set for the customer.
If that's the only reason you're setting proration_behavior: none then I'd suggest not doing that - you should only be using that if you don't want to be charging the customer for the time between the sub start date and the billing cycle anchor. Instead, you can use payment_behavior: default_incomplete to still create the subscription and not attempt charging/confirmation in the same call.
hmm.. okay, will try that.
yeah this will let you bypass the weird behavior you're seeing entirely
@spare flax have you emailed in yet?
Not yet. I've been testing what @novel storm suggested and that seems to be working for me.
ah nice!