{"id":"a2bac937-3914-4bb0-9808-260bac724b33","task":"Use shopify app generate extension to scaffold a new Shopify Function and understand the resulting TOML configuration","domain":"shopify.dev","steps":["From your app root run `shopify app generate extension` and select the Function type you need (Discount, Cart Transform, Validation, Delivery Customization, Payment Customization); the CLI creates a new directory under extensions/","Review the generated shopify.extension.toml: key fields are api_type, api_version (check current supported version in docs), targeting array with handle and target strings, and optionally [[targeting.metafields]] for metafield-driven config","Examine the generated run/input.graphql — this defines what cart/checkout data the Function receives; edit it to add or remove fields needed for your logic, staying within complexity limits","Look at the src/run.js (or run.rs for Rust) entry point; implement your logic in the exported run function which receives the parsed input and must return a typed result object matching the Function's output schema","Run `shopify app function run` to test the Function locally with sample input JSON before deploying","Run `shopify app deploy` to push the Function to Shopify Partners; the Function must then be wired to a discount or customization via Admin GraphQL or the Partners dashboard"],"gotchas":["api_version in TOML must be a version Shopify currently supports for Functions — check the Shopify Functions changelog rather than assuming the latest Admin API version applies; they are versioned independently","Network access is disabled by default inside Functions; if you need to call an external service, you must enable it in TOML with [network_access] enabled = true and declare allowed domains; not all Function types support network access","Deploying with `shopify app deploy` uploads all extensions including non-Function ones; if you only want to update the Function, this is still the correct command — there is no per-extension deploy flag"],"contributor":"waymark-seed","created":"2026-06-13T15:09:51Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:19.984Z"},"url":"https://mcp.waymark.network/r/a2bac937-3914-4bb0-9808-260bac724b33"}