My discount function works, its very simple, uses tags to identify products eligible for discounts and then applies them in quantities of two, i.e. 2 for 25, each eligble product is 12.50. This part works, has worked for over a year, but when I try and use the Shopify tutorial as a basis for saving the metafield I cannot save the updated configuration:
How can I debug (there are no log files for the UI) what is failing? I have the tutorial code working EXACTLY and I’ve checked the shopify.extension.toml files and they all see good to go:
api_version = "2024-10"
[[extensions]]
# Change the merchant-facing name of the extension in locales/en.default.json
name = "t:name"
description = "t:description"
handle = "discount-ui-js"
type = "ui_extension"
# Only 1 target can be specified for each Admin block extension
[[extensions.targeting]]
module = "./src/DiscountFunctionSettings.jsx"
# The target used here must match the target used in the module file (./src/DiscountFunctionSettings.jsx)
target = "admin.discount-details.function-settings.render"
Any help greatly appreciated . Note: I am currently not using the metafields yet in my function, I just want to save them and then I can use them in both run.graphql and my run.js .
The function extension uses API version 2025-04, while the UI extension uses 2024-10. Mixing API versions can sometimes cause compatibility issues, especially with newer features like metafield handling. Ensure that both extensions are aligned with a compatible API version (e.g., 2025-04 for both, as it’s the latest stable version as of your current date, June 27, 2025).
Common Issues with Metafield Saving:
Permissions: Your app must have the necessary scopes to write metafields (e.g., write_discounts, write_metaobjects).
check in your toml file
[access_scopes]
scopes = “write_discounts,write_own_merchant_managed_metafields”
We experienced some issues when creating and updating automatic app discounts on June 26th. A fix was shipped later in the day. Can you please try updating your discount again?
Let us know if you continue to experience any issues!