Create product issues

Solved
zhagan
Excursionist
17 1 0

I created a product with the follow json contains price,tags and image_id  successfully, and got a response as below.

But I found that the value of price ,tags  ,image in the response are all incorrect .

Anyone knows what causes this?

How to fix this issues?

Thanks.

POST /admin/api/2021-04/products.json

Request

 

 

 

{
  "product": {
    "title": "Burton Custom Freestyle 151",
    "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"
    ],
    "variants": [
      {
        "option1": "Blue",
        "option2": "155",
		 "price": "111.00",
		 "image_id":28849209311430
      },
      {
        "option1": "Black",
        "option2": "159",
		 "price": "222.00",
		"image_id":28849205248198
      }
    ],
    "options": [
      {
        "name": "Colodr",
        "values": [
          "Blue",
          "Black"
        ]
      },
      {
        "name": "Sizse",
        "values": [
          "155",
          "159"
        ]
      }
    ]
  }
}

 

 

 

Response:

 

 

{
    "product":{
        "id":6669606322374,
        "title":"Burton Custom Freestyle 151",
        "body_html":"<strong>Good snowboard!</strong><img src="https://ae01.alicdn.com/kf/HTB1feRdUbPpK1RjSZFFq6y5PpXaf.jpg">",
        "vendor":"Burton",
        "product_type":"Snowboard",
        "created_at":"2021-05-07T23:28:15+08:00",
        "handle":"burton-custom-freestyle-152",
        "updated_at":"2021-05-07T23:28:16+08:00",
        "published_at":"2021-05-07T23:28:15+08:00",
        "template_suffix":null,
        "status":"active",
        "published_scope":"web",
        "tags":"",
        "admin_graphql_api_id":"gid://shopify/Product/6669606322374",
        "variants":[
            {
                "id":39784195162310,
                "product_id":6669606322374,
                "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-07T23:28:15+08:00",
                "updated_at":"2021-05-07T23:28:15+08:00",
                "taxable":true,
                "barcode":null,
                "grams":0,
                "image_id":null,
                "weight":0,
                "weight_unit":"kg",
                "inventory_item_id":41878693183686,
                "inventory_quantity":0,
                "old_inventory_quantity":0,
                "requires_shipping":true,
                "admin_graphql_api_id":"gid://shopify/ProductVariant/39784195162310"
            },
            {
                "id":39784195195078,
                "product_id":6669606322374,
                "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-07T23:28:15+08:00",
                "updated_at":"2021-05-07T23:28:15+08:00",
                "taxable":true,
                "barcode":null,
                "grams":0,
                "image_id":null,
                "weight":0,
                "weight_unit":"kg",
                "inventory_item_id":41878693216454,
                "inventory_quantity":0,
                "old_inventory_quantity":0,
                "requires_shipping":true,
                "admin_graphql_api_id":"gid://shopify/ProductVariant/39784195195078"
            }
        ],
        "options":[
            {
                "id":8564161708230,
                "product_id":6669606322374,
                "name":"Colodr",
                "position":1,
                "values":[
                    "Blue",
                    "Black"
                ]
            },
            {
                "id":8564161740998,
                "product_id":6669606322374,
                "name":"Sizse",
                "position":2,
                "values":[
                    "155",
                    "159"
                ]
            }
        ],
        "images":[

        ],
        "image":null
    }
}

 

 

 

0 Likes
Kevin_A
Shopify Staff
Shopify Staff
310 42 53

Hey @zhagan 

Can you provide the x-request-id response header for a request where you can reproduce this issue? 

Kevin_A | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

zhagan
Excursionist
17 1 0

@Kevin_A 

X-Request-ID: dbd4c0fb-6d63-485a-a5c4-f1c01a14adad

Thanks.

0 Likes
Kevin_A
Shopify Staff
Shopify Staff
310 42 53

This is an accepted solution.

Hey @zhagan 

The request ID you sent me is for a product creation request but there aren't any price details included in the request body. From what I can tell the request you sent me appears to be functioning normally. 

Kevin_A | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

0 Likes