REST Api: Metafield File Reference

Hi all,

I’m having trouble to set the value for a metafield of type file reference. It seems like I’d have to upload the file first somewhere but I couldn’t figure out how to do that via the Rest API.

Would be great if someone could give me a hint!

Best, Rincewind

Hi there!

You will have to use the Admin GraphQL API to upload and create files.

You can read more about it, in the documentation here.
https://shopify.dev/api/admin-graphql/2022-04/mutations/fileCreate