cannot create product with image

jiang_
New Member
1 0 0

Hi,
I have i problem with creating a product with its images using the API 2021-01.
The images array is sometimes empty in the returned result,
Here's my schema tha i send to "https://shopname.myshopify.com/admin/api/2021-01/products.json" :

79918CBB-3A2F-4655-9E2D-F3E2C51837B1.png

return empty images

C395C09F-6DB6-4984-8561-734548012A4F.png

The product is added successfully but without images or image

0 Likes
Greg_Kujawa
Shopify Partner
963 80 204

Using the REST API, I believe you need to first create the new image and then create the new product/variant and assign the image to the new record. With the GraphQL API you can likely create everything all in one shot. Using the REST API, not so much...

0 Likes
HMM100
Tourist
6 0 0

I am a beginner, can you give me an example of code, in order to understand more easily

0 Likes
HMM100
Tourist
6 0 0

can you tell me how to use graphQL create product with images in variant,Can you give me a code example

0 Likes