#Fred-invoice

1 messages ยท Page 1 of 1 (latest)

pallid pewter
#

Hi! Can you share two invoice line IDs that look they are the same?

wise wraith
#

il_1KTOlMC0QKj18akVcFdWjm38

ii_1KTOlMC0QKj18akVPZODs5SE

pallid pewter
#

Thanks! Give me a few minutes to look into this.

#

The first ID you shared (il_1KTOlMC0QKj18akVcFdWjm38) doesn't seem to exist on Stripe's end. Are you sure this is the correct ID? Where did you find that ID?

wise wraith
#

I stored that ID via a webhook

#

I store the invoices in my DB on the invoices create/update webhooks. So I'm assuming this is because it's still in draft?

pallid pewter
#

So you got the first ID when listening to invoice.created, and the second ID when listening to invoice.updated? And both ID are for the same invoice?

wise wraith
#

Yes ๐Ÿ™‚

pallid pewter
#

Got it! Let me try to reproduce this.

#

I think I understand the problem now.

#
  1. I create an invoice item, it's ID is ii_001
  2. I create a new invoice (in draft), and listen to invoice.created. In lines.data[0].id I see li_001
  3. Then I finalize that invoice, and listen to invoice.updated. In lines.data[0].id I see li_001
    So the ID in step 2 and 3 is the same. However the ID in step 1 is different.
wise wraith
#

exactly ๐Ÿ™‚

#

so invoice_item is something different, and only for drafts? I actually didn't notice the prefix wasn't the same

pallid pewter
#

Yes invoice items are ii_xxx, and when they are added to an invoice they become line items li_xxx, so it's expected that the ID is different.