Reference to a URL when creating file_reference metafield?

Hi there.

We’re working on a solution that allows uploading images into metafields, however, the documentation is somewhat limited in terms of understanding what would actually be possible with the metafields api.

Our hope here is that we’d be able to send over an image URL from a DAM or CDN, and have this 1) upload the file to Shopify and 2) reference this file.

Is the only possible way to achieve this to upload using the files API, get the gid and then reference that gid when we create the metafield or did anyone succeed in sending over an actual image URL somehow?

2 Likes

Looking for a similar answer! Is this just not possible?

You can do this without GraphQL etc in liquid like so:

{{ product.metafields.namespace.file | file_url }}