A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
I am using a private app to call the Shopify API successfully for all endpoints except the draft_orders.json using RestSharp.
When I try to POST to the draft_orders.json endpoint it always returns "You are being redirected" with a link to mystore.myshopify.com/password
It looks like other posts related to this error indicate its an authentication error. I have tried authenticating using every approach to no avail...
For all other endpoints I am successfully authenticating using the same method. Why would the draft_orders.json behave differently?
Here is some code showing the approach I am taking for authenticating and making the request:
string strPassword = objComp.ShopifyPassword;
string strAPIToken = objComp.ShopifyAPIToken;
string strShopifyRootUrl = objComp.ShopifyStoreURL;
objDraftOrder.draft_order.customer.id = customer_id;
objDraftOrder.draft_order.line_items = line_items.ToArray();
string strDraftOrderEndpoint = strShopifyRootUrl + "admin/api/" + APIVersion + "/draft_orders.json";
objRequest = new RestSharp.RestRequest(strDraftOrderEndpoint, RestSharp.Method.POST);
objRequest.AddJsonBody(objDraftOrder);
RestSharp.RestClient objClient = new RestSharp.RestClient(strShopifyRootUrl);
objClient.Authenticator = new RestSharp.Authenticators.HttpBasicAuthenticator(strAPIToken, strPassword);
objResponse = GetShopifyResponse(objClient, objRequest);
Does anyone know why I am getting "You are being redirected" and how I can get the draft_orders.json endpoint to work?