Performing some tests/research on draft orders using webhooks and I noticed that if one adds a line item to an existing draft order the previous line items’ IDs change Doing a bit of searching and I found a couple of posts that imply this is expected behavior:
Hi @sshaw this is expected. draftOrderUpdate replaces the whole lineItems array rather than patching it, so every line item is recreated with a new ID on each update, and anything you leave out of the array disappears. We stopped storing those IDs anywhere and key on our own value written into the line item customAttributes instead, which also carries into the order line item properties once the draft is completed. Agreed it should be called out in the docs, the mutation reads like a patch and behaves like a replace.