I’m using the Shopify SDK ‘Shopiy-API-Node‘ and wonder how to get metafields of a smart collections ?
The Shopify api says:
GET /admin/collections/#{id}/metafields.json
Also, from NodeJS I use :
shopify.metafield.list(
{
metafield: {
owner_resource: 'COLLECTION',
owner_id: '4576719568993'
}
}
);
But it returns a 404, while I’m sure there are Metafields datas, as the Shopify Api returns the Metafields if queried without the SDK.
Cheers
Alan
2
Answers
I managed to make it work this way :
You have to use "collectionS".
You might be getting an empty response because you are only entitled to get metafields your API key created. If you have not used your API key to attach a metafield to a collection, then [] is correct.