Graph QL Admin API: The HTTP request failed with status code NotFound

Topic summary

Issue: Users encounter HTTP 404 “NotFound” errors when querying Shopify’s GraphQL Admin API, despite having proper scopes configured. The error occurs inconsistently—working in development stores but failing in production/client stores.

Root Cause Identified: The problem stems from using custom domains instead of the required {shop}.myshopify.com format for GraphQL endpoints. While custom domains work with the REST Admin API, they are incompatible with GraphQL.

Key Details:

  • The same query succeeds in Shopify’s GraphiQL app, confirming the endpoint and scopes are valid
  • Error is URL-related rather than permissions-based (scope issues would return access errors, not 404s)
  • REST API accepts custom domains without issues, but GraphQL specifically requires the .myshopify.com format

Status: Resolved for the original poster after switching to the standard Shopify domain. Another user confirms experiencing the same limitation and questions whether this is intentional behavior or if a workaround exists beyond reverting to REST API.

Summarized with AI on November 11. AI used: claude-sonnet-4-5-20250929.

Hi community,

I’m experiencing issues when trying to retrieve information from the localizationExtensions object of a request using the GraphQL API in a C# application. To access the API, I’m utilizing the GraphQL.Client package available on NuGet.

The error I receive when requesting the data is: “The HTTP request failed with status code ‘NotFound’”.

What leads me to suspect that the problem may not lie within my application is the fact that I have two Shopify stores. One of them is dedicated to development and is somewhat “raw,” with no apps except for the development one. This development store contains the Admin API with the necessary scopes enabled. Let’s refer to it as the development store. Additionally, there is the client’s store with the Admin API app, which has the same selected scopes but in a more commercial environment and is considered the “active” store.

In my development store, I can consume the GraphQL API without any issues. However, the error only occurs in the client’s store.

In the client’s store, I installed the Shopify GraphiQL app, which allows me to execute queries within the platform itself. I attempted to make the same query that I used in my application and succeeded, indicating that the endpoint exists in some way for the order ID I’m attempting to query.

Could the account I used to create the API app be a factor in this? I’m asking because I observed that some scopes are locked in the selection of Admin API access scope for the user I used to create the client’s app on Shopify.

Has anyone encountered a similar issue or knows how to assist me?

Here is my code:

public OrderTaxIdService(string shopifyUrl, string accessToken)
{
    _graphQLClient = new GraphQLHttpClient($"{shopifyUrl}/admin/api/2023-07/graphql.json", new NewtonsoftJsonSerializer());
    _graphQLClient.HttpClient.DefaultRequestHeaders.Add("X-Shopify-Access-Token", accessToken);
}

public async Task<string> GetAsync(string adminGraphQLAPIId)
{
    var orderRequest = new GraphQLRequest
    {
        Query = @"
        query getOrder($id: ID!) {
            order(id: $id) {
            id
            localizationExtensions(first: 1) {
                edges {
                node {
                    title
                    value
                }
                }
            }
            }
        }",
        Variables = new { id = adminGraphQLAPIId }
    };

    var orderResponse = await _graphQLClient.SendQueryAsync<OrderResponseType>(orderRequest);

    var node = orderResponse.Data.Order.LocalizationExtensions.Edges.FirstOrDefault(e => e.Node.Title == "CPF/CNPJ");

    return node?.Node.Value ?? string.Empty;
}

Query:

{
    order(id: "gid://shopify/Order/5508188832050") {
	    id
	    localizationExtensions(first: 1) {
	        edges {
	        node {
	            title
	            value
	        }
	        }
	    }
    }
}

Many thanks for your support.

If there was an issue with the scopes you would expect to get an error stating that you do not have access to that resource, not that the resource is not found.

To debug this I would first suggest confirming that the URL is being built correctly. E.g. Is there an extra ending '' character that is on the shopifyUrl of the live store?

I would also suggest trying to query for all orders. This would confirm that you do have access to the order resource, so there may be an issue with the specific ID that you are using.

1 Like

I identified the problem. Your suggestion about the URL was right. Actually, I was trying to use the custom domain instead of {shop}.myshopify.com. For some unknown reason, I can use my domain for the Admin API without any issues, but the same does not work with GraphQL.

Thank you for your time and guidance.

1 Like

+1 to this, I’m able to query the Admin api with the REST client but the GraphQL client does not work for me. I keep getting the 404. Is this intended? Is there a workaround here or should I just use the rest API?

1 Like