#frallain

1 messages · Page 1 of 1 (latest)

hardy turtleBOT
strong slate
#

That's because you're using the invoice line item and not the invoice item id

spring tulip
#

I cannot find the invoice item id anywhere

strong slate
#

How are you creating the invoiceitem?

spring tulip
#

They are created by Stripe at the end of the cycle

strong slate
#

that's a Subscription's invoice, you can update only the tax_rates or discounts

#

as the error message is showing.

spring tulip
#

oh ok... so I need to update the upcoming invoice to be able to effectively edit these descriptions right?

strong slate
#

no you can't update the line item's description of a subscription's invoice.

spring tulip
#

ok then the documentation is inaccurate because it states that

Update an invoice item

Updates the amount or description of an invoice item on an upcoming invoice. Updating an invoice item is only possible before the invoice it’s attached to is closed.
https://stripe.com/docs/api/invoiceitems/update?lang=python

strong slate
#

that's when you use invoice items API, the id will be ii_ and not invoice line item il_ these are quiet different object

spring tulip
#

OK, where can I get some documentation about the differences between invoice items and invoice lines?

#

and where can I get some documentation explaining that only tax_rates or discounts can be editable for invoices generated by the Stripe Subscription management system?

#

What's interesting is that if updating a subscription mid-cycle with always_invoice as proration behavior, the invoice lines descriptions (from the generated invoice) are editable

strong slate
strong slate
spring tulip
#

But then how do you explain that

What's interesting is that if updating a subscription mid-cycle with always_invoice as proration behavior, the invoice lines descriptions (from the generated invoice) are editable
Aren't they Subscription's invoices too?

strong slate
#

Ah interesting, could you please share the link to that part?

spring tulip
#

(it is even possible via the UI in this case)

strong slate
#

In this invoice, it's an invoice item, try doing the same API request using this id ii_1NZtVQH2GG3UYmlxurghEmTT

#

I think it'll work for this case.

spring tulip
#

yes I know, but why in this case the lines are invoice items, and the previous case, the lines were invoice lines? That does not seem consistent

#

while both invoices are in draft status

#

should I wait for some time to get the invoice lines converted into invoice items ?

pearl ruin
#

the way it works is that InvoiceItems are "floating" items not attached to a specific invoice, and they get "pulled into" an Invoice when it's created. The Invoice that pulls them in then has LineItems in its lines property which comes from the details in the InvoiceItem

#

now, a lot of this is massively complicated for you because you're using a 2016 API version and a lot has changed

spring tulip
#

Mmmh I see. So moving to this API version (2019-12-03) would make the edition possible you think?

pearl ruin
#

you should always move to the latest version if you're going to do an update, not an intermediate one.

would make the edition possible you think?
not sure I know what you mean since I don't grasp 100% of the backstory here. But you could for example try making your call using the unique_id of the thing you're looking at instead of the id

#

but yeah the whole line/item area and their IDs is quite messy, it's been cleaned up over time but you'd still be impacted by legacy issues

spring tulip
#

But you could for example try making your call using the unique_id of the thing you're looking at instead of the id
In my case, with the 2016 API version, the id attribute returns a subscription ID sub_xx and the unique_id is an invoice line ID il_xx
*2016

#

but yeah the whole line/item area and their IDs is quite messy, it's been cleaned up over time but you'd still be impacted by legacy issues
Alright, got it

pearl ruin
#

yeah the id is sub_xxx because the line item that corresponds to charging for the Plan the Subscription is for is type:subscription and in old versions it used the sub ID, and the unique_id is il_xxx