How to determine line item uniqueness without SKU in an app?

Hi there, I’m working on an app that stores Orders and Line Items in it’s own database, via the orders/updated webhook. We’re currently identifying unique items within an order by comparing their SKU and product_id fields. We’ve recently run into a problem where some shops don’t provide a SKU field, and if the order consists of multiple customized versions of the same product, we don’t correctly create Line Item records, since the SKU and Product ID fields aren’t unique.

Which fields are best for determining uniqueness of a Line Item? Is the ID field enough? Should we be using a combination of fields? We need to ensure that this uniqueness is consistent across orders that have been discounted or refunded, as well.

Thanks!

Hey @mikebowman

I just did my research for the same question and I got this post, explaining that all IDs in shopify are running numbers. For me that’s the indicator that the line item ID is unique.

hth

Vinh