shopify admin api create product : Required parameter missing or invalid

Solved
Highlighted
New Member
5 0 0

Hello, I call the Shopify interface to create a product. The error is as follows. What is the reason?

json params:

{"title":"Sleeveless Stripe Knit Top","body_html":"<p>Style: Casual<br\/>Color: White\/Mixcolor\/Mixcolor1\/Mixcolor2\/Mixcolor3\/Pink\/Blue\/Gray<br\/>Fabric Content: Polyester<br\/>Fit Type: Regular<br\/>Neckline: Round Neck<br\/>Sleeve Length: Sleeveless<br\/>Design: Stripe<\/p>","vendor":"lovelyerica","product_type":"Knits","tags":",Women,Tops,Knits,,White,Mixcolor,Mixcolor1,Mixcolor2,Mixcolor3,Pink,Blue,Gray,S,M,L,XL","metafields_global_title_tag":"","metafields_global_description_tag":"","images":[{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-004870.jpg"},{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-000701.jpg"},{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-002451.jpg"},{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-003824.jpg"},{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-001539.jpg"},{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-008402.jpg"},{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-006357.jpg"},{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-007178.jpg"},{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-005278.jpg"},{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-009432.jpg"},{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-013193.jpg"},{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-011819.jpg"},{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-012439.jpg"},{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-010871.jpg"},{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-014944.jpg"},{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-017201.jpg"},{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-016236.jpg"},{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-015208.jpg"},{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-018970.jpg"},{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-019633.jpg"},{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-022662.jpg"},{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-021528.jpg"},{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-020809.jpg"},{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-023454.jpg"},{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-028475.jpg"},{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-025132.jpg"},{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-026781.jpg"},{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-027543.jpg"},{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-024778.jpg"},{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-033921.jpg"},{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-030569.jpg"},{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-031177.jpg"},{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-032816.jpg"},{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-029376.jpg"},{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-034901.jpg"},{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-035686.jpg"},{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-036200.jpg"},{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-037259.jpg"},{"src":"http:\/\/pdm.emmiol.cn\/goodsIMG\/202007\/10964-038765.jpg"}],"options":[{"name":"Color","values":["Mixcolor","White","Mixcolor1","Mixcolor2","Mixcolor3","Pink","Blue","Gray"]},{"name":"Size","values":["S","M","L","XL"]}],"variants":[{"option1":"Mixcolor","option2":"S","sku":"FAG0235TO005S","barcode":"005","inventory_management":"shopify","inventory_quantity":"999","inventory_policy":"continue","weight_unit":"kg","weight":"0.250","requires_shipping":true,"price":"29.99","compare_at_price":"29.99","presentment_prices":{"price":{"currency_code":"USD","amount":"29.99"},"compare_at_price":{"currency_code":"USD","amount":"29.99"}}},{"option1":"White","option2":"S","sku":"FAG0235TO001S","barcode":"001","inventory_management":"shopify","inventory_quantity":"999","inventory_policy":"continue","weight_unit":"kg","weight":"0.250","requires_shipping":true,"price":"29.99","compare_at_price":"29.99","presentment_prices":{"price":{"currency_code":"USD","amount":"29.99"},"compare_at_price":{"currency_code":"USD","amount":"29.99"}}},{"option1":"White","option2":"M","sku":"FAG0235TO002M","barcode":"002","inventory_management":"shopify","inventory_quantity":"999","inventory_policy":"continue","weight_unit":"kg","weight":"0.250","requires_shipping":true,"price":"29.99","compare_at_price":"29.99","presentment_prices":{"price":{"currency_code":"USD","amount":"29.99"},"compare_at_price":{"currency_code":"USD","amount":"29.99"}}},{"option1":"White","option2":"L","sku":"FAG0235TO003L","barcode":"003","inventory_management":"shopify","inventory_quantity":"999","inventory_policy":"continue","weight_unit":"kg","weight":"0.250","requires_shipping":true,"price":"29.99","compare_at_price":"29.99","presentment_prices":{"price":{"currency_code":"USD","amount":"29.99"},"compare_at_price":{"currency_code":"USD","amount":"29.99"}}},{"option1":"White","option2":"XL","sku":"FAG0235TO004XL","barcode":"004","inventory_management":"shopify","inventory_quantity":"999","inventory_policy":"continue","weight_unit":"kg","weight":"0.250","requires_shipping":true,"price":"29.99","compare_at_price":"29.99","presentment_prices":{"price":{"currency_code":"USD","amount":"29.99"},"compare_at_price":{"currency_code":"USD","amount":"29.99"}}},{"option1":"Mixcolor","option2":"M","sku":"FAG0235TO006M","barcode":"006","inventory_management":"shopify","inventory_quantity":"999","inventory_policy":"continue","weight_unit":"kg","weight":"0.250","requires_shipping":true,"price":"29.99","compare_at_price":"29.99","presentment_prices":{"price":{"currency_code":"USD","amount":"29.99"},"compare_at_price":{"currency_code":"USD","amount":"29.99"}}},{"option1":"Mixcolor","option2":"L","sku":"FAG0235TO007L","barcode":"007","inventory_management":"shopify","inventory_quantity":"999","inventory_policy":"continue","weight_unit":"kg","weight":"0.250","requires_shipping":true,"price":"29.99","compare_at_price":"29.99","presentment_prices":{"price":{"currency_code":"USD","amount":"29.99"},"compare_at_price":{"currency_code":"USD","amount":"29.99"}}},{"option1":"Mixcolor","option2":"XL","sku":"FAG0235TO008XL","barcode":"008","inventory_management":"shopify","inventory_quantity":"999","inventory_policy":"continue","weight_unit":"kg","weight":"0.250","requires_shipping":true,"price":"29.99","compare_at_price":"29.99","presentment_prices":{"price":{"currency_code":"USD","amount":"29.99"},"compare_at_price":{"currency_code":"USD","amount":"29.99"}}},{"option1":"Mixcolor1","option2":"S","sku":"FAG0235TO009S","barcode":"009","inventory_management":"shopify","inventory_quantity":"999","inventory_policy":"continue","weight_unit":"kg","weight":"0.250","requires_shipping":true,"price":"29.99","compare_at_price":"29.99","presentment_prices":{"price":{"currency_code":"USD","amount":"29.99"},"compare_at_price":{"currency_code":"USD","amount":"29.99"}}},{"option1":"Mixcolor1","option2":"M","sku":"FAG0235TO010M","barcode":"010","inventory_management":"shopify","inventory_quantity":"999","inventory_policy":"continue","weight_unit":"kg","weight":"0.250","requires_shipping":true,"price":"29.99","compare_at_price":"29.99","presentment_prices":{"price":{"currency_code":"USD","amount":"29.99"},"compare_at_price":{"currency_code":"USD","amount":"29.99"}}},{"option1":"Mixcolor1","option2":"L","sku":"FAG0235TO011L","barcode":"011","inventory_management":"shopify","inventory_quantity":"999","inventory_policy":"continue","weight_unit":"kg","weight":"0.250","requires_shipping":true,"price":"29.99","compare_at_price":"29.99","presentment_prices":{"price":{"currency_code":"USD","amount":"29.99"},"compare_at_price":{"currency_code":"USD","amount":"29.99"}}},{"option1":"Mixcolor1","option2":"XL","sku":"FAG0235TO012XL","barcode":"012","inventory_management":"shopify","inventory_quantity":"999","inventory_policy":"continue","weight_unit":"kg","weight":"0.250","requires_shipping":true,"price":"29.99","compare_at_price":"29.99","presentment_prices":{"price":{"currency_code":"USD","amount":"29.99"},"compare_at_price":{"currency_code":"USD","amount":"29.99"}}},{"option1":"Mixcolor2","option2":"S","sku":"FAG0235TO013S","barcode":"013","inventory_management":"shopify","inventory_quantity":"999","inventory_policy":"continue","weight_unit":"kg","weight":"0.250","requires_shipping":true,"price":"29.99","compare_at_price":"29.99","presentment_prices":{"price":{"currency_code":"USD","amount":"29.99"},"compare_at_price":{"currency_code":"USD","amount":"29.99"}}},{"option1":"Mixcolor2","option2":"M","sku":"FAG0235TO014M","barcode":"014","inventory_management":"shopify","inventory_quantity":"999","inventory_policy":"continue","weight_unit":"kg","weight":"0.250","requires_shipping":true,"price":"29.99","compare_at_price":"29.99","presentment_prices":{"price":{"currency_code":"USD","amount":"29.99"},"compare_at_price":{"currency_code":"USD","amount":"29.99"}}},{"option1":"Mixcolor2","option2":"L","sku":"FAG0235TO015L","barcode":"015","inventory_management":"shopify","inventory_quantity":"999","inventory_policy":"continue","weight_unit":"kg","weight":"0.250","requires_shipping":true,"price":"29.99","compare_at_price":"29.99","presentment_prices":{"price":{"currency_code":"USD","amount":"29.99"},"compare_at_price":{"currency_code":"USD","amount":"29.99"}}},{"option1":"Mixcolor2","option2":"XL","sku":"FAG0235TO016XL","barcode":"016","inventory_management":"shopify","inventory_quantity":"999","inventory_policy":"continue","weight_unit":"kg","weight":"0.250","requires_shipping":true,"price":"29.99","compare_at_price":"29.99","presentment_prices":{"price":{"currency_code":"USD","amount":"29.99"},"compare_at_price":{"currency_code":"USD","amount":"29.99"}}},{"option1":"Mixcolor3","option2":"S","sku":"FAG0235TO017S","barcode":"017","inventory_management":"shopify","inventory_quantity":"999","inventory_policy":"continue","weight_unit":"kg","weight":"0.250","requires_shipping":true,"price":"29.99","compare_at_price":"29.99","presentment_prices":{"price":{"currency_code":"USD","amount":"29.99"},"compare_at_price":{"currency_code":"USD","amount":"29.99"}}},{"option1":"Mixcolor3","option2":"M","sku":"FAG0235TO018M","barcode":"018","inventory_management":"shopify","inventory_quantity":"999","inventory_policy":"continue","weight_unit":"kg","weight":"0.250","requires_shipping":true,"price":"29.99","compare_at_price":"29.99","presentment_prices":{"price":{"currency_code":"USD","amount":"29.99"},"compare_at_price":{"currency_code":"USD","amount":"29.99"}}},{"option1":"Mixcolor3","option2":"L","sku":"FAG0235TO019L","barcode":"019","inventory_management":"shopify","inventory_quantity":"999","inventory_policy":"continue","weight_unit":"kg","weight":"0.250","requires_shipping":true,"price":"29.99","compare_at_price":"29.99","presentment_prices":{"price":{"currency_code":"USD","amount":"29.99"},"compare_at_price":{"currency_code":"USD","amount":"29.99"}}},{"option1":"Mixcolor3","option2":"XL","sku":"FAG0235TO020XL","barcode":"020","inventory_management":"shopify","inventory_quantity":"999","inventory_policy":"continue","weight_unit":"kg","weight":"0.250","requires_shipping":true,"price":"29.99","compare_at_price":"29.99","presentment_prices":{"price":{"currency_code":"USD","amount":"29.99"},"compare_at_price":{"currency_code":"USD","amount":"29.99"}}},{"option1":"Pink","option2":"S","sku":"FAG0235TO021S","barcode":"021","inventory_management":"shopify","inventory_quantity":"999","inventory_policy":"continue","weight_unit":"kg","weight":"0.250","requires_shipping":true,"price":"29.99","compare_at_price":"29.99","presentment_prices":{"price":{"currency_code":"USD","amount":"29.99"},"compare_at_price":{"currency_code":"USD","amount":"29.99"}}},{"option1":"Pink","option2":"M","sku":"FAG0235TO022M","barcode":"022","inventory_management":"shopify","inventory_quantity":"999","inventory_policy":"continue","weight_unit":"kg","weight":"0.250","requires_shipping":true,"price":"29.99","compare_at_price":"29.99","presentment_prices":{"price":{"currency_code":"USD","amount":"29.99"},"compare_at_price":{"currency_code":"USD","amount":"29.99"}}},{"option1":"Pink","option2":"L","sku":"FAG0235TO023L","barcode":"023","inventory_management":"shopify","inventory_quantity":"999","inventory_policy":"continue","weight_unit":"kg","weight":"0.250","requires_shipping":true,"price":"29.99","compare_at_price":"29.99","presentment_prices":{"price":{"currency_code":"USD","amount":"29.99"},"compare_at_price":{"currency_code":"USD","amount":"29.99"}}},{"option1":"Pink","option2":"XL","sku":"FAG0235TO024XL","barcode":"024","inventory_management":"shopify","inventory_quantity":"999","inventory_policy":"continue","weight_unit":"kg","weight":"0.250","requires_shipping":true,"price":"29.99","compare_at_price":"29.99","presentment_prices":{"price":{"currency_code":"USD","amount":"29.99"},"compare_at_price":{"currency_code":"USD","amount":"29.99"}}},{"option1":"Blue","option2":"S","sku":"FAG0235TO025S","barcode":"025","inventory_management":"shopify","inventory_quantity":"999","inventory_policy":"continue","weight_unit":"kg","weight":"0.250","requires_shipping":true,"price":"29.99","compare_at_price":"29.99","presentment_prices":{"price":{"currency_code":"USD","amount":"29.99"},"compare_at_price":{"currency_code":"USD","amount":"29.99"}}},{"option1":"Blue","option2":"M","sku":"FAG0235TO026M","barcode":"026","inventory_management":"shopify","inventory_quantity":"999","inventory_policy":"continue","weight_unit":"kg","weight":"0.250","requires_shipping":true,"price":"29.99","compare_at_price":"29.99","presentment_prices":{"price":{"currency_code":"USD","amount":"29.99"},"compare_at_price":{"currency_code":"USD","amount":"29.99"}}},{"option1":"Blue","option2":"L","sku":"FAG0235TO027L","barcode":"027","inventory_management":"shopify","inventory_quantity":"999","inventory_policy":"continue","weight_unit":"kg","weight":"0.250","requires_shipping":true,"price":"29.99","compare_at_price":"29.99","presentment_prices":{"price":{"currency_code":"USD","amount":"29.99"},"compare_at_price":{"currency_code":"USD","amount":"29.99"}}},{"option1":"Blue","option2":"XL","sku":"FAG0235TO028XL","barcode":"028","inventory_management":"shopify","inventory_quantity":"999","inventory_policy":"continue","weight_unit":"kg","weight":"0.250","requires_shipping":true,"price":"29.99","compare_at_price":"29.99","presentment_prices":{"price":{"currency_code":"USD","amount":"29.99"},"compare_at_price":{"currency_code":"USD","amount":"29.99"}}},{"option1":"Gray","option2":"S","sku":"FAG0235TO029S","barcode":"029","inventory_management":"shopify","inventory_quantity":"999","inventory_policy":"continue","weight_unit":"kg","weight":"0.250","requires_shipping":true,"price":"29.99","compare_at_price":"29.99","presentment_prices":{"price":{"currency_code":"USD","amount":"29.99"},"compare_at_price":{"currency_code":"USD","amount":"29.99"}}},{"option1":"Gray","option2":"M","sku":"FAG0235TO030M","barcode":"030","inventory_management":"shopify","inventory_quantity":"999","inventory_policy":"continue","weight_unit":"kg","weight":"0.250","requires_shipping":true,"price":"29.99","compare_at_price":"29.99","presentment_prices":{"price":{"currency_code":"USD","amount":"29.99"},"compare_at_price":{"currency_code":"USD","amount":"29.99"}}},{"option1":"Gray","option2":"L","sku":"FAG0235TO031L","barcode":"031","inventory_management":"shopify","inventory_quantity":"999","inventory_policy":"continue","weight_unit":"kg","weight":"0.250","requires_shipping":true,"price":"29.99","compare_at_price":"29.99","presentment_prices":{"price":{"currency_code":"USD","amount":"29.99"},"compare_at_price":{"currency_code":"USD","amount":"29.99"}}},{"option1":"Gray","option2":"XL","sku":"FAG0235TO032XL","barcode":"032","inventory_management":"shopify","inventory_quantity":"999","inventory_policy":"continue","weight_unit":"kg","weight":"0.250","requires_shipping":true,"price":"29.99","compare_at_price":"29.99","presentment_prices":{"price":{"currency_code":"USD","amount":"29.99"},"compare_at_price":{"currency_code":"USD","amount":"29.99"}}}]}

