#frallain
1 messages · Page 1 of 1 (latest)
That's because you're using the invoice line item and not the invoice item id
I cannot find the invoice item id anywhere
You should be using the id returned from this API:
https://stripe.com/docs/api/invoiceitems/create
How are you creating the invoiceitem?
that's a Subscription's invoice, you can update only the tax_rates or discounts
as the error message is showing.
oh ok... so I need to update the upcoming invoice to be able to effectively edit these descriptions right?
no you can't update the line item's description of a subscription's invoice.
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
that's when you use invoice items API, the id will be ii_ and not invoice line item il_ these are quiet different object
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
invoice items are the invoice item you create successfully. while invoice line items are internal object generated from the Subscription line items.
There is no explicit documentation for that AFAIK, but the error message is quiet explicit I think.
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?
Ah interesting, could you please share the link to that part?
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.
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 ?
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
for example this one is big and is I think causing a lot of confusion : https://stripe.com/docs/upgrades#2019-12-03
Mmmh I see. So moving to this API version (2019-12-03) would make the edition possible you think?
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 theunique_idof the thing you're looking at instead of theid
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
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, theidattribute returns a subscription IDsub_xxand theunique_idis an invoice line IDil_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
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