#wendy-invoice-upcoming

1 messages · Page 1 of 1 (latest)

pastel trailBOT
torn finch
#

Hi there! If this will be a one-time item for the next invoice, you can create an invoice item on the customer: https://stripe.com/docs/api/invoiceitems/create

The invoice item will be automatically pulled into the customer's next invoice

stoic tapir
#

should i also specify the sub on this call if the upcomign invoice is for prorated refund of sub

torn finch
#

Ah, yep, you should specify the subscription if you want this item to be included in the next invoice for a specific subscription. Otherwise the item will be included in the next invoice, whatever it may be (e.g. a customer may have more than one subscription, or you might create a one-off invoice)

lyric crane
#

wendy-invoice-upcoming

stoic tapir
#

since it's prorated cancel subscription
we first create a stripe refund with the prorated $ which includes that new item line i add to customer/subscription level
then we create a credit note to the above refund
but how do i include the above item line here since it does not have il_... id

#

i only have ii_xxx id from that cust/sub item line

lyric crane
#

When you create the InvoiceItem you pass subscription: 'sub_123' and it will automatically be picked up by the next Invoice

stoic tapir
#

oh wow, thank i will continue my test

#

bm but it's a il_tmp_... id and create credit notes endpoints don't like it

lyric crane
#

Okay let's take a step back because I think you're mixing up possibly a lot of unrelated concepts. You can't do a CreditNote on a future Invoice that doesn't exist yet, that is impossible.
What are you really trying to do?

stoic tapir
#

the first invoice on create subscription has an addition charge of -ve amount (some loyalty $ customer has)

#

we want to prorate refund when del subscript

#

so we currently call get upcoming invoice to get he prorated amount/%

#

we currently creates a refund then credit note to that refund and this is without the whole -ve workflow

#

so maybe i have to make use of customer balance tx

#

instead to do this....

lyric crane
#

Yes you could use the customer balance, or add an InvoiceItem with a negative amount. Sorry I still don't grasp what you're describing at all

stoic tapir
#

step back a bit

#

if we want to cancel a subscription now with prorated refund, what is the api call

#

i want that refund to include that new item like (-ve)

lyric crane
#

There is no way to "automatically refund". This is not something we support. You call the Cancel Subscription API and pass invoice_now: true and that will give you the proration and add credit to the Customer's balance and then you can figure out how you want to handle the refund

stoic tapir
#

ok i think i created a credit note that looks like a possible one...the email to customer by stripe only includes this credit note for some reason

#

it used to do one with the original invoice then a receipt with those adjustment

lyric crane
#

I don't really understand what any of this means again I'm sorry

#

Yes you can do a CreditNote on an existing Invoice that was previously paid and trigger a refund but that's not really what you were asking either

stoic tapir
#

the paid invoice of createSub has a -ve invoiceline (metadata-ed)
we want to prorate refund this sub with prorated amount going back to this invoiceline

#

so not just the credit card charge prorated refund