To Understand the value_type field deprecation for metafields

Sankeerthana
Shopify Partner
15 0 1

Shopify metafields API has a field value_type which is deprecated and replaced by type in API version 2021-07.
But when trying it via POSTMAN to create the metafields we are facing issue with an error value_type field should be present for the particular namespace and key.

Request Body :

{
"product": {
"metafields": [
{
"key": "integer",
"value": 8745623,
"type": "integer",
"namespace": "product"
}
]
}
}


The API version we used here is 2021-07.
Ideally It should not cause any issue. Not sure the field is actually deprecated or not,
If deprecated when? and why it is still expecting as a mandatory field to be present in the metafieldsAdding metafields to the customer APIAdding metafields to the customer API

Replies 3 (3)

Dave_Pelletier
Shopify Staff (Retired)
27 3 5

Hi Sankeerthana, can you please take a look at this thread: https://community.shopify.com/c/Shopify-APIs-SDKs/AdminAPI-REST-Reference-New-type-property-in-the-m...

To learn more visit the Shopify Help Center or the Community Blog.

Sankeerthana
Shopify Partner
15 0 1
Hi Dave_Pelletier,

The issue is not only happening for products/{{product_id}}/metafields.json
endpoint but also when trying to add metafields for customers endpoint as
well,
Can you please ensure us when this value_type won't be a mandatory field to
set the dataType, when will that actually get deprecated?

We are actually making the latest changes in our integrations with the
latest API changes after the deprecation. So, want to know exactly when the
value_type gets deprecated.
Please let me know if anything required from my side
Thanks for the early response

Attaching screenshot for adding customer metafields
Dave_Pelletier
Shopify Staff (Retired)
27 3 5

Hi , I can't give an exact timeline but we're working on addressing this issue for all resource endpoints as soon as possible. Once the fix is live, value_type will be properly deprecated for all endpoints that set metafields.

To learn more visit the Shopify Help Center or the Community Blog.