MONEI / Shopify-api-node

Node Shopify connector sponsored by MONEI
https://monei.com/shopify-payment-gateway/
MIT License
945 stars 278 forks source link

Can't update product metafield #522

Closed tman16 closed 2 years ago

tman16 commented 2 years ago

I am having issues updating the product metafield, I am using the following:

let params = {metafield: {id: 123456789, value: "new value here", type: "single_line_text_field"}}

await shopify.metafield.update(123456789, params);

The response gives the original value and not what it should be updated to.

lpinca commented 2 years ago

See https://github.com/MONEI/Shopify-api-node#metafields.

Nvm, you are updating a metafield by ID. It should work, I don't know.

lpinca commented 2 years ago

params should be

{id: 123456789, value: "new value here", type: "single_line_text_field"}`

and not

{metafield: {id: 123456789, value: "new value here", type: "single_line_text_field"}}
lpinca commented 2 years ago

I'm closing this as answered.