customAttributes of LineItemMutable

raychoi
New Member
2 0 0

We are trying to add some key/value pairs under order's line item objects.

 

The closest things we could find in the API spec is the customAttributes under LineItemMutable:

raychoi_0-1636598960742.png

 

We could get the field by using graphQL

raychoi_1-1636599134666.png

 

However, we can't find any mutation query for updating this field.

May i know if this field can be created/updated through API (Both graphQL or Restful API is OK), thanks.

Replies 2 (2)
awwdam
Shopify Staff
172 31 17

Hey @raychoi,

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!

awwdam | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

raychoi
New Member
2 0 0

Thanks for your reply.

We checked mutation orderUpdate before, but what we really want is update/create the customAttributes of LineItemMutable object.

May i know if any API could do so?