GraphQL "Function not found." when trying to setup custom app ['discountAutomaticAppCreate']

Topic summary

Issue: “Function not found” when invoking the GraphQL mutation discountAutomaticAppCreate for a custom discount Function.

Key updates:

  • Versioning: The mutation is available starting with Admin API 2022-07. Using an older API version causes the error.
  • Token/app scope: Calls may work in the Shopify Admin GraphQL app but fail in Postman if the access token doesn’t belong to the same app that owns the Function. Guidance: use an offline access token for the same app.
  • Cross-app limitation: By design, Functions cannot be referenced across apps. A Function created in App1 cannot be used by App2; attempts to create discounts from another app will fail.

Open question:

  • A user asked where to obtain the “API Key”; the thread reiterates using the same app’s offline token but does not provide step-by-step instructions.

Outcome/status:

  • Conceptually resolved. Action items: ensure API version ≥ 2022-07, use the same app’s offline access token in external clients (e.g., Postman), and avoid cross-app usage since interdependency is not supported.
Summarized with AI on January 18. AI used: gpt-5.

Hi,

I’m currently trying to configure my custom app for a client and set up the ‘discountAutomaticAppCreate’, however receiving the ‘Function not found’ error message.

Does anyone have a workaround for this?

Thanks,

Charlie

1 Like

Did you solve your problem? I have the same problem.

Hi @charlie_s ,

Thanks for your post. The discountAutomaticAppCreate mutation doesn’t exist until the 2022-07 version of the Admin API so ensuring you’re using at least that version in the URL could help avoid the ‘Function not found’ error message.

Hope you have a great day,
Jon551

I am using 2023-04 version or 2023-07 version. the discountAutomaticAppCreate mutation runs successfully in shopify admin graphql app, but return ‘Function not found’ error message in postman or other platform. Can you help me to resolve it ?

Hi @guimei perhaps the accepted solution from this post, will work for you also. "An app can only reference its own functions. That is, when invoking discountAutomaticAppCreate, the API Key used must belong to the same app as the function.

In the case of Postman then, be sure you are using an offline access token for the same app.". Hope this helps!

Where can I get the “API Key”? from shopify store admin api access token, or from shopify partner.

1 Like

Same issue.
I create the function & extension for App1, then distribution to App2. In App1 I can create the new discount, but got this error when create discount in App2.

Just to clarify – this is by design. Functions currently do not support “interdependency” across apps – functions can only be used by their own app.

1 Like