Hi,
I am trying to make a request to add a product using RestSharp and I am getting error Badrequest
“{"errors":{"product":"Required parameter missing or invalid"}}”
I have set Admin API permission [Read/Write] for Products on store settings
also Webhook Version matches with request
{X-Request-ID=6ea097eb-7668-467e-81cc-98a74a910151}
Here is my code ..Please provide some help. Am I missing something in JSON data?
var client = new RestClient(“https://bmswave.myshopify.com/”);
client.Authenticator = new HttpBasicAuthenticator(“xxx”, “xxx”);
https://bmswave.myshopify.com/admin/apps/private
string resource = “/admin/api/2021-10/products.json”;
var requestres = new RestRequest(resource, Method.POST);
StringBuilder postData = new StringBuilder();
postData.Append(“product:{”);
postData.Append(“title:Gloves Small Blk”);
postData.Append(“,”);
postData.Append(“body_html:Gloves Small Blk”);
postData.Append(“,”);
postData.Append(“vendor:BARTON INC”);
postData.Append(“,”);
postData.Append(“product_type:Dressing”);
postData.Append(“}”);
requestres.Method = Method.POST;
requestres.AddJsonBody(postData);
requestres.Parameters.Clear();
requestres.AddHeader(“content-type”, “application/json”);
var response = client.Execute(requestres);