How to Post A product with variants,variants images,product images, options in one request

zhagan
Excursionist
17 1 0

How to Post A product with variants,variants images,product images, options in one request?

Can I make a request as below just in one request ?

Why I can't see the Product image and Variants images  in response

 

 

{
  "product": {
    "title": "Men Shoes Summer Soft Loafers Lazy Shoes Lightweight Cheap Mesh Casual Shoes Men Sneakers Tenis Masculino Zapatillas Hombre",
    "body_html": "<strong>Good snowboard!</strong><IMG src=\"https://ae01.alicdn.com/kf/HTB1feRdUbPpK1RjSZFFq6y5PpXaf.jpg\" />",
    "vendor": "Burton",
    "product_type": "Snowboard",
	  "tags": [
      "Barnesddd Noble", 
      "Big Air"
    ],
	
	"images": [
      {
        "src": "https://ae01.alicdn.com/kf/Hf34a23733f4e426680bf442667dee44fM.jpg"
      }],
	  
    "variants": [
      {
        "option1": "Blue",
        "option2": "155",
		 "price": "111.00",
		 "image_id":28849209311430
      },
      {
        "option1": "Black",
        "option2": "159",
		 "price": "222.00",
		"image_id":28849205248198 ,
	 
      }
    ],
    "options": [
      {
        "name": "Color",
        "values": [
          "Blue",
          "Black"
        ]
      },
      {
        "name": "Size",
        "values": [
          "155",
          "159"
        ]
      }
    ]
  }
}

 

 

Response:

 

{
    "product":{
        "id":6671837167814,
        "title":"Men Shoes Summer Soft Loafers Lazy Shoes Lightweight Cheap Mesh Casual Shoes Men Sneakers Tenis Masculino Zapatillas Hombre",
        "body_html":"<strong>Good snowboard!</strong><img src="https://ae01.alicdn.com/kf/HTB1feRdUbPpK1RjSZFFq6y5PpXaf.jpg">",
        "vendor":"Burton",
        "product_type":"Snowboard",
        "created_at":"2021-05-09T11:30:14+08:00",
        "handle":"men-shoes-summer-soft-loafers-lazy-shoes-lightweight-cheap-mesh-casual-shoes-men-sneakers-tenis-masculino-zapatillas-hombre",
        "updated_at":"2021-05-09T11:30:14+08:00",
        "published_at":"2021-05-09T11:30:14+08:00",
        "template_suffix":null,
        "status":"active",
        "published_scope":"web",
        "tags":"",
        "admin_graphql_api_id":"gid://shopify/Product/6671837167814",
        "variants":[
            {
                "id":39794407669958,
                "product_id":6671837167814,
                "title":"Blue / 155",
                "price":"0.00",
                "sku":"",
                "position":1,
                "inventory_policy":"deny",
                "compare_at_price":null,
                "fulfillment_service":"manual",
                "inventory_management":null,
                "option1":"Blue",
                "option2":"155",
                "option3":null,
                "created_at":"2021-05-09T11:30:14+08:00",
                "updated_at":"2021-05-09T11:30:14+08:00",
                "taxable":true,
                "barcode":null,
                "grams":0,
                "image_id":null,
                "weight":0,
                "weight_unit":"kg",
                "inventory_item_id":41888904970438,
                "inventory_quantity":0,
                "old_inventory_quantity":0,
                "requires_shipping":true,
                "admin_graphql_api_id":"gid://shopify/ProductVariant/39794407669958"
            },
            {
                "id":39794407702726,
                "product_id":6671837167814,
                "title":"Black / 159",
                "price":"0.00",
                "sku":"",
                "position":2,
                "inventory_policy":"deny",
                "compare_at_price":null,
                "fulfillment_service":"manual",
                "inventory_management":null,
                "option1":"Black",
                "option2":"159",
                "option3":null,
                "created_at":"2021-05-09T11:30:14+08:00",
                "updated_at":"2021-05-09T11:30:14+08:00",
                "taxable":true,
                "barcode":null,
                "grams":0,
                "image_id":null,
                "weight":0,
                "weight_unit":"kg",
                "inventory_item_id":41888905003206,
                "inventory_quantity":0,
                "old_inventory_quantity":0,
                "requires_shipping":true,
                "admin_graphql_api_id":"gid://shopify/ProductVariant/39794407702726"
            }
        ],
        "options":[
            {
                "id":8566768763078,
                "product_id":6671837167814,
                "name":"Color",
                "position":1,
                "values":[
                    "Blue",
                    "Black"
                ]
            },
            {
                "id":8566768795846,
                "product_id":6671837167814,
                "name":"Size",
                "position":2,
                "values":[
                    "155",
                    "159"
                ]
            }
        ],
        "images":[

        ],
        "image":null
    }
}

 

0 Likes