Great question here, I wanted to share a few insights to get you started. Utilizing the outlined functionality really depends on what stage of an order you plan or need customAttributes attached. For example, if you want to do this after an order has already been completed with the Admin API, the mutation orderUpdate will allow you to add customAttributes via GraphQL. I’d also suggest exploring some of our other resources, Metafields and the Storefront API may provide insights on similar and related functionalities - Cheers!
Looking for the same: A way to update customAttributes of lineItems of an order (not customAttributes of an order) after the order was created in shopify (and probably before fulfilment, but potentially even after…).
A few use-cases for this:
Use-Case 1: Allow customer to customise things AFTER placing an order (in order to not complicate the order-process).
Use-Case 2: Allow customer to make changes to attributes (e.g. a gift or engraving text after placing the order)
Use-Case 3: Let staff make those changes from custom dashboard.
Use-Case 4: Traceability (add product information / id etc. to a product after it was shipped).
Only current work-around I see is to store those custom_attributes for line items of orders in a separate database outside shopify. Not nice though.
We are also looking to update the customAttributes of a line item after the order has been placed. It looks like there are two options:
(1) mutate the LineItemMutable object. Not sure how though. Is there some documentation about how we can accomplish that?
(2) mutate checkoutLineItemsUpdate. https://shopify.dev/api/storefront/2022-01/mutations/checkoutLineItemsUpdate. Again, unsure about how exactly to use the code.