We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Re: Add Files (not images) to product with GraphQL API

Add Files (not images) to product with GraphQL API

PhiWu
Shopify Partner
1 0 0
Hi,

I use GraphQL API to create collections and products. I know how to create images and add these images to a product. I also would like to add some pdfs to a product. To create a file, I use the mutation fileCreate. But how do I link this file to a product. I can't find any product-id field.

Thank you.
Reply 1 (1)

GrantDB
Shopify Partner
82 3 15

Don't suppose you work this out did you?  The ability to use the filename of files is important to me, so I like using that rather than productCreateMedia

 

Update: I thin this is one way to do it: https://community.shopify.com/c/graphql-basics-and/uploading-files-to-shopify-and-attaching-them-to-...

 

Thanks

 

Grant