Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion discount-app-action-link/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions discount-app-action-link/shopify.extension.toml.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down