Create a payment-customization Function using the Shopify CLI; review the run.graphql template which exposes the available paymentMethods and the cart object
Extend the input query to include the cart total price amount and, if needed, customer tags via the buyerIdentity customer field
In the run function, evaluate the condition (for example, hide a payment method when cart total exceeds a threshold or when the customer does not have a specific tag)
Return a FunctionResult with the hidePaymentMethods operation referencing the paymentMethod handles that should be suppressed
Create an active payment customization record via the Admin GraphQL API (paymentCustomizationCreate mutation) that links to the deployed function
Test on a development store by placing test orders with carts that should and should not trigger the hide logic
Known gotchas
Customer tags are only available in the input query when the buyer is logged in; the customer field on buyerIdentity will be null for guest checkouts, so the function must handle the null case
Payment method handles in the input data are opaque identifiers assigned by Shopify and may differ between stores; do not hardcode handles across multiple merchant deployments
Payment customization Functions run very late in the checkout pipeline; hiding a method does not prevent a determined buyer from attempting to use it via direct API access, so server-side validation is still necessary for security-sensitive restrictions
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