Getting Error 404: Not Found for shopify graphql API

Topic summary

A developer is encountering a 404 “Not Found” error when calling Shopify’s APP_SUBSCRIPTION_CREATE GraphQL API from a Django application. The app works correctly with test stores but fails when attempting installation from the Shopify App Store on a production store.

Key Issues Identified:

  • The provided code snippet contains reversed/garbled text, making it difficult to analyze the exact mutation structure
  • A community member suggests the mutation doesn’t match Shopify’s official documentation examples
  • Potential typo in the returnUrl parameter (appears to have an ‘f’ prefix, suggesting a Python f-string formatting issue)
  • Variable input structure may not align with required GraphQL schema

Recommended Actions:

  • Compare mutation structure against Shopify’s official dev docs
  • Verify the returnUrl format and variable inputs
  • Ensure all required fields match the API specification exactly

Status: Awaiting developer response after implementing suggested fixes.

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

I am using django and making an app for shopify my app is published on shopify but not visible on its store. I can easily onboard any test store to my app and everything works smoothly . but recently I made a real store and tried to install my app from the shopify app store url but when it hit APP_SUBSCRIPTION_CREATE graphql API, it gives this error b’{“errors”:“Not Found”}’ HTTP Error 404: Not Found why is this happening

Here is the code for GraphQL API:

variables = {
    "name": obj.name,
    "returnUrl": f"https://{app_url}/shopify/return_url/",
    "test": obj.test,
    "lineItems": [
        {
            "plan": {
                "appUsagePricingDetails": {
                    "terms": obj.terms,
                    "cappedAmount": {
                        "amount": str(obj.capped_amount),
                        "currencyCode": "USD"
                    }
                }
            }
        }
    ]
}
import json

result = graphql_client.execute(APP_SUBSCRIPTION_CREATE, variables)

APP_SUBSCRIPTION_CREATE = """
mutation AppSubscriptionCreate($name: String!, $returnUrl: URL!, $test: Boolean, $lineItems: [AppSubscriptionLineItemInput!]!) {
  appSubscriptionCreate(name: $name, returnUrl: $returnUrl, test: $test, lineItems: $lineItems) {
    userErrors {
      field
      message
    }
    appSubscription {
      id
      lineItems {
        id
        plan {
          pricingDetails
          __typename
        }
      }
    }
    confirmationUrl
  }
}
"""

I am getting the error here
graphql_client.execute(APP_SUBSCRIPTION_CREATE, variables)

Hi Salman116,

There’s a few parts of the mutation that are not matching the example in the dev docs, specifically the variables input - which could be causing this error. It also looks like there could be a typo in the return URL property (an f at the beginning). I’d try to match the example as much as possible and try again.

Hope this helps,