product : Required parameter missing or invalid

linusvallejo
New Member
2 0 0

I'm trying to build a .Net Core Console app to upload a bunch of products to my store using the API, but I'm getting this:

 

{"errors":{"product":"Required parameter missing or invalid"}}
Unhandled exception. System.Exception: Failed to POST data: (BadRequest): {"errors":{"product":"Required parameter missing or invalid"}}

 

This is my code (Maybe something wrong in the payload?) :

 

Screen Shot 2020-03-10 at 9.19.21 AM.png

 

The thing that confuses me is that the POST works fine through Postman. With that ^ same payload.

 

Thanks in advance for any suggestions/corrections.

 

 

0 Likes
sd_
Shopify Staff (Retired)
Shopify Staff (Retired)
51 10 5

Hey there,

 

From your payload in the screenshot it doesn't seem like anything is missing from the body itself. It's possible that your request isn't correctly being authenticated (i.e. incorrect authentication headers or incorrect formatting). 

 

In the case that you can't determine the source of the error, please provide the request-id header of the response and we can investigate in the logs.

 

Thanks

0 Likes
linusvallejo
New Member
2 0 0
Good afternoon, thanks a lot for your quick response. I just tested a few seconds ago and these are the response headers:



> result.Headers
{Date: Fri, 13 Mar 2020 20:58:20 GMT
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: __cfduid=dc12018119eb8d5e1b124b2bed1df39781584133100; expires=Sun, 12-Apr-20 20:58:20 GMT; path=/; domain=.myshopify.com; HttpOnly; SameSite=Lax
X-Sorting-Hat-PodId: 130
X-Sorting-Hat-ShopId: 34302656643
Referrer-Policy: origin-when-cross-origin
X-Frame-Options: DENY
X-ShopId: 34302656643
X-ShardId: 130
X-Stats-UserId:
X-Stats-ApiClientId: 3504513
X-Stats-ApiPermissionId: 224802799747
X-Shopify-API-Terms: By accessing or using the Shopify API you agree to the Shopify API License and Terms of Use at https://www.shopify.com/legal/api-terms
HTTP_X_SHOPIFY_SHOP_API_CALL_LIMIT: 1/40
X-Shopify-Shop-Api-Call-Limit: 1/40
X-Shopify-API-Version: 2020-01
Strict-Transport-Security: max-age=7889238
X-Shopify-Stage: production
Content-Security-Policy: default-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval' https://* shopify-pos://*; block-all-mixed-content; child-src 'self' https://* shopify-pos://*; connect-src 'self' wss://* https://*; frame-ancestors 'none'; img-src 'self' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopify.cn https://checkout.shopifycs.com https://js-agent.newrelic.com https://bam.nr-data.net https://api.stripe.com https://mpsnare.iesnare.com https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com https://v.shopify.com https://widget.intercom.io https://js.intercomcdn.com 'self' 'unsafe-inline' 'unsafe-eval'; upgrade-insecure-requests; report-uri /csp-report?source%5Baction%5D=create&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fproducts&source%5Bsection%5D=admin_api&source%5Buuid%5D=10ce2e72-036b-4a92-ac57-0faa7aeca935
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
X-XSS-Protection: 1; mode=block; report=/xss-report?source%5Baction%5D=create&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fproducts&source%5Bsection%5D=admin_api&source%5Buuid%5D=10ce2e72-036b-4a92-ac57-0faa7aeca935
X-Dc: gcp-us-east1,gcp-us-central1,gcp-us-central1
X-Request-ID: 10ce2e72-036b-4a92-ac57-0faa7aeca935
CF-Cache-Status: DYNAMIC
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Server: cloudflare
CF-RAY: 5738ac25fd189ae8-DFW
Alt-Svc: h3-27=":443"; ma=86400, h3-25=":443"; ma=86400, h3-24=":443"; ma=86400, h3-23=":443"; ma=86400
}
AcceptRanges: {}
Age: (null)
CacheControl: (null)
Connection: {keep-alive}
ConnectionClose: (null)
Date: {3/13/2020 8:58:20 PM +00:00}
ETag: (null)
Location: (null)
Pragma: {}
ProxyAuthenticate: {}
RetryAfter: (null)
Server: {cloudflare}
Trailer: {}
TransferEncoding: {chunked}
TransferEncodingChunked: true
Upgrade: {}
Vary: {}
Via: {}
Warning: {}
WwwAuthenticate: {}
Non-Public members:
Results View: Expanding the Results View will enumerate the IEnumerable
>
0 Likes
yalk
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"}}

 

0 Likes