Help us improve
Share bugs, ideas, or general feedback.
From shopify-commerce
Builds Shopify Functions: serverless Wasm extensions in JS/Rust for discounts, delivery/payment customization, cart validation/transforms, fulfillment constraints, and order routing.
npx claudepluginhub orcaqubits/agentic-commerce-skills-plugins --plugin shopify-commerceHow this skill is triggered — by the user, by Claude, or both
Slash command
/shopify-commerce:shopify-functionsThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Fetch live docs**:
Customizes Shopify backend logic via Functions APIs including Discount, Cart/Checkout Validation, Cart Transform, delivery/fulfillment options, Order Routing, and Payment Customization.
Builds Shopify apps, extensions, themes using GraphQL Admin API, Shopify CLI, Polaris UI, and Liquid. Includes CLI commands, access scopes, and GraphQL queries for products/orders.
Builds Shopify checkout UI extensions with Preact/Remote DOM rendering, UI primitives, extension targets, checkout APIs, metafield access, post-purchase extensions, and thank-you page customization. Use for customizing Shopify checkout.
Share bugs, ideas, or general feedback.
Fetch live docs:
https://shopify.dev/docs/apps/build/functions for Functions overviewsite:shopify.dev shopify functions input output for I/O schemassite:shopify.dev shopify functions api reference for function typesServerless extensions that run on Shopify's infrastructure:
| Type | Purpose | Example |
|---|---|---|
| Discount | Custom discount logic | Buy X get Y, tiered discounts |
| Delivery customization | Modify shipping options | Rename, reorder, hide methods |
| Payment customization | Modify payment methods | Hide, reorder, rename gateways |
| Cart validation | Block or warn on cart conditions | Quantity limits, product combos |
| Cart transform | Modify cart contents | Bundle expansion, auto-add items |
| Fulfillment constraints | Control fulfillment behavior | Location priority, restrictions |
| Order routing | Direct orders to locations | Closest warehouse, priority |
Functions receive structured JSON input and return structured JSON output:
{
"cart": {
"lines": [
{
"id": "gid://shopify/CartLine/1",
"quantity": 2,
"merchandise": {
"__typename": "ProductVariant",
"id": "gid://shopify/ProductVariant/123",
"product": {
"id": "gid://shopify/Product/456",
"hasAnyTag": true
}
},
"cost": {
"amountPerQuantity": { "amount": "29.99", "currencyCode": "USD" }
}
}
]
},
"discountNode": {
"metafield": {
"value": "{\"percentage\": 10}"
}
}
}
{
"discounts": [
{
"value": { "percentage": { "value": "10.0" } },
"targets": [
{ "productVariant": { "id": "gid://shopify/ProductVariant/123" } }
],
"message": "10% loyalty discount"
}
],
"discountApplicationStrategy": "FIRST"
}
extensions/my-discount/
├── src/
│ └── run.js # Function entry point
├── input.graphql # Defines what data the function receives
├── shopify.extension.toml # Extension configuration
└── package.json
api_version = "2025-01"
[[extensions]]
name = "My Discount"
handle = "my-discount"
type = "function"
[extensions.build]
command = "npm exec -- shopify app function build"
path = "dist/function.wasm"
[extensions.ui]
handle = "my-discount-ui"
[extensions.input.variables]
namespace = "my-app"
key = "discount-config"
Defines what Shopify data the function receives:
query Input {
cart {
lines {
id
quantity
merchandise {
... on ProductVariant {
id
product {
id
hasAnyTag(tags: ["vip"])
}
}
}
cost {
amountPerQuantity {
amount
currencyCode
}
}
}
}
discountNode {
metafield(namespace: "my-app", key: "discount-config") {
value
}
}
}
// src/run.js
export function run(input) {
const config = JSON.parse(input.discountNode.metafield?.value || '{}');
const percentage = config.percentage || 0;
const targets = input.cart.lines
.filter(line => line.merchandise?.product?.hasAnyTag)
.map(line => ({
productVariant: { id: line.merchandise.id }
}));
if (targets.length === 0) {
return { discounts: [], discountApplicationStrategy: "FIRST" };
}
return {
discounts: [{
value: { percentage: { value: String(percentage) } },
targets,
message: `${percentage}% VIP discount`,
}],
discountApplicationStrategy: "FIRST",
};
}
InstructionCountLimitExceededError if exceededshopify app function run locallyFetch the Shopify Functions documentation for exact I/O schemas, supported function types, and API version requirements before implementing.