diff --git a/discount-app-action-link/README.md b/discount-app-action-link/README.md index 4cdd1ce7..04428495 100644 --- a/discount-app-action-link/README.md +++ b/discount-app-action-link/README.md @@ -35,7 +35,7 @@ Each `admin.app.intent.link` extension is tied to only a single url, which is wh ### Customizing the intents 1. **Set your URLs.** Replace `YOUR_CREATE_ROUTE` and `YOUR_EDIT_ROUTE` in `shopify.extension.toml` with the routes in your app that create and edit the discount. The whole path is up to your app (there's no required prefix), but each must be a stable, unique route (for example `/discounts/loyalty/new` and `/discounts/{id}`). Keep the `{id}` param on the edit route. Avoid wildcard placeholders. -2. **Pin your function.** Replace `YOUR_DISCOUNT_FUNCTION_ID` in `intent-schema.json`, `intent-schema-edit.json`, and `instructions.md` with the ID of the discount function this extension targets. The `functionId` `matchValue` narrows a generic "create a discount" request to your function; without it, a generic create routes to the native discount picker instead. If your create route needs the function ID, you can also embed it in the URL (`/discounts/{functionId}/new`). The edit intent pins the same `functionId` via `matchValue` so Sidekick resolves the edit directly to this app rather than relying on a discount-only owner lookup. +2. **Pin your function.** Replace `YOUR_DISCOUNT_FUNCTION_ID` in `intent-schema.json`, `intent-schema-edit.json`, and `instructions.md` with the ID of the discount function this extension targets. The `functionId` `matchValue` narrows a generic "create a discount" request to your function; without it, a generic create routes to the native discount picker instead. If your create route needs the function ID in the path, include it directly (for example, `/discounts/019f…/new`); don't use a `{functionId}` placeholder. The edit intent pins the same `functionId` via `matchValue` so Sidekick resolves the edit directly to this app rather than relying on a discount-only owner lookup. 3. Update the merchant-facing names and descriptions in `locales/en.default.json` (under the `create` and `edit` keys). ### Get your function ID diff --git a/discount-app-action-link/shopify.extension.toml.liquid b/discount-app-action-link/shopify.extension.toml.liquid index e0ce4bb0..419bc4b5 100644 --- a/discount-app-action-link/shopify.extension.toml.liquid +++ b/discount-app-action-link/shopify.extension.toml.liquid @@ -22,9 +22,10 @@ target = "admin.app.intent.link" # The whole path is up to your app; there is no required prefix. The one requirement: the route # must be stable and unique to the kind of discount this extension creates, so Sidekick can route # to it deterministically. Examples: /discounts/loyalty/new, /bundles/create, /promotions/create. -# Avoid wildcard placeholders. To target a specific function, template it into the route with -# `{functionId}` (matching the intent input property) — e.g. /discounts/{functionId}/new — and the -# platform fills it from the `functionId` matchValue in intent-schema.json. +# Avoid wildcard placeholders, and don't template `{functionId}` into the route: `functionId` is +# an optional intent input, so the platform can't fill a URL path segment from it. It's used only +# as `matchValue` in intent-schema.json to route the intent to your app. If you need the function +# ID in the path, include it directly (e.g. /discounts/019f7c00-0000-0000-0000-000000000000/new). url = "/YOUR_CREATE_ROUTE" # Instructions tell Sidekick to pass functionId on create so it resolves to this app's intent.