In shopify.extension.toml add [network_access] enabled = true; also declare any specific allowed domains under the network access config if the current TOML schema supports domain whitelisting — check current docs
In your Function's run entrypoint use the fetch API (available in the Function runtime) to call your external endpoint; pass any required auth headers and a short timeout appropriate for the Function's time budget
Design your external API to respond fast (well under the Function timeout budget documented by Shopify); cache configuration data at your API layer to avoid cold-start latency hitting Function timeouts
Handle fetch failures gracefully: if the external call fails, return a safe default result (e.g., no discount) rather than throwing, so checkout is not blocked by an API outage
Validate the response from your external API before using it in discount logic; malformed or unexpected data should log an error and fall back to a safe default
Test with network access enabled using `shopify app function run` with a sample input that exercises the network call path; confirm that timeout and error cases return valid FunctionRunResult shapes
Known gotchas
Network access in Functions adds latency to checkout — every cart evaluation that triggers the Function will now incur an external HTTP round-trip; ensure your external API's P99 latency is well within the Function time budget or checkout will degrade
Not all Function types support network access in all API versions; check the Shopify Functions network access documentation for your specific Function type and API version before enabling it
Shopify may restrict the domains reachable from a Function even with network access enabled; test that your specific endpoint is reachable from the Function runtime before relying on it in production
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp