Need help with discountCodeFreeShippingCreate Mutation

Topic summary

Issue: The author is using the Admin GraphQL mutation discountCodeFreeShippingCreate and can’t find how to attach a function ID or metafields in the mutation input.

Goal: Generate a discount code that grants free shipping only for specific products.

Context: They believe custom logic is possible via Shopify Functions (custom server-side discount logic) and metafields (custom data fields), and are asking whether this can be achieved with this mutation or how to pass function ID/metafields through GraphQL.

References: A Shopify docs link to the mutation is provided and central to the question.

Status: No answers or resolution yet; the request is for guidance on implementing product-specific free shipping via functions/metafields with this mutation.

Summarized with AI on January 12. AI used: gpt-5.

Hi
I am following this doc for : discountCodeFreeShippingCreate mutation

https://shopify.dev/docs/api/admin-graphql/2024-01/mutations/discountCodeFreeShippingCreate
but i cant find a way to apply a function ID andmetafields in GraphQuery.

basically i am developing a logic where i can generate a code to apply free shipping only on some products. On study i found that custom logics are possibble if using shopify functions and metafields.
is there any way to achieve this ?