#Codex-Credit-Notes

1 messages · Page 1 of 1 (latest)

burnt dawn
#

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?

night yew
#

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_

burnt dawn
#

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

night yew
#

Alright so in this case I would use unique_id with prefix li_ and not id

burnt dawn
#

Correct

night yew
#

Thank you. I also tried it accidentally with .id (prefix sli_) and there were no errors. Would this potentially cause a big problem somewhere?

burnt dawn
#

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

night yew
#

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