response header:

shopify-error.png

response body:  {"errors":{"product":"Required parameter missing or invalid"}}

Some products report other errors:

Request failed with HTTP Code 502.

Request failed with HTTP Code 520.

Request failed with HTTP Code 524.

Request failed with HTTP Code 503.

0 Likes
Highlighted
Shopify Staff
Shopify Staff
58 6 9

This is an accepted solution.

Hey @yalk,

The format of your JSON payload should have a top-level "product" object, as indicated in the error response.

e.g. this example:

{
  "product": {
    "title": "Burton Custom Freestyle 151",
    "body_html": "<strong>Good snowboard!</strong>",
    "vendor": "Burton",
    "product_type": "Snowboard",
    "metafields": [
      {
        "key": "new",
        "value": "newvalue",
        "value_type": "string",
        "namespace": "global"
      }
    ]
  }
}

Callum | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes
Highlighted
New Member
5 0 0

Yes, there is a problem with the above request parameters. Sometimes I ask the interface to publish the product. The following errors will be returned. What are the reasons?

Request failed with HTTP Code 502.
Request failed with HTTP Code 520.
Request failed with HTTP Code 524.
Request failed with HTTP Code 503.

0 Likes
Highlighted
New Member
5 0 0

Interface using PHP curl request

0 Likes