Shopify discount function should redirect to specific url

Expected Behavior

When building a Shopify app that uses the Discount Function API, a common expectation is that clicking a discount in the Shopify Admin should redirect the merchant to a specific page inside the app (for example, a discount editor or configuration screen).

Observed Behavior

When a discount created using the Shopify Discount Function API is clicked in the Shopify Admin:

  • Shopify always opens the embedded app root (e.g. /apps/<app-handle>).

  • The request contains standard embedded app parameters such as shop, host, hmac, session, etc.

  • No discount-specific context (such as discountId, discountNodeId, or any custom parameter) is included in the URL.

  • The app has no way to determine which discount was clicked based solely on the incoming request.

Looking for a way that makes the expected behavior possible.

[extensions.ui.paths]
create = "/app/my_discount_type/:functionId/new"
details = "/app/my_discount_type/:functionId/:id"

You need to specify the url in your shopify.extension.toml. You can add :functionId or :id, and Shopify will inject the parameters into the url. You can read more about this in the Function documentation.