Hi Masters,
I have an issue about using Admin API for creating products via API. Let me detail,
In .Net Standard 2.0 project,
I confirmed that access token is working with listing top 5 products. So all neccesseray setup has been done about creating custom app, installing to shopify store, editing required scopes and so on.
For listing I used that link;
HTTP GET https://mystorename.myshopify.com/admin/api/2022-10/products.json?limit=5
After that I try to create a simple product via API with this setup,
HTTP POST https://mystorename.myshopify.com/admin/api/2022-10/products.json
Sample request 1:
{“product”:{“title”:“TEST Sample Product”,“body_html”:“Good product!”,“vendor”:“KALEM”,“product_type”:“SamplePrd”,“tags”:[“Kalem”,“Yazılım”,“VenutERP”],“variants”:null}}
Sample request 2:
{“product”:{“title”:“TEST Sample Product”,“body_html”:“Good product!”,“vendor”:“KALEM”,“product_type”:“SamplePrd”,“tags”:[“Kalem”,“Yazılım”,“VenutERP”]}}
Both of two request is returning with HTTP 429 Too many request ( Believe me I am not trigger twice in a second )
And detail;
{“errors”:{“product”:[“Daily variant creation limit reached. Please try again later. See https://help.shopify.com/api/getting-started/api-call-limit for more information about rate limits and how to avoid them.”]}}
I have two idea about my issue;
First, I have a developer account for that store and a mechanism outside of me is really created 1000 variant today. ( But this is low probability situation )
Second, there is a miss documentation about requested data should contain some other mandatory information, via header or via body.
Could you please help me?
Code level detail;
var url = “https://mystorename.myshopify.com/admin/api/2022-10/products.json”;
string json = JsonConvert.SerializeObject(productPostModel);
StringContent data = new StringContent(json, Encoding.UTF8, “application/json”);
HttpRequestMessage msg = new HttpRequestMessage(HttpMethod.Post, url);
msg.Headers.Add(“X-Shopify-Access-Token”, “myaccesstoken”);
msg.Content = data;
HttpResponseMessage res = await client.SendAsync(msg);
string createdShopifyProductJsonData = await res.Content.ReadAsStringAsync();