#Codex-Credit-Notes
1 messages · Page 1 of 1 (latest)
Hi there! The sli_ item is the Subscription Line Item. You wouldn't use this for a credit note.
You would only use the invoice_line_item.id as you mentioned il_xxx
I'm a little confused where you are seeing the invoice_line_item.unique_id?
Oh that makes sense. When retrieving invoices, there in the response at invoice.lines.data[0].unique_id that starts with li_.
But invoice.lines.data[0].id surprisingly starts with sli_
Ah okay, yes thanks forgot how exactly we display this object.
So yeah, the top level is the subscription line item that generated the underlying invoice line item.
It is possible for there to be multiple invoice line items here per subscription item
Which is why you see those different IDs
Alright so in this case I would use unique_id with prefix li_ and not id
Correct
Thank you. I also tried it accidentally with .id (prefix sli_) and there were no errors. Would this potentially cause a big problem somewhere?
Ah okay this was throwing me off because this is due to you being on an older API version before we changed the naming: https://stripe.com/docs/upgrades#2019-12-03 discusses this.
So you can use either with the API version you are on and both will work.
But if you upgrade then you would need to use the sli_ as that is the line item ID that is present in newer API versions and we removed the unique_id
Oh that is perfect. So with my old API version we can use either, but newer versions will start using the id field. We'll stick with id in this case. Thank you