I have deployed my discount app on partner account. After that I have installed app on shopify store. But when I am running shopify app dev then I am getting below error.
pc@pc-ThinkPad-E15-Gen-4:/var/www/salt/apps/employee-discount-app$ shopify app dev
? Which store would you like to use to view your project? saltbyideas.com
╭─ error ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ │
│ The store you specified (saltbyideas-com.myshopify.com) is not a dev store │
│ │
│ Run dev --reset and select an eligible dev store. │
│ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
You are encountering the “Function not found” error because the functionId you are using is not correct for the discountAutomaticAppCreate mutation. Here’s how Shopify Functions and their IDs work:
Key Points
FunctionId Source:
The functionId required for discount mutations (like discountAutomaticAppCreate) must be the ID of a Shopify Function that is registered and published to the store, and specifically of the correct type (e.g., Discount Function).
The functionId you see in the Partner Dashboard or app configuration is NOT the one you use in the mutation.
You must use the functionId returned by the shop’s Admin API via the shopifyFunctions query.
Empty shopifyFunctions Response:
If your shopifyFunctions query returns an empty edges array, it means that no Shopify Functions are currently registered to your store. This can happen if:
The app was installed, but the function was not published to the store.
The function is not of the correct type (e.g., not a Discount Function).
There was an error during deployment or registration.
How to Fix:
Make sure you have run shopify app deploy or shopify app function deploy after building your function.
Ensure your extension is of type “function” and targets the correct discount API (e.g., Discount Function, not a deprecated one).
After deployment, run the shopifyFunctions query again. You should see your function listed, with an id like gid://shopify/ShopifyFunction/1234567890.
Use this id as the functionId in your mutation.
How to Get the Correct functionId
Deploy your function (from your app root): shopify app deploy
Query for functionId:
query {
shopifyFunctions(first: 10) {
edges {
node {
id
app {
title
}
apiType
apiVersion
}
}
}
}
Look for a node with apiType like DISCOUNT or similar, and the correct app.title.
client_id = “6f5dcdb3fa983bc8aade12459eb7aedd”
name = “employee-discount-fn”
handle = “employee-discount-fn”
application_url = “Find this app in the pages where you work”
embedded = true