Metafields on line items?

Hey all, I am trying to set a custom metafield on an order LineItem. However, I keep getting an invalid id error. I’ve successfully created custom metafields on orders and products.

Are custom metafields supported on LineItems? Has anyone had success with this?

1 Like

Hey @softwareguy

The lineItem object doesn’t currently support metafields: LineItem - GraphQL Admin. The closest alternative would be to store your data as an order-level metafield instead: Order - GraphQL Admin.

I’m curious about your specific use case for wanting line item metafields. If you’re willing to share more details about what you’re trying to accomplish, I’d be happy to pass that along as a feature suggestion.

For reference, here’s the full list of supported metafield owner types in the Admin API: