Out now! Check out the Poll results: Do you have a Shopify store?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: Include properties on a new line item while creating it?

Include properties on a new line item while creating it?

jcbaici
Shopify Partner
9 0 6

Hello,

 

Properties are not listed in the arguments for the orderEditAddVariant mutation (https://shopify.dev/api/admin-graphql/2022-01/mutations/ordereditaddvariant). Is it possible to include line item properties on a new line item when creating it, either with the above mutation or through another endpoint/method?

 

Thanks,

John

Replies 9 (9)

sjz
Visitor
2 0 0

I'm running into the same issue, did you find a solution?

jcbaici
Shopify Partner
9 0 6

Unfortunately, no...

aschweng
Shopify Partner
8 0 0

Did you ever find a solution? I am sure one must exist since there are third party apps that say they can edit the line item properties (they seem to remove the existing product and add it back with the new customAttributes).

jcbaici
Shopify Partner
9 0 6

That's the only workaround I've seen. It's acceptable in some situations, but not in others.

aschweng
Shopify Partner
8 0 0

Do you know how to make that workaround work? I haven’t been able to figure it out but it would work for our situation. 

jcbaici
Shopify Partner
9 0 6

What is your use case? Will the line item have been paid for? Fulfilled?

aschweng
Shopify Partner
8 0 0

This is for existing orders. The line item has not been fulfilled. The credit card payment has been authorized but not captured.

We use the line item properties to store certain custom information, and we sometimes need to change that custom information (and sometimes a customer managers to checkout without filling in that information, so we need to add it to the line items that are missing the information).

We are okay with removing a particular line item and then adding it back again with new line item properties. I just can't seem to figure out how to add a product to an existing order and include line item properties.

jcbaici
Shopify Partner
9 0 6

Actually, I don't see a way to do it properly because a custom line item isn't really a product. In some cases, it may be an option to delete the entire order and recreate it with the properties. We didn't have that option, so our workaround was to put the data on line item discounts on the description property using the orderEditAddLineItemDiscount mutation.

It's worth mentioning that this all could have been avoided by having validation on the front end.

shopappsllc
Shopify Partner
7 0 1

I have the same issue, can someone from Shopify partners chime in here?