Trying to test the Put Api in postman , this put api is used update a product, here’s the curl of it as per the document,
curl -d ‘{“product”:{“id”:632910392,“metafields”:[{“key”:“new”,“value”:“newvalue”,“type”:“single_line_text_field”,“namespace”:“global”}]}}’
-X PUT “https://your-development-store.myshopify.com/admin/api/2023-10/products/632910392.json”
-H “X-Shopify-Access-Token: {access_token}”
-H “Content-Type: application/json”
Now instead of type : “single_line_text_field”, i want to use type : " list.single_line_text_field" and here’s how the body of put api is , but i get the error stating
“errors”: {
“value”: “expected Array to be a string”
}
But as per the document for the type :list.single_line_text_field, the value should be framed like below, and i have done the same, can you help here!
[
"VIP shipping method",
"Standard shipping method"
]
The URL is
https://e83a4c-2.myshopify.com/admin/api/2021-07/products/8436655128805.json
BODY is :
{
“product”: {
“id”: 8436655128805,
“metafields”: [
{
“key”: “lily-1”,
“type”: “list.single_line_text_field”,
“value”: [“VIP shipping method”, “Standard shipping method”],
“namespace”: “lily”
}
]
}
}