Getting 404 for Updating MetaField using Postman

Solved
sachin16
New Member
7 0 0

Hi,

 

I have a metafield on Shop resource which I am trying to update using Postman. the field type is Integer and I am making the request as below however I am not able to do it and getting the 404 error.

I have retrieved the metafield as - 

{
    "metafields": [
        {
            "id"12305803870293,
            "namespace""global",
            "key""custom-shipping-rate",
            "value"0,
            "value_type""integer",
            "description""source",
            "owner_id"27170275413,
            "created_at""2020-05-15T03:08:40-04:00",
            "updated_at""2020-05-15T03:08:40-04:00",
            "owner_resource""shop",
            "admin_graphql_api_id""gid://shopify/Metafield/12305803870293"
        }
    ]
}
 
Put request body
{
"metafield": {
"id": 12305803870293,
"value": 10,
"value_type": "integer"
}
}
 
Capture.PNG
0 Likes
hassain
Shopify Staff (Retired)
Shopify Staff (Retired)
624 103 135

This is an accepted solution.

Hi @sachin16 ,

 

From your screenshot you are hitting the URL of "...myshopify.com/admin/metafields/33145232974.json" However from the body of your request you are specifying the metafield ID is 12305803870293. So which is the metafield ID, 33145232974 or 12305803870293? These values need to be consistent. My assumption is that Metafield ID 33145232974 does not exist which is why you are getting a 404 'Not Found' error from your request. 

 

If after this update you still are seeing errors, feel free to send me the value of the X-Request-ID response header from the Shopify API error response and I should be able to look into this further

 

Hassain | Developer Support Specialist @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes
sachin16
New Member
7 0 0

Thanks Hassain, I resolved this issue yesterday.

0 Likes