Hi @Paul112 ![]()
The metafieldDefinitionCreate mutation be formatted as follows:
Query:
mutation ($md: MetafieldDefinitionInput!) {
metafieldDefinitionCreate(definition: $md) {
createdDefinition {
key
name
namespace
type {
name
}
}
}
}
With variables:
{
"md": {
"key": "foo",
"name": "bar",
"namespace": "test",
"ownerType": "PRODUCT",
"pin": true,
"type": "boolean",
"visibleToStorefrontApi": true
}
}
The following is an example CURL request that can be extrapolate to your VBA code:
curl -L -X POST 'https://YOUR_STORE_NAME.myshopify.com/admin/api/2023-01/graphql.json' \
-H 'X-Shopify-Access-Token: YOUR_ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
--data-raw '{"query":"mutation ($md: MetafieldDefinitionInput!) {\n metafieldDefinitionCreate(definition: $md) {\n createdDefinition {\n key\n name\n namespace\n type {\n name\n }\n }\n }\n}\n","variables":{"md":{"key":"foo","name":"bar","namespace":"test","ownerType":"PRODUCT","pin":true,"type":"boolean","visibleToStorefrontApi":true}}}'
Hope that helps!