Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

feat(shopify): let AI agents manage marketing, bulk operations, markets and analytics (#16091)

Odai Ahmad89a2993dfc03
diff --git a/bun.lock b/bun.lock
index 7709264c587..28bcfceccfc 100644
--- a/bun.lock
+++ b/bun.lock
@@ -8313,7 +8313,7 @@
},
"packages/pieces/community/shopify": {
"name": "@activepieces/piece-shopify",
- "version": "0.8.0",
+ "version": "0.9.0",
"dependencies": {
"@activepieces/core-piece-types": "workspace:*",
"@activepieces/core-utils": "workspace:*",
diff --git a/packages/pieces/community/shopify/package.json b/packages/pieces/community/shopify/package.json
index 003b6e85ab4..6846f548fd2 100644
--- a/packages/pieces/community/shopify/package.json
+++ b/packages/pieces/community/shopify/package.json
@@ -1,6 +1,6 @@
{
"name": "@activepieces/piece-shopify",
- "version": "0.8.0",
+ "version": "0.9.0",
"main": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
"scripts": {
diff --git a/packages/pieces/community/shopify/src/i18n/translation.json b/packages/pieces/community/shopify/src/i18n/translation.json
index 68045ff36c4..c7c5a3ca243 100644
--- a/packages/pieces/community/shopify/src/i18n/translation.json
+++ b/packages/pieces/community/shopify/src/i18n/translation.json
@@ -32,6 +32,18 @@
"Add Products to Collection": "Add Products to Collection",
"Add Tags": "Add Tags",
"List Delivery Zones": "List Delivery Zones",
+ "Delete Analytics Annotation": "Delete Analytics Annotation",
+ "Update Analytics Annotation": "Update Analytics Annotation",
+ "Create Analytics Annotation": "Create Analytics Annotation",
+ "Delete Analytics Targets": "Delete Analytics Targets",
+ "Update Analytics Target": "Update Analytics Target",
+ "Create Analytics Target": "Create Analytics Target",
+ "List Analytics Targets": "List Analytics Targets",
+ "Get Return Policy Profile": "Get Return Policy Profile",
+ "List Return Policy Profiles": "List Return Policy Profiles",
+ "List Market Relationships": "List Market Relationships",
+ "Get Market": "Get Market",
+ "List Markets": "List Markets",
"Send Payment Method Update Email": "Send Payment Method Update Email",
"Resolve Requested Order Edit": "Resolve Requested Order Edit",
"Decline Requested Order Edit": "Decline Requested Order Edit",
@@ -44,18 +56,21 @@
"Attach Media to Variants": "Attach Media to Variants",
"Bulk Delete Metaobject Entries": "Bulk Delete Metaobject Entries",
"Calculate Refund": "Calculate Refund",
+ "Cancel Bulk Operation": "Cancel Bulk Operation",
"Cancel Fulfillment Order": "Cancel Fulfillment Order",
"Cancel Fulfillment": "Cancel Fulfillment",
"Capture Order Payment": "Capture Order Payment",
"Complete Draft Order": "Complete Draft Order",
"Count Abandoned Checkouts": "Count Abandoned Checkouts",
"Count Blogs": "Count Blogs",
+ "Count Catalogs": "Count Catalogs",
"Count Collections": "Count Collections",
"Count Customer Segments": "Count Customer Segments",
"Count Customers": "Count Customers",
"Count Discount Codes": "Count Discount Codes",
"Count Discounts": "Count Discounts",
"Count Draft Orders": "Count Draft Orders",
+ "Count Store Events": "Count Store Events",
"Count Gift Cards": "Count Gift Cards",
"Count Locations": "Count Locations",
"Count Online Store Pages": "Count Online Store Pages",
@@ -71,11 +86,13 @@
"Create Fulfillment Tracking Event": "Create Fulfillment Tracking Event",
"Create Fulfillment": "Create Fulfillment",
"Create Gift Card": "Create Gift Card",
+ "Report Marketing Engagement": "Report Marketing Engagement",
"Create Order Risk Assessment": "Create Order Risk Assessment",
"Create Online Store Page": "Create Online Store Page",
"Create Product Options": "Create Product Options",
"Create Product Variants": "Create Product Variants",
"Create Refund": "Create Refund",
+ "Create Script Tag": "Create Script Tag",
"Create Smart Collection": "Create Smart Collection",
"Create Theme": "Create Theme",
"Create URL Redirect": "Create URL Redirect",
@@ -90,6 +107,7 @@
"Start Deleting Discount Redeem Codes": "Start Deleting Discount Redeem Codes",
"Delete Discount": "Delete Discount",
"Delete Draft Order": "Delete Draft Order",
+ "Delete External Marketing Activity": "Delete External Marketing Activity",
"Delete Fulfillment Service": "Delete Fulfillment Service",
"Delete Metafields": "Delete Metafields",
"Delete Metaobject Definition": "Delete Metaobject Definition",
@@ -100,9 +118,12 @@
"Delete Product Options": "Delete Product Options",
"Delete Product Variants": "Delete Product Variants",
"Delete Product": "Delete Product",
+ "Delete Saved Search": "Delete Saved Search",
+ "Delete Script Tag": "Delete Script Tag",
"Delete Theme Files": "Delete Theme Files",
"Delete Theme": "Delete Theme",
"Delete URL Redirect": "Delete URL Redirect",
+ "Delete Markets Web Presence": "Delete Markets Web Presence",
"Detach Media from Variants": "Detach Media from Variants",
"Duplicate Product": "Duplicate Product",
"Enable Standard Metaobject Definition": "Enable Standard Metaobject Definition",
@@ -111,12 +132,16 @@
"Get Abandonment": "Get Abandonment",
"Get Blog Article": "Get Blog Article",
"Get Blog": "Get Blog",
+ "Get Bulk Operation": "Get Bulk Operation",
+ "Get Business Entity": "Get Business Entity",
"Get Checkout Abandonment": "Get Checkout Abandonment",
"Get Collection by Handle": "Get Collection by Handle",
"Get Collection": "Get Collection",
"Get Discount Redeem Code Bulk Creation": "Get Discount Redeem Code Bulk Creation",
"Get Discount": "Get Discount",
+ "Get Domain": "Get Domain",
"Get Draft Order": "Get Draft Order",
+ "Get Store Event": "Get Store Event",
"Get Fulfillment Details": "Get Fulfillment Details",
"Get Fulfillment Order": "Get Fulfillment Order",
"Get Gift Card": "Get Gift Card",
@@ -124,6 +149,7 @@
"Get Inventory Item": "Get Inventory Item",
"Get Job Status": "Get Job Status",
"Get Location": "Get Location",
+ "Get Marketing Event": "Get Marketing Event",
"Get Metafield Definition": "Get Metafield Definition",
"Get Metafield": "Get Metafield",
"Get Metaobject Entry": "Get Metaobject Entry",
@@ -136,6 +162,8 @@
"Get Product Media": "Get Product Media",
"Get Publication": "Get Publication",
"Get Refund": "Get Refund",
+ "Get Script Tag": "Get Script Tag",
+ "Get Shop Billing Currency": "Get Shop Billing Currency",
"Get Shop": "Get Shop",
"Get Theme File": "Get Theme File",
"Get Theme": "Get Theme",
@@ -145,22 +173,32 @@
"List Article Authors": "List Article Authors",
"List Article Tags": "List Article Tags",
"List Blog Articles": "List Blog Articles",
+ "List Available Locales": "List Available Locales",
"List Blogs": "List Blogs",
+ "List Bulk Operations": "List Bulk Operations",
+ "List Business Entities": "List Business Entities",
"List Carrier Services": "List Carrier Services",
+ "List Catalogs": "List Catalogs",
"List Collection Products": "List Collection Products",
"List Blog Comments": "List Blog Comments",
+ "List Privacy Consent Policies": "List Privacy Consent Policies",
+ "List Consent Policy Regions": "List Consent Policy Regions",
+ "List Customer Account Pages": "List Customer Account Pages",
"List Customer Addresses": "List Customer Addresses",
"List Customer Orders": "List Customer Orders",
"List Delivery Profiles": "List Delivery Profiles",
"List Discount Redeem Codes": "List Discount Redeem Codes",
"List Discounts": "List Discounts",
"List Draft Orders": "List Draft Orders",
+ "List Store Currencies": "List Store Currencies",
+ "List Store Events": "List Store Events",
"List Fulfillment Events": "List Fulfillment Events",
"List Fulfillment Order Move Locations": "List Fulfillment Order Move Locations",
"List Fulfillment Services": "List Fulfillment Services",
"Search Inventory Items": "Search Inventory Items",
"List Inventory Levels": "List Inventory Levels",
"List Locations": "List Locations",
+ "List Marketing Events": "List Marketing Events",
"List Metafield Types": "List Metafield Types",
"List Metafield Definitions": "List Metafield Definitions",
"List Metafields": "List Metafields",
@@ -171,15 +209,22 @@
"List Order Refunds": "List Order Refunds",
"List Order Transactions": "List Order Transactions",
"List Online Store Pages": "List Online Store Pages",
+ "List Payment Disputes": "List Payment Disputes",
+ "List Payment Terms Templates": "List Payment Terms Templates",
"List Product Media": "List Product Media",
"List Product Variants": "List Product Variants",
"List Publications": "List Publications",
"List Sales Channels": "List Sales Channels",
+ "List Saved Searches": "List Saved Searches",
+ "List Script Tags": "List Script Tags",
+ "List Shop Pay Payment Receipts": "List Shop Pay Payment Receipts",
+ "List Store Policies": "List Store Policies",
"List Standard Metafield Templates": "List Standard Metafield Templates",
"List Tender Transactions": "List Tender Transactions",
"List Theme Files": "List Theme Files",
"List Themes": "List Themes",
"List URL Redirects": "List URL Redirects",
+ "List Markets Web Presences": "List Markets Web Presences",
"Mark Blog Comment as Not Spam": "Mark Blog Comment as Not Spam",
"Mark Blog Comment as Spam": "Mark Blog Comment as Spam",
"Mark Order as Paid": "Mark Order as Paid",
@@ -207,6 +252,8 @@
"Set Inventory Quantities": "Set Inventory Quantities",
"Set Metafields": "Set Metafields",
"Set Product (Full State)": "Set Product (Full State)",
+ "Start Bulk Mutation": "Start Bulk Mutation",
+ "Start Bulk Export Query": "Start Bulk Export Query",
"Start Order Cancellation": "Start Order Cancellation",
"Unarchive Order": "Unarchive Order",
"Unpublish Product or Collection": "Unpublish Product or Collection",
@@ -216,6 +263,7 @@
"Update Collection": "Update Collection",
"Update Customer Address": "Update Customer Address",
"Update Draft Order": "Update Draft Order",
+ "Update External Marketing Activity": "Update External Marketing Activity",
"Update Free Shipping Discount Code": "Update Free Shipping Discount Code",
"Update Fulfillment Tracking": "Update Fulfillment Tracking",
"Update Gift Card": "Update Gift Card",
@@ -226,8 +274,10 @@
"Update Product Media": "Update Product Media",
"Update Product Option": "Update Product Option",
"Update Product Variants": "Update Product Variants",
+ "Update Script Tag": "Update Script Tag",
"Rename Theme": "Rename Theme",
"Update URL Redirect": "Update URL Redirect",
+ "Upsert External Marketing Activity": "Upsert External Marketing Activity",
"Create or Update Metaobject Entry": "Create or Update Metaobject Entry",
"Create or Update Theme Files": "Create or Update Theme Files",
"Void Payment Authorization": "Void Payment Authorization",
@@ -264,6 +314,18 @@
"Add products to a collection by hand.": "Add products to a collection by hand.",
"Add tags to an order, draft order, customer, product or blog article.": "Add tags to an order, draft order, customer, product or blog article.",
"List every shipping zone of one location group in a delivery profile, with countries and rates.": "List every shipping zone of one location group in a delivery profile, with countries and rates.",
+ "Remove an analytics annotation this app created.": "Remove an analytics annotation this app created.",
+ "Change the type, title, description or dates of an analytics annotation this app created.": "Change the type, title, description or dates of an analytics annotation this app created.",
+ "Mark a notable event (launch, campaign, redesign…) on the store's analytics charts.": "Mark a notable event (launch, campaign, redesign…) on the store's analytics charts.",
+ "Permanently delete one or more analytics targets.": "Permanently delete one or more analytics targets.",
+ "Change the name, metric, dates, goal value or filters of an analytics target.": "Change the name, metric, dates, goal value or filters of an analytics target.",
+ "Set a goal for an analytics metric over a date range, shown in Shopify Analytics.": "Set a goal for an analytics metric over a date range, shown in Shopify Analytics.",
+ "List and search the store's analytics targets (goals for a metric over a date range).": "List and search the store's analytics targets (goals for a metric over a date range).",
+ "Get one return policy profile with its return and cancellation rules and markets.": "Get one return policy profile with its return and cancellation rules and markets.",
+ "List the store's return policy profiles with their return and cancellation rules and markets.": "List the store's return policy profiles with their return and cancellation rules and markets.",
+ "List the parent/child links between the store's Markets.": "List the parent/child links between the store's Markets.",
+ "Get one Shopify Market with its conditions, hierarchy, catalogs, currency and return policy.": "Get one Shopify Market with its conditions, hierarchy, catalogs, currency and return policy.",
+ "List and search the store's Shopify Markets with their hierarchy, regions, currency and return policy.": "List and search the store's Shopify Markets with their hierarchy, regions, currency and return policy.",
"Email a customer a secure link to add a new payment method for an order, draft order or subscription contract.": "Email a customer a secure link to add a new payment method for an order, draft order or subscription contract.",
"Mark a buyer request to edit an order as completed.": "Mark a buyer request to edit an order as completed.",
"Decline a buyer request to edit an order, with an optional note to the buyer.": "Decline a buyer request to edit an order, with an optional note to the buyer.",
@@ -276,18 +338,21 @@
"Show existing product media on specific variants (for example the red photo on the red variant).": "Show existing product media on specific variants (for example the red photo on the red variant).",
"Start deleting many metaobject entries: listed ids, or every entry of one type.": "Start deleting many metaobject entries: listed ids, or every entry of one type.",
"Preview the refund Shopify suggests for an order, without refunding.": "Preview the refund Shopify suggests for an order, without refunding.",
+ "Stop a running bulk query or bulk mutation.": "Stop a running bulk query or bulk mutation.",
"Cancel a fulfillment order that was sent to a fulfillment service; a replacement is created.": "Cancel a fulfillment order that was sent to a fulfillment service; a replacement is created.",
"Cancel a fulfillment so its items become unfulfilled again.": "Cancel a fulfillment so its items become unfulfilled again.",
"Capture money from an authorized payment on an order.": "Capture money from an authorized payment on an order.",
"Turn a draft order into a real order.": "Turn a draft order into a real order.",
"Count abandoned checkouts, optionally filtered.": "Count abandoned checkouts, optionally filtered.",
"Count the blogs of the online store, optionally filtered.": "Count the blogs of the online store, optionally filtered.",
+ "Count the store's catalogs, optionally by type or search.": "Count the store's catalogs, optionally by type or search.",
"Count collections, optionally filtered.": "Count collections, optionally filtered.",
"Count the customer segments defined in the store.": "Count the customer segments defined in the store.",
"Count customers, optionally filtered.": "Count customers, optionally filtered.",
"Count the redeem codes across the store's code discounts, optionally filtered.": "Count the redeem codes across the store's code discounts, optionally filtered.",
"Count discounts (code and automatic), optionally filtered.": "Count discounts (code and automatic), optionally filtered.",
"Count draft orders, optionally filtered.": "Count draft orders, optionally filtered.",
+ "Count store activity-log events, optionally filtered.": "Count store activity-log events, optionally filtered.",
"Count gift cards, optionally filtered.": "Count gift cards, optionally filtered.",
"Count the store's locations, optionally filtered.": "Count the store's locations, optionally filtered.",
"Count the online store's content pages.": "Count the online store's content pages.",
@@ -305,6 +370,7 @@
"Add a shipment status event (in transit, out for delivery, delivered, …) to a fulfillment.": "Add a shipment status event (in transit, out for delivery, delivered, …) to a fulfillment.",
"Mark items of a fulfillment order as shipped, with optional tracking details.": "Mark items of a fulfillment order as shipped, with optional tracking details.",
"Issue a new gift card with an initial balance.": "Issue a new gift card with an initial balance.",
+ "Report one day of engagement metrics for a marketing activity or channel.": "Report one day of engagement metrics for a marketing activity or channel.",
"Record a fraud risk assessment with supporting facts on an order.": "Record a fraud risk assessment with supporting facts on an order.",
"Create a real order with one or more line items.": "Create a real order with one or more line items.",
"Create a content page on the online store.": "Create a content page on the online store.",
@@ -312,6 +378,7 @@
"Create a new product with its title, description, vendor, type, tags and status.": "Create a new product with its title, description, vendor, type, tags and status.",
"Add one or more variants to a product.": "Add one or more variants to a product.",
"Refund money and/or line items on an order.": "Refund money and/or line items on an order.",
+ "Load a remote JavaScript file on every online store page.": "Load a remote JavaScript file on every online store page.",
"Create a rule-based collection that automatically includes products matching conditions.": "Create a rule-based collection that automatically includes products matching conditions.",
"Import a theme from a ZIP file URL as an unpublished theme.": "Import a theme from a ZIP file URL as an unpublished theme.",
"Redirect an old online store path to a new URL.": "Redirect an old online store path to a new URL.",
@@ -326,6 +393,7 @@
"Start deleting redeem codes from a code discount (runs in the background).": "Start deleting redeem codes from a code discount (runs in the background).",
"Permanently delete a code discount or an automatic discount.": "Permanently delete a code discount or an automatic discount.",
"Permanently delete a draft order.": "Permanently delete a draft order.",
+ "Delete an external marketing activity.": "Delete an external marketing activity.",
"Delete a fulfillment service and decide what happens to its location's inventory.": "Delete a fulfillment service and decide what happens to its location's inventory.",
"Delete metafields by owner, namespace and key.": "Delete metafields by owner, namespace and key.",
"Permanently delete a metaobject type and every entry of it.": "Permanently delete a metaobject type and every entry of it.",
@@ -336,9 +404,12 @@
"Delete one or more options from a product.": "Delete one or more options from a product.",
"Permanently delete one or more variants of a product.": "Permanently delete one or more variants of a product.",
"Permanently delete a product with all its variants and media.": "Permanently delete a product with all its variants and media.",
+ "Delete a saved admin search (a saved filter view).": "Delete a saved admin search (a saved filter view).",
+ "Stop the online store from loading a script tag.": "Stop the online store from loading a script tag.",
"Permanently delete files from a theme (up to 50 per call).": "Permanently delete files from a theme (up to 50 per call).",
"Permanently delete an unpublished theme.": "Permanently delete an unpublished theme.",
"Delete a URL redirect.": "Delete a URL redirect.",
+ "Remove a Markets web presence (a market's domain or subfolder storefront).": "Remove a Markets web presence (a market's domain or subfolder storefront).",
"Stop showing specific product media on specific variants.": "Stop showing specific product media on specific variants.",
"Create a copy of a product under a new title.": "Create a copy of a product under a new title.",
"Add one of Shopify's standard metaobject types to the store.": "Add one of Shopify's standard metaobject types to the store.",
@@ -347,13 +418,17 @@
"Get a customer abandonment (browse, cart or checkout) by id.": "Get a customer abandonment (browse, cart or checkout) by id.",
"Get one blog article with its body and comment count.": "Get one blog article with its body and comment count.",
"Get one blog with its article count and recent article tags.": "Get one blog with its article count and recent article tags.",
+ "Check the status and result file of a bulk query or bulk mutation.": "Check the status and result file of a bulk query or bulk mutation.",
+ "Get one business entity, or the primary one when no id is given.": "Get one business entity, or the primary one when no id is given.",
"Get the abandonment record of an abandoned checkout.": "Get the abandonment record of an abandoned checkout.",
"Get one collection by its URL handle.": "Get one collection by its URL handle.",
"Get one collection with its membership sources and conditions.": "Get one collection with its membership sources and conditions.",
"Get one customer with contact details, marketing state and default address.": "Get one customer with contact details, marketing state and default address.",
"Check the progress and results of a redeem code import started by add_discount_redeem_codes.": "Check the progress and results of a redeem code import started by add_discount_redeem_codes.",
"Get one discount (code or automatic) with its value, target, eligibility and limits.": "Get one discount (code or automatic) with its value, target, eligibility and limits.",
+ "Get one of the store's domains by id, or the primary domain.": "Get one of the store's domains by id, or the primary domain.",
"Get one draft order with its line items and totals.": "Get one draft order with its line items and totals.",
+ "Get one store activity-log event.": "Get one store activity-log event.",
"Get one fulfillment with its tracking, origin address and shipped line items.": "Get one fulfillment with its tracking, origin address and shipped line items.",
"Get one fulfillment order with its status, holds, location and line items.": "Get one fulfillment order with its status, holds, location and line items.",
"Get one gift card with its balance, status and owner.": "Get one gift card with its balance, status and owner.",
@@ -361,6 +436,7 @@
"Get one inventory item with its SKU, cost, tracking and shipping details.": "Get one inventory item with its SKU, cost, tracking and shipping details.",
"Check whether an asynchronous Shopify job has finished.": "Check whether an asynchronous Shopify job has finished.",
"Get one store location with its address and capabilities.": "Get one store location with its address and capabilities.",
+ "Get one marketing event by id.": "Get one marketing event by id.",
"Get one metafield definition by owner type, namespace and key.": "Get one metafield definition by owner type, namespace and key.",
"Get one metafield by its id.": "Get one metafield by its id.",
"Get one metaobject entry with all its field values.": "Get one metaobject entry with all its field values.",
@@ -375,6 +451,8 @@
"Get one product variant with its price, SKU, stock and options.": "Get one product variant with its price, SKU, stock and options.",
"Get one publication (sales channel or catalog) by id.": "Get one publication (sales channel or catalog) by id.",
"Get one refund by id.": "Get one refund by id.",
+ "Get one script tag.": "Get one script tag.",
+ "Get the currency the merchant pays Shopify and apps in.": "Get the currency the merchant pays Shopify and apps in.",
"Get the store name, domain, currency, timezone and plan.": "Get the store name, domain, currency, timezone and plan.",
"Read one file (template, section, snippet, asset) of a theme.": "Read one file (template, section, snippet, asset) of a theme.",
"Get one theme with its role and processing state.": "Get one theme with its role and processing state.",
@@ -384,22 +462,32 @@
"List the author names used on blog articles.": "List the author names used on blog articles.",
"List the tags used on blog articles.": "List the tags used on blog articles.",
"List or search blog articles, optionally within one blog.": "List or search blog articles, optionally within one blog.",
+ "List every language locale Shopify supports.": "List every language locale Shopify supports.",
"List or search the blogs of the online store.": "List or search the blogs of the online store.",
+ "List this app's bulk queries and bulk mutations, newest first.": "List this app's bulk queries and bulk mutations, newest first.",
+ "List the legal entities the merchant operates the store through.": "List the legal entities the merchant operates the store through.",
"List the carrier-calculated shipping rate services set up on the store.": "List the carrier-calculated shipping rate services set up on the store.",
+ "List the store's catalogs (market, B2B company-location and app catalogs).": "List the store's catalogs (market, B2B company-location and app catalogs).",
"List the products in a collection, one page at a time.": "List the products in a collection, one page at a time.",
"List or search blog comments, for example those waiting for moderation.": "List or search blog comments, for example those waiting for moderation.",
+ "List the store's customer privacy consent policies per country or region.": "List the store's customer privacy consent policies per country or region.",
+ "List the countries and regions a privacy consent policy can be set for.": "List the countries and regions a privacy consent policy can be set for.",
+ "List the pages of the store's customer account area.": "List the pages of the store's customer account area.",
"List the saved addresses of one customer.": "List the saved addresses of one customer.",
"List the orders of one customer, one page at a time.": "List the orders of one customer, one page at a time.",
"List the shipping profiles with their zones, countries and rates.": "List the shipping profiles with their zones, countries and rates.",
"List the redeem codes of a code discount with their usage counts.": "List the redeem codes of a code discount with their usage counts.",
"List and search discounts (code and automatic) with their status and dates.": "List and search discounts (code and automatic) with their status and dates.",
"Search draft orders, one page at a time.": "Search draft orders, one page at a time.",
+ "List the currencies the store sells in, with manual exchange rates.": "List the currencies the store sells in, with manual exchange rates.",
+ "List or search the store's activity log (who created, changed or deleted what).": "List or search the store's activity log (who created, changed or deleted what).",
"List the tracking events recorded on a fulfillment.": "List the tracking events recorded on a fulfillment.",
"List the locations a fulfillment order could be moved to, and whether each one can take it.": "List the locations a fulfillment order could be moved to, and whether each one can take it.",
"List the fulfillment services installed on the store.": "List the fulfillment services installed on the store.",
"Search inventory items by SKU or id, one page at a time.": "Search inventory items by SKU or id, one page at a time.",
"List stock quantities of one item across locations, or of all items at one location.": "List stock quantities of one item across locations, or of all items at one location.",
"List the store's locations (warehouses, shops, fulfillment services), one page at a time.": "List the store's locations (warehouses, shops, fulfillment services), one page at a time.",
+ "List marketing events (campaigns, ads, emails) recorded on the store.": "List marketing events (campaigns, ads, emails) recorded on the store.",
"List every metafield type Shopify supports, with its validations.": "List every metafield type Shopify supports, with its validations.",
"List the metafield definitions (custom field schemas) for one resource type.": "List the metafield definitions (custom field schemas) for one resource type.",
"List the metafields of one product, customer, order or other resource.": "List the metafields of one product, customer, order or other resource.",
@@ -410,15 +498,22 @@
"List every refund made on an order.": "List every refund made on an order.",
"List every payment transaction on an order.": "List every payment transaction on an order.",
"List or search the online store's content pages (About, Contact, FAQ, ...).": "List or search the online store's content pages (About, Contact, FAQ, ...).",
+ "List Shopify Payments disputes (chargebacks and inquiries).": "List Shopify Payments disputes (chargebacks and inquiries).",
+ "List the payment terms Shopify offers (due on receipt, net 30, fixed date…).": "List the payment terms Shopify offers (due on receipt, net 30, fixed date…).",
"List the images, videos and 3D models of a product, one page at a time.": "List the images, videos and 3D models of a product, one page at a time.",
"List the variants of one product, one page at a time.": "List the variants of one product, one page at a time.",
"List the publications (sales channels and catalogs) products can be published to.": "List the publications (sales channels and catalogs) products can be published to.",
"List the sales channels installed on the store.": "List the sales channels installed on the store.",
+ "List the saved admin searches (saved filter views) of one resource type.": "List the saved admin searches (saved filter views) of one resource type.",
+ "List the script tags that load JavaScript on the online store.": "List the script tags that load JavaScript on the online store.",
+ "List Shop Pay payment request receipts.": "List Shop Pay payment request receipts.",
+ "List the store's legal policies (refund, shipping, privacy, terms).": "List the store's legal policies (refund, shipping, privacy, terms).",
"List Shopify's standard metafield definition templates.": "List Shopify's standard metafield definition templates.",
"List money actually received or paid out across all orders.": "List money actually received or paid out across all orders.",
"List the file paths of a theme, optionally filtered by path pattern.": "List the file paths of a theme, optionally filtered by path pattern.",
"List the online store's themes, optionally by role or name.": "List the online store's themes, optionally by role or name.",
"List or search the online store's URL redirects.": "List or search the online store's URL redirects.",
+ "List the store's Markets web presences (the domains and subfolders markets are sold through).": "List the store's Markets web presences (the domains and subfolders markets are sold through).",
"Restore a blog comment that was marked as spam.": "Restore a blog comment that was marked as spam.",
"Mark a blog comment as spam so it is hidden.": "Mark a blog comment as spam so it is hidden.",
"Record the outstanding balance of an order as paid manually.": "Record the outstanding balance of an order as paid manually.",
@@ -446,6 +541,8 @@
"Set stock to an absolute number at one or more locations.": "Set stock to an absolute number at one or more locations.",
"Create or update up to 25 metafields on products, customers, orders and other resources.": "Create or update up to 25 metafields on products, customers, orders and other resources.",
"Create or overwrite a whole product, including all its options and variants, in one call.": "Create or overwrite a whole product, including all its options and variants, in one call.",
+ "Run one GraphQL mutation many times in the background, once per variables object.": "Run one GraphQL mutation many times in the background, once per variables object.",
+ "Start a background bulk query that exports a large dataset to a JSONL file.": "Start a background bulk query that exports a large dataset to a JSONL file.",
"Cancel an order asynchronously and get a job to poll.": "Cancel an order asynchronously and get a job to poll.",
"Reopen a closed (archived) order.": "Reopen a closed (archived) order.",
"Remove a product or collection from one or more sales channels or catalogs.": "Remove a product or collection from one or more sales channels or catalogs.",
@@ -456,6 +553,7 @@
"Change fields of a saved customer address.": "Change fields of a saved customer address.",
"Change the name, email, phone, note, tags, locale or tax exemption of a customer.": "Change the name, email, phone, note, tags, locale or tax exemption of a customer.",
"Change the line items, customer, contact, tags or payment terms of a draft order.": "Change the line items, customer, contact, tags or payment terms of a draft order.",
+ "Change some fields of an external marketing activity.": "Change some fields of an external marketing activity.",
"Change an existing free shipping discount code.": "Change an existing free shipping discount code.",
"Change the carrier, tracking numbers or tracking URLs of a fulfillment.": "Change the carrier, tracking numbers or tracking URLs of a fulfillment.",
"Change a gift card's note, expiry date, owner or recipient.": "Change a gift card's note, expiry date, owner or recipient.",
@@ -467,8 +565,10 @@
"Change the alt text, filename or image of an existing media file.": "Change the alt text, filename or image of an existing media file.",
"Rename or move a product option and add, rename or delete its values.": "Rename or move a product option and add, rename or delete its values.",
"Change the price, SKU, barcode, stock policy or option values of one or more variants of a product.": "Change the price, SKU, barcode, stock policy or option values of one or more variants of a product.",
+ "Change the script URL or cache flag of a script tag.": "Change the script URL or cache flag of a script tag.",
"Rename a theme.": "Rename a theme.",
"Change the old path or the target of a URL redirect.": "Change the old path or the target of a URL redirect.",
+ "Create or fully replace an external marketing activity, keyed by your remote id.": "Create or fully replace an external marketing activity, keyed by your remote id.",
"Create a metaobject entry, or update the fields you send on an existing one, by type and handle.": "Create a metaobject entry, or update the fields you send on an existing one, by type and handle.",
"Create theme files or overwrite existing ones (up to 50 per call).": "Create theme files or overwrite existing ones (up to 50 per call).",
"Void an uncaptured payment authorization on an order.": "Void an uncaptured payment authorization on an order.",
@@ -534,6 +634,28 @@
"Cursor": "Cursor",
"Zone Token": "Zone Token",
"Rates Cursor": "Rates Cursor",
+ "Analytics Annotation ID": "Analytics Annotation ID",
+ "Clear Description": "Clear Description",
+ "Started At": "Started At",
+ "Ended At": "Ended At",
+ "Make Open-Ended": "Make Open-Ended",
+ "Open-Ended": "Open-Ended",
+ "Analytics Target IDs": "Analytics Target IDs",
+ "Analytics Target ID": "Analytics Target ID",
+ "Name": "Name",
+ "Metric": "Metric",
+ "Start Date": "Start Date",
+ "End Date": "End Date",
+ "Expected Value": "Expected Value",
+ "Filters": "Filters",
+ "Clear Filters": "Clear Filters",
+ "Search Query": "Search Query",
+ "Sort By": "Sort By",
+ "Reverse Order": "Reverse Order",
+ "Return Policy Profile ID": "Return Policy Profile ID",
+ "Default Profile Only": "Default Profile Only",
+ "Market ID": "Market ID",
+ "Market Type": "Market Type",
"Sender Email": "Sender Email",
"BCC Recipients": "BCC Recipients",
"Requested Order Edit ID": "Requested Order Edit ID",
@@ -553,6 +675,7 @@
"Refund All Shipping": "Refund All Shipping",
"Shipping Amount": "Shipping Amount",
"Suggest Full Refund": "Suggest Full Refund",
+ "Bulk Operation ID": "Bulk Operation ID",
"Fulfillment Order ID": "Fulfillment Order ID",
"Fulfillment ID": "Fulfillment ID",
"Authorization Transaction ID": "Authorization Transaction ID",
@@ -560,7 +683,7 @@
"Draft Order ID": "Draft Order ID",
"Payment Gateway ID": "Payment Gateway ID",
"Source Name": "Source Name",
- "Search Query": "Search Query",
+ "Catalog Type": "Catalog Type",
"Blog ID": "Blog ID",
"Author Name": "Author Name",
"Body (HTML)": "Body (HTML)",
@@ -647,6 +770,31 @@
"Recipient Preferred Name": "Recipient Preferred Name",
"Recipient Message": "Recipient Message",
"Send Notification At": "Send Notification At",
+ "Marketing Activity ID": "Marketing Activity ID",
+ "Remote ID": "Remote ID",
+ "Channel Handle": "Channel Handle",
+ "Day": "Day",
+ "UTC Offset": "UTC Offset",
+ "Impressions": "Impressions",
+ "Views": "Views",
+ "Clicks": "Clicks",
+ "Shares": "Shares",
+ "Favorites": "Favorites",
+ "Comments": "Comments",
+ "Unsubscribes": "Unsubscribes",
+ "Complaints": "Complaints",
+ "Failed Sends": "Failed Sends",
+ "Sends": "Sends",
+ "Unique Views": "Unique Views",
+ "Unique Clicks": "Unique Clicks",
+ "Sessions": "Sessions",
+ "Orders": "Orders",
+ "First-Time Customers": "First-Time Customers",
+ "Returning Customers": "Returning Customers",
+ "Primary Conversions": "Primary Conversions",
+ "All Conversions": "All Conversions",
+ "Ad Spend": "Ad Spend",
+ "Sales": "Sales",
"Risk Level": "Risk Level",
"Facts": "Facts",
"Financial Status": "Financial Status",
@@ -672,10 +820,11 @@
"Variants": "Variants",
"Default Variant Handling": "Default Variant Handling",
"Refund Transactions": "Refund Transactions",
+ "Script URL": "Script URL",
+ "Cache": "Cache",
"Match": "Match",
"Conditions": "Conditions",
"Theme ZIP URL": "Theme ZIP URL",
- "Name": "Name",
"Role": "Role",
"Old Path": "Old Path",
"Target": "Target",
@@ -693,18 +842,25 @@
"Page ID": "Page ID",
"Media IDs": "Media IDs",
"Option IDs": "Option IDs",
+ "Saved Search ID": "Saved Search ID",
+ "Script Tag ID": "Script Tag ID",
"Theme ID": "Theme ID",
"File Paths": "File Paths",
"URL Redirect ID": "URL Redirect ID",
+ "Web Presence ID": "Web Presence ID",
"New Title": "New Title",
"Copy Images": "Copy Images",
"Copy Translations": "Copy Translations",
"Standard Type": "Standard Type",
"Abandonment ID": "Abandonment ID",
+ "Business Entity ID": "Business Entity ID",
"Abandoned Checkout ID": "Abandoned Checkout ID",
"Bulk Creation ID": "Bulk Creation ID",
+ "Domain ID": "Domain ID",
+ "Event ID": "Event ID",
"Line Items Cursor": "Line Items Cursor",
"Job ID": "Job ID",
+ "Marketing Event ID": "Marketing Event ID",
"Owner Type": "Owner Type",
"Namespace": "Namespace",
"Key": "Key",
@@ -718,17 +874,19 @@
"Reason Notes": "Reason Notes",
"External ID": "External ID",
"Notify Merchant": "Notify Merchant",
- "Sort By": "Sort By",
- "Reverse Order": "Reverse Order",
"Limit": "Limit",
"Sort": "Sort",
+ "Region Code": "Region Code",
+ "Consent Required": "Consent Required",
+ "Data Sale Opt-Out Required": "Data Sale Opt-Out Required",
+ "Policy ID": "Policy ID",
"Merchant Owned Only": "Merchant Owned Only",
"Fulfillment Order Line Item IDs": "Fulfillment Order Line Item IDs",
"Include Inactive": "Include Inactive",
"Include Legacy": "Include Legacy",
"Pinned Status": "Pinned Status",
"Owner ID": "Owner ID",
- "Catalog Type": "Catalog Type",
+ "Terms Type": "Terms Type",
"Exclude Activated": "Exclude Activated",
"File Paths or Patterns": "File Paths or Patterns",
"Roles": "Roles",
@@ -748,6 +906,10 @@
"Deadline": "Deadline",
"Quantities": "Quantities",
"Product Handle": "Product Handle",
+ "Mutation": "Mutation",
+ "Variables per Execution": "Variables per Execution",
+ "Client Identifier": "Client Identifier",
+ "Bulk Query": "Bulk Query",
"Restock Items": "Restock Items",
"Refund Method": "Refund Method",
"Store Credit Expiry": "Store Credit Expiry",
@@ -776,6 +938,20 @@
"Payment Terms Template ID": "Payment Terms Template ID",
"Payment Terms Issued At": "Payment Terms Issued At",
"Payment Due At": "Payment Due At",
+ "UTM Campaign (to find the activity)": "UTM Campaign (to find the activity)",
+ "UTM Source (to find the activity)": "UTM Source (to find the activity)",
+ "UTM Medium (to find the activity)": "UTM Medium (to find the activity)",
+ "Tactic": "Tactic",
+ "Channel Type": "Channel Type",
+ "Remote URL": "Remote URL",
+ "Preview Image URL": "Preview Image URL",
+ "Referring Domain": "Referring Domain",
+ "Budget Type": "Budget Type",
+ "Budget Amount": "Budget Amount",
+ "Scheduled Start": "Scheduled Start",
+ "Scheduled End": "Scheduled End",
+ "Actual Start": "Actual Start",
+ "Actual End": "Actual End",
"Country Codes To Add": "Country Codes To Add",
"Country Codes To Remove": "Country Codes To Remove",
"SKU": "SKU",
@@ -800,6 +976,12 @@
"Values to Add": "Values to Add",
"Values to Rename": "Values to Rename",
"Value IDs to Delete": "Value IDs to Delete",
+ "UTM Campaign": "UTM Campaign",
+ "UTM Source": "UTM Source",
+ "UTM Medium": "UTM Medium",
+ "URL Parameter Value": "URL Parameter Value",
+ "Hierarchy Level": "Hierarchy Level",
+ "Parent Remote ID": "Parent Remote ID",
"Fields": "Fields",
"Files": "Files",
"Method": "Method",
@@ -854,6 +1036,46 @@
"The end_cursor from the previous page. Leave empty for the first page; pass it only while has_next_page is true.": "The end_cursor from the previous page. Leave empty for the first page; pass it only while has_next_page is true.",
"To read more rates of one zone: that zone's zone_token from a previous call. Returns only that zone.": "To read more rates of one zone: that zone's zone_token from a previous call. Returns only that zone.",
"With zone_token: the zone's rates_end_cursor from a previous call, to read its next 50 rates.": "With zone_token: the zone's rates_end_cursor from a previous call, to read its next 50 rates.",
+ "The annotation id, numeric or \"gid://shopify/AnalyticsAnnotation/…\", as returned by create_analytics_annotation.": "The annotation id, numeric or \"gid://shopify/AnalyticsAnnotation/…\", as returned by create_analytics_annotation.",
+ "New kind of event. Leave empty to keep it.": "New kind of event. Leave empty to keep it.",
+ "New chart marker text, at most 75 characters. Leave empty to keep it.": "New chart marker text, at most 75 characters. Leave empty to keep it.",
+ "New plain-text context, at most 150 characters. Leave empty to keep it.": "New plain-text context, at most 150 characters. Leave empty to keep it.",
+ "Remove the description. Do not combine with Description.": "Remove the description. Do not combine with Description.",
+ "New start, ISO 8601 with a time zone, for example 2026-11-28T00:00:00Z. Leave empty to keep it.": "New start, ISO 8601 with a time zone, for example 2026-11-28T00:00:00Z. Leave empty to keep it.",
+ "New end, ISO 8601 with a time zone. Leave empty to keep it.": "New end, ISO 8601 with a time zone. Leave empty to keep it.",
+ "Remove the end so the event shows as still running. Do not combine with Ended At.": "Remove the end so the event shows as still running. Do not combine with Ended At.",
+ "The kind of event, for example campaign, product_launch, store_redesign or other.": "The kind of event, for example campaign, product_launch, store_redesign or other.",
+ "Text shown on the chart marker, at most 75 characters.": "Text shown on the chart marker, at most 75 characters.",
+ "Optional extra context, plain text, at most 150 characters.": "Optional extra context, plain text, at most 150 characters.",
+ "When the event started, ISO 8601 with a time zone, for example 2026-11-28T00:00:00Z.": "When the event started, ISO 8601 with a time zone, for example 2026-11-28T00:00:00Z.",
+ "When the event ended, ISO 8601 with a time zone. Leave empty for a point-in-time marker. Must not be before Started At.": "When the event ended, ISO 8601 with a time zone. Leave empty for a point-in-time marker. Must not be before Started At.",
+ "The event is still running and has no end yet. Do not combine with Ended At.": "The event is still running and has no end yet. Do not combine with Ended At.",
+ "Targets to delete, numeric or \"gid://shopify/AnalyticsTarget/…\". Find them with list_analytics_targets.": "Targets to delete, numeric or \"gid://shopify/AnalyticsTarget/…\". Find them with list_analytics_targets.",
+ "The target id, numeric or \"gid://shopify/AnalyticsTarget/…\". Find it with list_analytics_targets.": "The target id, numeric or \"gid://shopify/AnalyticsTarget/…\". Find it with list_analytics_targets.",
+ "New label for the target. Leave empty to keep it.": "New label for the target. Leave empty to keep it.",
+ "New ShopifyQL metric identifier, for example total_sales or orders. Leave empty to keep it.": "New ShopifyQL metric identifier, for example total_sales or orders. Leave empty to keep it.",
+ "New first day of the period, YYYY-MM-DD. Leave empty to keep it.": "New first day of the period, YYYY-MM-DD. Leave empty to keep it.",
+ "New last day of the period, YYYY-MM-DD. Leave empty to keep it.": "New last day of the period, YYYY-MM-DD. Leave empty to keep it.",
+ "New goal value, greater than 0. Leave empty to keep it.": "New goal value, greater than 0. Leave empty to keep it.",
+ "New ShopifyQL filter expression, for example shipping_country = 'US'. Leave empty to keep the current filters.": "New ShopifyQL filter expression, for example shipping_country = 'US'. Leave empty to keep the current filters.",
+ "Remove the filters so the target tracks the whole store. Do not combine with Filters.": "Remove the filters so the target tracks the whole store. Do not combine with Filters.",
+ "Label for the target, for example \"Q1 Sales Target\".": "Label for the target, for example \"Q1 Sales Target\".",
+ "ShopifyQL metric identifier in lower case, for example total_sales or orders. Shopify rejects metrics that cannot have a target (INVALID_METRIC).": "ShopifyQL metric identifier in lower case, for example total_sales or orders. Shopify rejects metrics that cannot have a target (INVALID_METRIC).",
+ "First day of the target period, YYYY-MM-DD.": "First day of the target period, YYYY-MM-DD.",
+ "Last day of the target period, YYYY-MM-DD. Must not be before the start date.": "Last day of the target period, YYYY-MM-DD. Must not be before the start date.",
+ "The goal value, greater than 0 (for money metrics, an amount in the shop currency).": "The goal value, greater than 0 (for money metrics, an amount in the shop currency).",
+ "Optional ShopifyQL filter expression that narrows the data, for example shipping_country = 'US'. Leave empty to track the whole store.": "Optional ShopifyQL filter expression that narrows the data, for example shipping_country = 'US'. Leave empty to track the whole store.",
+ "Shopify search syntax, for example \"metric:total_sales\" or \"start_date:>=2026-01-01 end_date:<=2026-12-31\". Leave empty to list all.": "Shopify search syntax, for example \"metric:total_sales\" or \"start_date:>=2026-01-01 end_date:<=2026-12-31\". Leave empty to list all.",
+ "Field to sort by. Defaults to ID.": "Field to sort by. Defaults to ID.",
+ "Return results in reverse sort order (for example newest first).": "Return results in reverse sort order (for example newest first).",
+ "How many records to return, 1 to 100. Defaults to 50.": "How many records to return, 1 to 100. Defaults to 50.",
+ "The profile id, numeric or \"gid://shopify/ReturnPolicyProfile/…\". Find it with list_return_policy_profiles or in a market's return_policy_profile_id.": "The profile id, numeric or \"gid://shopify/ReturnPolicyProfile/…\". Find it with list_return_policy_profiles or in a market's return_policy_profile_id.",
+ "Yes returns only the default profile, No only the custom profiles. Leave empty for all.": "Yes returns only the default profile, No only the custom profiles. Leave empty for all.",
+ "The market id, numeric or \"gid://shopify/Market/…\". Find it with list_markets.": "The market id, numeric or \"gid://shopify/Market/…\". Find it with list_markets.",
+ "Shopify markets search syntax, for example \"status:ACTIVE\", \"name:Europe\" or \"market_type:REGION\". Leave empty to list all.": "Shopify markets search syntax, for example \"status:ACTIVE\", \"name:Europe\" or \"market_type:REGION\". Leave empty to list all.",
+ "Only return markets of this type. Leave empty for all types.": "Only return markets of this type. Leave empty for all types.",
+ "Field to sort by. Defaults to NAME.": "Field to sort by. Defaults to NAME.",
+ "How many records to return, 1 to 15. Defaults to 15.": "How many records to return, 1 to 15. Defaults to 15.",
"What the new payment method is for.": "What the new payment method is for.",
"The id of the order, draft order or subscription contract, numeric or a full id such as \"gid://shopify/Order/450789469\", \"gid://shopify/DraftOrder/…\" or \"gid://shopify/SubscriptionContract/…\". It must match the resource type; Shopify receives the number.": "The id of the order, draft order or subscription contract, numeric or a full id such as \"gid://shopify/Order/450789469\", \"gid://shopify/DraftOrder/…\" or \"gid://shopify/SubscriptionContract/…\". It must match the resource type; Shopify receives the number.",
"Send from this address instead of the store default, for example \"[email protected]\".": "Send from this address instead of the store default, for example \"[email protected]\".",
@@ -876,6 +1098,7 @@
"Include the full shipping cost in the suggestion. Off by default.": "Include the full shipping cost in the suggestion. Off by default.",
"Refund only this much shipping, for example 4.50. Ignored when refunding all shipping.": "Refund only this much shipping, for example 4.50. Ignored when refunding all shipping.",
"Suggest refunding everything still refundable on the order. Off by default.": "Suggest refunding everything still refundable on the order. Off by default.",
+ "The bulk operation id, numeric or \"gid://shopify/BulkOperation/…\". Find running ones with list_bulk_operations.": "The bulk operation id, numeric or \"gid://shopify/BulkOperation/…\". Find running ones with list_bulk_operations.",
"The fulfillment order to cancel, numeric or \"gid://shopify/FulfillmentOrder/…\". Find it with list_order_fulfillment_orders.": "The fulfillment order to cancel, numeric or \"gid://shopify/FulfillmentOrder/…\". Find it with list_order_fulfillment_orders.",
"The fulfillment to cancel, numeric or \"gid://shopify/Fulfillment/…\". Find it with list_order_fulfillments.": "The fulfillment to cancel, numeric or \"gid://shopify/Fulfillment/…\". Find it with list_order_fulfillments.",
"The order id, numeric or \"gid://shopify/Order/…\".": "The order id, numeric or \"gid://shopify/Order/…\".",
@@ -888,11 +1111,14 @@
"Optional channel label stored on the order, for example \"phone\".": "Optional channel label stored on the order, for example \"phone\".",
"Shopify search syntax, for example \"created_at:>=2026-09-01\". Leave empty to count all.": "Shopify search syntax, for example \"created_at:>=2026-09-01\". Leave empty to count all.",
"Shopify blog search syntax, for example \"title:News\". Leave empty to count all.": "Shopify blog search syntax, for example \"title:News\". Leave empty to count all.",
+ "Only count catalogs of this type. Leave empty for all types.": "Only count catalogs of this type. Leave empty for all types.",
+ "Shopify catalog search syntax, for example \"status:ACTIVE\" or \"title:wholesale\". Leave empty to count all.": "Shopify catalog search syntax, for example \"status:ACTIVE\" or \"title:wholesale\". Leave empty to count all.",
"Shopify collection search syntax, for example \"collection_type:custom\". Leave empty to count all.": "Shopify collection search syntax, for example \"collection_type:custom\". Leave empty to count all.",
"Filter by created_at, updated_at or id, for example \"created_at:>2026-01-01\". Leave empty to count all.": "Filter by created_at, updated_at or id, for example \"created_at:>2026-01-01\". Leave empty to count all.",
"Optional Shopify search syntax on the codes, for example \"times_used:0\". Leave empty to count all.": "Optional Shopify search syntax on the codes, for example \"times_used:0\". Leave empty to count all.",
"Shopify discount search syntax, for example \"status:active method:code\". Leave empty to count all.": "Shopify discount search syntax, for example \"status:active method:code\". Leave empty to count all.",
"Shopify draft order search syntax, for example \"status:open\". Leave empty to count all.": "Shopify draft order search syntax, for example \"status:open\". Leave empty to count all.",
+ "Shopify event search syntax, for example \"subject_type:'ORDER'\" or \"created_at:>2026-09-01\". Leave empty to count all.": "Shopify event search syntax, for example \"subject_type:'ORDER'\" or \"created_at:>2026-09-01\". Leave empty to count all.",
"Shopify gift card search syntax, for example \"status:enabled\". Leave empty to count all.": "Shopify gift card search syntax, for example \"status:enabled\". Leave empty to count all.",
"Shopify location search syntax, for example \"name:Warehouse*\". Leave empty to count all.": "Shopify location search syntax, for example \"name:Warehouse*\". Leave empty to count all.",
"Shopify product search syntax, for example \"status:active\" or \"tag:sale\". Leave empty to count all.": "Shopify product search syntax, for example \"status:active\" or \"tag:sale\". Leave empty to count all.",
@@ -1031,6 +1257,32 @@
"Optional name used to greet the recipient, for example \"Sam\".": "Optional name used to greet the recipient, for example \"Sam\".",
"Optional personal message included in the recipient notification.": "Optional personal message included in the recipient notification.",
"Optional time to email the recipient, ISO 8601. Leave empty to send when Shopify processes it.": "Optional time to email the recipient, ISO 8601. Leave empty to send when Shopify processes it.",
+ "The activity id, numeric or \"gid://shopify/MarketingActivity/…\". Use this, the remote id, or a channel handle.": "The activity id, numeric or \"gid://shopify/MarketingActivity/…\". Use this, the remote id, or a channel handle.",
+ "Your own id the activity was created with, for example \"fb-campaign-2026-spring\".": "Your own id the activity was created with, for example \"fb-campaign-2026-spring\".",
+ "For channel-level metrics only: the channel handle your Shopify partner manager gave you. Leave empty for activity metrics.": "For channel-level metrics only: the channel handle your Shopify partner manager gave you. Leave empty for activity metrics.",
+ "The day the metrics cover, YYYY-MM-DD, for example \"2026-09-22\".": "The day the metrics cover, YYYY-MM-DD, for example \"2026-09-22\".",
+ "Time zone offset of that day, for example \"+00:00\" or \"-05:00\".": "Time zone offset of that day, for example \"+00:00\" or \"-05:00\".",
+ "Times the content was shown that day.": "Times the content was shown that day.",
+ "Views that day.": "Views that day.",
+ "Clicks that day.": "Clicks that day.",
+ "Shares that day.": "Shares that day.",
+ "Favorites or likes that day.": "Favorites or likes that day.",
+ "Comments that day.": "Comments that day.",
+ "Unsubscribes that day.": "Unsubscribes that day.",
+ "Spam complaints that day.": "Spam complaints that day.",
+ "Messages that failed to send that day.": "Messages that failed to send that day.",
+ "Messages sent that day.": "Messages sent that day.",
+ "Unique viewers that day.": "Unique viewers that day.",
+ "Unique clickers that day.": "Unique clickers that day.",
+ "Store sessions from the activity that day.": "Store sessions from the activity that day.",
+ "Orders attributed to the activity that day (may be fractional for shared attribution).": "Orders attributed to the activity that day (may be fractional for shared attribution).",
+ "New customers attributed that day.": "New customers attributed that day.",
+ "Returning customers attributed that day.": "Returning customers attributed that day.",
+ "Primary conversions that day.": "Primary conversions that day.",
+ "All conversions that day.": "All conversions that day.",
+ "Amount spent that day, in the currency below.": "Amount spent that day, in the currency below.",
+ "Sales attributed that day, in the currency below.": "Sales attributed that day, in the currency below.",
+ "ISO currency code of ad spend and sales, for example \"USD\". Needed when either is set.": "ISO currency code of ad spend and sales, for example \"USD\". Needed when either is set.",
"The assessed fraud risk.": "The assessed fraud risk.",
"Reasons behind the assessment, at least one.": "Reasons behind the assessment, at least one.",
"The items to order. Give either a variant id (price comes from the product) or a title and price for a custom item.": "The items to order. Give either a variant id (price comes from the product) or a title and price for a custom item.",
@@ -1085,6 +1337,8 @@
"Presentment (customer) currency of the refund, for example \"EUR\" (presentment_currency_code from calculate_refund). Required when the presentment currency differs from the shop currency; then every amount given here must be the presentment amount. Leave empty when both currencies are the same.": "Presentment (customer) currency of the refund, for example \"EUR\" (presentment_currency_code from calculate_refund). Required when the presentment currency differs from the shop currency; then every amount given here must be the presentment amount. Leave empty when both currencies are the same.",
"Internal reason for the refund.": "Internal reason for the refund.",
"Email the customer a refund notification. Off by default.": "Email the customer a refund notification. Off by default.",
+ "HTTPS URL of the JavaScript file, for example \"https://cdn.example.com/widget.js\".": "HTTPS URL of the JavaScript file, for example \"https://cdn.example.com/widget.js\".",
+ "Yes lets Shopify serve the script from its CDN cache (changes to the file then show up with a delay). Leave empty for Shopify's default.": "Yes lets Shopify serve the script from its CDN cache (changes to the file then show up with a delay). Leave empty for Shopify's default.",
"Collection title, for example \"Summer Items\".": "Collection title, for example \"Summer Items\".",
"Whether products must match all conditions or any of them.": "Whether products must match all conditions or any of them.",
"The rules products must match, for example field product_tag, relation TAGGED_WITH, value \"summer\".": "The rules products must match, for example field product_tag, relation TAGGED_WITH, value \"summer\".",
@@ -1104,6 +1358,7 @@
"The redeem code ids to delete, for example \"gid://shopify/DiscountRedeemCode/241951653\" (from list_discount_redeem_codes). Leave empty when using search.": "The redeem code ids to delete, for example \"gid://shopify/DiscountRedeemCode/241951653\" (from list_discount_redeem_codes). Leave empty when using search.",
"Delete every code of this discount matching this search: \"times_used:<n>\" such as \"times_used:0\", or plain text matched against the code such as \"SUMMER\". Plain text is matched word by word, not exactly, so preview it with list_discount_redeem_codes first. Other field filters (for example \"code:\") are rejected. Leave empty when using code_ids.": "Delete every code of this discount matching this search: \"times_used:<n>\" such as \"times_used:0\", or plain text matched against the code such as \"SUMMER\". Plain text is matched word by word, not exactly, so preview it with list_discount_redeem_codes first. Other field filters (for example \"code:\") are rejected. Leave empty when using code_ids.",
"The full discount id, for example \"gid://shopify/DiscountCodeNode/123\" or \"gid://shopify/DiscountAutomaticNode/456\".": "The full discount id, for example \"gid://shopify/DiscountCodeNode/123\" or \"gid://shopify/DiscountAutomaticNode/456\".",
+ "The activity id, numeric or \"gid://shopify/MarketingActivity/…\". Use this or the remote id.": "The activity id, numeric or \"gid://shopify/MarketingActivity/…\". Use this or the remote id.",
"The fulfillment service, numeric or \"gid://shopify/FulfillmentService/…\". Find it with list_fulfillment_services.": "The fulfillment service, numeric or \"gid://shopify/FulfillmentService/…\". Find it with list_fulfillment_services.",
"What happens to the service location and its inventory: TRANSFER to another location, KEEP as a regular location, or DELETE.": "What happens to the service location and its inventory: TRANSFER to another location, KEEP as a regular location, or DELETE.",
"Required with TRANSFER, not allowed otherwise: the active merchant-managed location that receives the inventory, numeric or \"gid://shopify/Location/…\". Find it with list_locations.": "Required with TRANSFER, not allowed otherwise: the active merchant-managed location that receives the inventory, numeric or \"gid://shopify/Location/…\". Find it with list_locations.",
@@ -1117,9 +1372,12 @@
"What happens to variants when the options are removed.": "What happens to variants when the options are removed.",
"The product the variants belong to, numeric or \"gid://shopify/Product/…\".": "The product the variants belong to, numeric or \"gid://shopify/Product/…\".",
"Ids of the variants to delete, numeric or \"gid://shopify/ProductVariant/…\".": "Ids of the variants to delete, numeric or \"gid://shopify/ProductVariant/…\".",
+ "The saved search id, numeric or \"gid://shopify/SavedSearch/…\" (see id from list_saved_searches).": "The saved search id, numeric or \"gid://shopify/SavedSearch/…\" (see id from list_saved_searches).",
+ "The script tag id, numeric or \"gid://shopify/ScriptTag/…\". Find it with list_script_tags.": "The script tag id, numeric or \"gid://shopify/ScriptTag/…\". Find it with list_script_tags.",
"The theme id, numeric or \"gid://shopify/OnlineStoreTheme/…\". Find it with list_themes.": "The theme id, numeric or \"gid://shopify/OnlineStoreTheme/…\". Find it with list_themes.",
"Paths of the files to delete, 1 to 50, for example [\"snippets/old-banner.liquid\"].": "Paths of the files to delete, 1 to 50, for example [\"snippets/old-banner.liquid\"].",
"The redirect id, numeric or \"gid://shopify/UrlRedirect/…\". Find it with list_url_redirects.": "The redirect id, numeric or \"gid://shopify/UrlRedirect/…\". Find it with list_url_redirects.",
+ "The web presence id, numeric or \"gid://shopify/MarketWebPresence/…\" (see id from list_web_presences).": "The web presence id, numeric or \"gid://shopify/MarketWebPresence/…\" (see id from list_web_presences).",
"Which media to detach from which variant, one entry per pair.": "Which media to detach from which variant, one entry per pair.",
"The product to copy, numeric or \"gid://shopify/Product/…\". Find it with search_products.": "The product to copy, numeric or \"gid://shopify/Product/…\". Find it with search_products.",
"Title of the copy, for example \"Organic Cotton T-Shirt (Copy)\".": "Title of the copy, for example \"Organic Cotton T-Shirt (Copy)\".",
@@ -1129,17 +1387,22 @@
"The standard metaobject type to enable, for example \"shopify--color-pattern\".": "The standard metaobject type to enable, for example \"shopify--color-pattern\".",
"The redeem code, for example \"SPRING15\".": "The redeem code, for example \"SPRING15\".",
"The abandonment id, numeric or \"gid://shopify/Abandonment/…\".": "The abandonment id, numeric or \"gid://shopify/Abandonment/…\".",
+ "The bulk_operation_id returned when the operation was started, numeric or \"gid://shopify/BulkOperation/…\".": "The bulk_operation_id returned when the operation was started, numeric or \"gid://shopify/BulkOperation/…\".",
+ "The entity id as returned by list_business_entities (a numeric id is read as \"gid://shopify/BusinessEntity/…\"). Leave empty for the primary entity.": "The entity id as returned by list_business_entities (a numeric id is read as \"gid://shopify/BusinessEntity/…\"). Leave empty for the primary entity.",
"The abandoned checkout id, numeric or \"gid://shopify/AbandonedCheckout/…\". Find it with list_abandoned_checkouts.": "The abandoned checkout id, numeric or \"gid://shopify/AbandonedCheckout/…\". Find it with list_abandoned_checkouts.",
"The collection handle, for example \"summer-sale\".": "The collection handle, for example \"summer-sale\".",
"The customer id, numeric such as \"207119551\" or \"gid://shopify/Customer/207119551\". Find it with search_customers.": "The customer id, numeric such as \"207119551\" or \"gid://shopify/Customer/207119551\". Find it with search_customers.",
"The bulk_creation_id returned by add_discount_redeem_codes, for example \"gid://shopify/DiscountRedeemCodeBulkCreation/989355205\" (a plain number is accepted).": "The bulk_creation_id returned by add_discount_redeem_codes, for example \"gid://shopify/DiscountRedeemCodeBulkCreation/989355205\" (a plain number is accepted).",
"How many records to return, 1 to 60. Defaults to 50.": "How many records to return, 1 to 60. Defaults to 50.",
"The full discount id, for example \"gid://shopify/DiscountCodeNode/123\" or \"gid://shopify/DiscountAutomaticNode/456\". Get it from list_discounts or find_discount_by_code.": "The full discount id, for example \"gid://shopify/DiscountCodeNode/123\" or \"gid://shopify/DiscountAutomaticNode/456\". Get it from list_discounts or find_discount_by_code.",
+ "The domain id, numeric or \"gid://shopify/Domain/…\" (see domain_id from list_web_presences). Leave empty for the primary domain.": "The domain id, numeric or \"gid://shopify/Domain/…\" (see domain_id from list_web_presences). Leave empty for the primary domain.",
+ "The event id, numeric (a basic event) or a full id such as \"gid://shopify/BasicEvent/422690323\" or \"gid://shopify/CommentEvent/…\". Find it with list_events.": "The event id, numeric (a basic event) or a full id such as \"gid://shopify/BasicEvent/422690323\" or \"gid://shopify/CommentEvent/…\". Find it with list_events.",
"The fulfillment order id, numeric or \"gid://shopify/FulfillmentOrder/…\". Find it with list_order_fulfillment_orders.": "The fulfillment order id, numeric or \"gid://shopify/FulfillmentOrder/…\". Find it with list_order_fulfillment_orders.",
"Leave empty for the first 50 line items. To read more, pass line_items_end_cursor from the previous call.": "Leave empty for the first 50 line items. To read more, pass line_items_end_cursor from the previous call.",
"The gift card id, numeric or \"gid://shopify/GiftCard/…\". Find it with search_gift_cards.": "The gift card id, numeric or \"gid://shopify/GiftCard/…\". Find it with search_gift_cards.",
"The job id returned by the start action, for example \"gid://shopify/Job/dc9b2604-c73b-45c6-8942-e235bac987e8\". A bare UUID such as \"dc9b2604-c73b-45c6-8942-e235bac987e8\" is also accepted.": "The job id returned by the start action, for example \"gid://shopify/Job/dc9b2604-c73b-45c6-8942-e235bac987e8\". A bare UUID such as \"dc9b2604-c73b-45c6-8942-e235bac987e8\" is also accepted.",
"The location id, numeric or \"gid://shopify/Location/…\". Find it with list_locations.": "The location id, numeric or \"gid://shopify/Location/…\". Find it with list_locations.",
+ "The marketing event id, numeric or \"gid://shopify/MarketingEvent/…\". Find it with list_marketing_events.": "The marketing event id, numeric or \"gid://shopify/MarketingEvent/…\". Find it with list_marketing_events.",
"The resource type of the definition, for example PRODUCT.": "The resource type of the definition, for example PRODUCT.",
"The definition namespace, for example \"custom\".": "The definition namespace, for example \"custom\".",
"The definition key, for example \"care_instructions\".": "The definition key, for example \"care_instructions\".",
@@ -1163,8 +1426,6 @@
"Optional partial hold: the fulfillment order line items and quantities to hold. Leave empty to hold the whole fulfillment order.": "Optional partial hold: the fulfillment order line items and quantities to hold. Leave empty to hold the whole fulfillment order.",
"Shopify search syntax, for example \"created_at:>=2026-09-01\" or \"status:open\". Leave empty for all.": "Shopify search syntax, for example \"created_at:>=2026-09-01\" or \"status:open\". Leave empty for all.",
"Field to sort by. Defaults to the checkout id.": "Field to sort by. Defaults to the checkout id.",
- "Return results in reverse sort order (for example newest first).": "Return results in reverse sort order (for example newest first).",
- "How many records to return, 1 to 100. Defaults to 50.": "How many records to return, 1 to 100. Defaults to 50.",
"How many records to return, 1 to 250. Defaults to 50.": "How many records to return, 1 to 250. Defaults to 50.",
"How many tags to return, 1 to 250.": "How many tags to return, 1 to 250.",
"Alphabetical (default) or most used first.": "Alphabetical (default) or most used first.",
@@ -1173,10 +1434,22 @@
"Field to sort by. Defaults to the id.": "Field to sort by. Defaults to the id.",
"How many records to return, 1 to 160. Defaults to 50.": "How many records to return, 1 to 160. Defaults to 50.",
"Shopify blog search syntax, for example \"title:News\" or \"handle:news\". Leave empty to list all.": "Shopify blog search syntax, for example \"title:News\" or \"handle:news\". Leave empty to list all.",
+ "Only operations in this state.": "Only operations in this state.",
+ "Only bulk queries or only bulk mutations.": "Only bulk queries or only bulk mutations.",
+ "Extra Shopify search syntax, for example \"created_at:>2026-09-01\". Leave empty for no extra filter.": "Extra Shopify search syntax, for example \"created_at:>2026-09-01\". Leave empty for no extra filter.",
+ "Field to sort by. Defaults to the creation time.": "Field to sort by. Defaults to the creation time.",
"Optional Shopify search syntax, for example \"active:true\" or \"id:123\". Leave empty to list all.": "Optional Shopify search syntax, for example \"active:true\" or \"id:123\". Leave empty to list all.",
+ "Only catalogs of this type. Leave empty for all types.": "Only catalogs of this type. Leave empty for all types.",
+ "Shopify catalog search syntax, for example \"title:wholesale\", \"status:ACTIVE\" or \"company_id:123\". Leave empty to list all.": "Shopify catalog search syntax, for example \"title:wholesale\", \"status:ACTIVE\" or \"company_id:123\". Leave empty to list all.",
+ "How many records to return, 1 to 200. Defaults to 50.": "How many records to return, 1 to 200. Defaults to 50.",
"Field to sort by. Defaults to the collection's own sort order.": "Field to sort by. Defaults to the collection's own sort order.",
"How many records to return, 1 to 80. Defaults to 50.": "How many records to return, 1 to 80. Defaults to 50.",
"Shopify comment search syntax, for example \"status:pending\" or \"published_status:published\". Leave empty to list all.": "Shopify comment search syntax, for example \"status:pending\" or \"published_status:published\". Leave empty to list all.",
+ "Only policies for this two-letter country code, for example \"US\" or \"DE\".": "Only policies for this two-letter country code, for example \"US\" or \"DE\".",
+ "Only policies for this ISO 3166-2 region code, country prefix included, for example \"USCA\" for California. A short code such as \"CA\" is prefixed with the country code when one is given.": "Only policies for this ISO 3166-2 region code, country prefix included, for example \"USCA\" for California. A short code such as \"CA\" is prefixed with the country code when one is given.",
+ "Yes returns only policies that require consent, No only those that do not. Leave empty for both.": "Yes returns only policies that require consent, No only those that do not. Leave empty for both.",
+ "Yes returns only policies that require a data-sale opt-out, No only those that do not. Leave empty for both.": "Yes returns only policies that require a data-sale opt-out, No only those that do not. Leave empty for both.",
+ "Only this policy, numeric or \"gid://shopify/ConsentPolicy/…\".": "Only this policy, numeric or \"gid://shopify/ConsentPolicy/…\".",
"Optional order search syntax to narrow the list, for example \"financial_status:paid\" or \"created_at:>=2026-01-01\".": "Optional order search syntax to narrow the list, for example \"financial_status:paid\" or \"created_at:>=2026-01-01\".",
"Field to sort by. Defaults to the order id.": "Field to sort by. Defaults to the order id.",
"How many records to return, 1 to 40. Defaults to 40.": "How many records to return, 1 to 40. Defaults to 40.",
@@ -1187,11 +1460,11 @@
"How many records to return, 1 to 45. Defaults to 45.": "How many records to return, 1 to 45. Defaults to 45.",
"Shopify draft order search syntax, for example \"status:open\", \"status:invoice_sent\" or \"tag:quote\". Leave empty for all.": "Shopify draft order search syntax, for example \"status:open\", \"status:invoice_sent\" or \"tag:quote\". Leave empty for all.",
"Field to sort by. Defaults to the draft id.": "Field to sort by. Defaults to the draft id.",
+ "Shopify event search syntax, for example \"action:'destroy' AND subject_type:'PRODUCT'\" or \"created_at:>2026-09-01\". Leave empty to list all.": "Shopify event search syntax, for example \"action:'destroy' AND subject_type:'PRODUCT'\" or \"created_at:>2026-09-01\". Leave empty to list all.",
"Field to sort by. Defaults to when the event happened.": "Field to sort by. Defaults to when the event happened.",
"The fulfillment order to move, numeric or \"gid://shopify/FulfillmentOrder/…\". Find it with list_order_fulfillment_orders.": "The fulfillment order to move, numeric or \"gid://shopify/FulfillmentOrder/…\". Find it with list_order_fulfillment_orders.",
"Optional location search, for example \"name:Warehouse*\". Leave empty to list all candidates.": "Optional location search, for example \"name:Warehouse*\". Leave empty to list all candidates.",
"Optional: only check these fulfillment order line items (line_items[].id from get_fulfillment_order). Leave empty to check all.": "Optional: only check these fulfillment order line items (line_items[].id from get_fulfillment_order). Leave empty to check all.",
- "How many records to return, 1 to 200. Defaults to 50.": "How many records to return, 1 to 200. Defaults to 50.",
"Shopify inventory item search syntax, for example \"sku:TSHIRT-RED-L\". Leave empty to list all.": "Shopify inventory item search syntax, for example \"sku:TSHIRT-RED-L\". Leave empty to list all.",
"List this item's levels at every location, numeric or \"gid://shopify/InventoryItem/…\". Leave empty when giving a location.": "List this item's levels at every location, numeric or \"gid://shopify/InventoryItem/…\". Leave empty when giving a location.",
"List every item stocked at this location, numeric or \"gid://shopify/Location/…\". Leave empty when giving an item.": "List every item stocked at this location, numeric or \"gid://shopify/Location/…\". Leave empty when giving an item.",
@@ -1201,6 +1474,7 @@
"Also return deactivated locations. Off by default.": "Also return deactivated locations. Off by default.",
"Also return legacy fulfillment-service locations. Off by default.": "Also return legacy fulfillment-service locations. Off by default.",
"Field to sort by. Defaults to the name.": "Field to sort by. Defaults to the name.",
+ "Shopify marketing event search syntax, for example \"type:AD\", \"app_id:123\" or \"started_at:>2026-01-01\". Leave empty to list all.": "Shopify marketing event search syntax, for example \"type:AD\", \"app_id:123\" or \"started_at:>2026-01-01\". Leave empty to list all.",
"The resource type the definitions belong to, for example PRODUCT.": "The resource type the definitions belong to, for example PRODUCT.",
"Only definitions in this namespace, for example \"custom\".": "Only definitions in this namespace, for example \"custom\".",
"Only the definition with this key.": "Only the definition with this key.",
@@ -1215,9 +1489,16 @@
"Optional Shopify search syntax on the fulfillment orders, for example \"status:open\". Leave empty to list all.": "Optional Shopify search syntax on the fulfillment orders, for example \"status:open\". Leave empty to list all.",
"How many records to return, 1 to 4. Defaults to 4.": "How many records to return, 1 to 4. Defaults to 4.",
"Shopify page search syntax, for example \"title:FAQ\" or \"published_status:unpublished\". Leave empty to list all.": "Shopify page search syntax, for example \"title:FAQ\" or \"published_status:unpublished\". Leave empty to list all.",
+ "Shopify dispute search syntax, for example \"status:needs_response\" or \"initiated_at:>2026-09-01\". Leave empty to list all.": "Shopify dispute search syntax, for example \"status:needs_response\" or \"initiated_at:>2026-09-01\". Leave empty to list all.",
+ "Only templates of this type. Leave empty for all.": "Only templates of this type. Leave empty for all.",
"Field to sort by. Defaults to position.": "Field to sort by. Defaults to position.",
"How many records to return, 1 to 130. Defaults to 50.": "How many records to return, 1 to 130. Defaults to 50.",
"Only list publications of this catalog type. Leave empty for all.": "Only list publications of this catalog type. Leave empty for all.",
+ "Which admin list the saved searches belong to.": "Which admin list the saved searches belong to.",
+ "Only return script tags with exactly this src URL, for example \"https://cdn.example.com/widget.js\".": "Only return script tags with exactly this src URL, for example \"https://cdn.example.com/widget.js\".",
+ "Shopify script tag search syntax, for example \"created_at:>2026-01-01\" or \"id:>=1000\". Leave empty to list all.": "Shopify script tag search syntax, for example \"created_at:>2026-01-01\" or \"id:>=1000\". Leave empty to list all.",
+ "Shopify receipt search syntax, for example \"state:COMPLETED\" or \"created_at:>2026-09-01\". Leave empty to list all.": "Shopify receipt search syntax, for example \"state:COMPLETED\" or \"created_at:>2026-09-01\". Leave empty to list all.",
+ "How many records to return, 1 to 110. Defaults to 50.": "How many records to return, 1 to 110. Defaults to 50.",
"Yes hides templates the store has already enabled. Leave empty to include them.": "Yes hides templates the store has already enabled. Leave empty to include them.",
"Shopify search syntax, for example \"processed_at:>=2026-09-01\" or \"test:false\". Leave empty for all.": "Shopify search syntax, for example \"processed_at:>=2026-09-01\" or \"test:false\". Leave empty for all.",
"Only list these paths, up to 50; * matches any characters, for example [\"templates/*.json\", \"layout/theme.liquid\"]. Leave empty for every file.": "Only list these paths, up to 50; * matches any characters, for example [\"templates/*.json\", \"layout/theme.liquid\"]. Leave empty for every file.",
@@ -1249,7 +1530,6 @@
"Shopify customer search syntax, for example \"email:[email protected]\", \"country:Canada\" or \"orders_count:>5\". Leave empty to list all customers.": "Shopify customer search syntax, for example \"email:[email protected]\", \"country:Canada\" or \"orders_count:>5\". Leave empty to list all customers.",
"Field to sort by. Defaults to the customer id.": "Field to sort by. Defaults to the customer id.",
"Shopify gift card search syntax, for example \"status:enabled balance_status:partial\", or a code or its last 4 characters as plain text such as \"1234\". Leave empty to list all.": "Shopify gift card search syntax, for example \"status:enabled balance_status:partial\", or a code or its last 4 characters as plain text such as \"1234\". Leave empty to list all.",
- "How many records to return, 1 to 110. Defaults to 50.": "How many records to return, 1 to 110. Defaults to 50.",
"Shopify order search syntax, for example \"status:open financial_status:paid\", \"tag:wholesale\" or \"created_at:>=2026-01-01\". Leave empty to list all orders.": "Shopify order search syntax, for example \"status:open financial_status:paid\", \"tag:wholesale\" or \"created_at:>=2026-01-01\". Leave empty to list all orders.",
"Words to search for, for example \"t-shirts\".": "Words to search for, for example \"t-shirts\".",
"List the direct children of this category, for example \"aa-1\" or \"gid://shopify/TaxonomyCategory/aa-1\".": "List the direct children of this category, for example \"aa-1\" or \"gid://shopify/TaxonomyCategory/aa-1\".",
@@ -1274,6 +1554,10 @@
"The complete tag list. Replaces every existing tag; leave empty to keep the current tags.": "The complete tag list. Replaces every existing tag; leave empty to keep the current tags.",
"Every option the product must have, in order, for example Size with values \"S, M, L\". Options not listed are removed.": "Every option the product must have, in order, for example Size with values \"S, M, L\". Options not listed are removed.",
"Every variant the product must have. Variants not listed are deleted.": "Every variant the product must have. Variants not listed are deleted.",
+ "One GraphQL Admin mutation that reads its input from variables, for example \"mutation call($product: ProductCreateInput!) { productCreate(product: $product) { product { id title } userErrors { field message } } }\".": "One GraphQL Admin mutation that reads its input from variables, for example \"mutation call($product: ProductCreateInput!) { productCreate(product: $product) { product { id title } userErrors { field message } } }\".",
+ "A JSON array with one object per execution; each object holds the variables for one run of the mutation, for example [{\"product\": {\"title\": \"Sweater\"}}, {\"product\": {\"title\": \"Scarf\"}}].": "A JSON array with one object per execution; each object holds the variables for one run of the mutation, for example [{\"product\": {\"title\": \"Sweater\"}}, {\"product\": {\"title\": \"Scarf\"}}].",
+ "Optional label of your own to recognise the operation later.": "Optional label of your own to recognise the operation later.",
+ "A GraphQL Admin query without paging arguments, for example \"{ products { edges { node { id title variants { edges { node { id sku } } } } } } }\".": "A GraphQL Admin query without paging arguments, for example \"{ products { edges { node { id title variants { edges { node { id sku } } } } } } }\".",
"Why the order is cancelled.": "Why the order is cancelled.",
"Return the line items to inventory. Off by default.": "Return the line items to inventory. Off by default.",
"How to refund captured payments. Leave empty to cancel without refunding captured money (authorized payments are still voided).": "How to refund captured payments. Leave empty to cancel without refunding captured money (authorized payments are still voided).",
@@ -1358,6 +1642,24 @@
"Start date for net payment terms (for example net 30), ISO 8601.": "Start date for net payment terms (for example net 30), ISO 8601.",
"Due date for fixed-date payment terms, ISO 8601.": "Due date for fixed-date payment terms, ISO 8601.",
"Hold the stock for this draft until this time (ISO 8601).": "Hold the stock for this draft until this time (ISO 8601).",
+ "The activity id, numeric or \"gid://shopify/MarketingActivity/…\". Use this, the remote id, or the UTM values.": "The activity id, numeric or \"gid://shopify/MarketingActivity/…\". Use this, the remote id, or the UTM values.",
+ "utm_campaign the activity was created with. Set all three UTM values to identify the activity by them.": "utm_campaign the activity was created with. Set all three UTM values to identify the activity by them.",
+ "utm_source the activity was created with.": "utm_source the activity was created with.",
+ "utm_medium the activity was created with.": "utm_medium the activity was created with.",
+ "New state of the activity on the external platform.": "New state of the activity on the external platform.",
+ "New tactic. An activity cannot be changed to or from STOREFRONT_APP.": "New tactic. An activity cannot be changed to or from STOREFRONT_APP.",
+ "New channel type.": "New channel type.",
+ "New URL where the merchant manages the activity.": "New URL where the merchant manages the activity.",
+ "New public preview image URL.": "New public preview image URL.",
+ "New referring domain, for example \"facebook.com\".": "New referring domain, for example \"facebook.com\".",
+ "DAILY or LIFETIME. Set together with the budget amount; the pair replaces the stored budget.": "DAILY or LIFETIME. Set together with the budget amount; the pair replaces the stored budget.",
+ "New budget total, in the currency below.": "New budget total, in the currency below.",
+ "New total spent so far, in the currency below.": "New total spent so far, in the currency below.",
+ "ISO currency code of the budget and ad spend, for example \"USD\". Needed when either is set.": "ISO currency code of the budget and ad spend, for example \"USD\". Needed when either is set.",
+ "New planned start time, ISO 8601.": "New planned start time, ISO 8601.",
+ "New planned end time, ISO 8601.": "New planned end time, ISO 8601.",
+ "When the activity really started, ISO 8601.": "When the activity really started, ISO 8601.",
+ "When the activity really ended, ISO 8601.": "When the activity really ended, ISO 8601.",
"Where free shipping applies; replaces the current destination. Leave unset to keep it, or to use COUNTRIES when country codes are given.": "Where free shipping applies; replaces the current destination. Leave unset to keep it, or to use COUNTRIES when country codes are given.",
"With destination COUNTRIES: two-letter ISO country codes where free shipping should apply, for example \"US\" and \"CA\".": "With destination COUNTRIES: two-letter ISO country codes where free shipping should apply, for example \"US\" and \"CA\".",
"With destination COUNTRIES: two-letter ISO country codes to take out, for example \"MX\".": "With destination COUNTRIES: two-letter ISO country codes to take out, for example \"MX\".",
@@ -1414,9 +1716,31 @@
"Ids of option values to delete.": "Ids of option values to delete.",
"How variants follow value changes. Leave empty for the Shopify default (leave variants as they are).": "How variants follow value changes. Leave empty for the Shopify default (leave variants as they are).",
"The variants to change, one entry per variant. Fields left empty keep their values.": "The variants to change, one entry per variant. Fields left empty keep their values.",
+ "New HTTPS URL of the JavaScript file.": "New HTTPS URL of the JavaScript file.",
+ "Yes serves the script from Shopify's CDN cache, No loads it from the source each time. Leave empty to keep the current setting.": "Yes serves the script from Shopify's CDN cache, No loads it from the source each time. Leave empty to keep the current setting.",
"The new theme name, for example \"Dawn - holiday edit\".": "The new theme name, for example \"Dawn - holiday edit\".",
"New path to redirect from, starting with \"/\".": "New path to redirect from, starting with \"/\".",
"New target path or full URL.": "New target path or full URL.",
+ "Your own unique id for this activity, for example \"fb-campaign-2026-spring\". The same remote id updates the same activity.": "Your own unique id for this activity, for example \"fb-campaign-2026-spring\". The same remote id updates the same activity.",
+ "Name shown in the Shopify marketing section, for example \"Spring sale Facebook ads\".": "Name shown in the Shopify marketing section, for example \"Spring sale Facebook ads\".",
+ "Current state of the activity on the external platform.": "Current state of the activity on the external platform.",
+ "URL where the merchant manages this activity on the external platform, for example \"https://ads.example.com/campaigns/42\".": "URL where the merchant manages this activity on the external platform, for example \"https://ads.example.com/campaigns/42\".",
+ "The kind of marketing, for example AD, NEWSLETTER or POST.": "The kind of marketing, for example AD, NEWSLETTER or POST.",
+ "The channel the activity runs on.": "The channel the activity runs on.",
+ "utm_campaign value of the activity links, for example \"spring-sale\". Set all three UTM values or none. Cannot be changed later.": "utm_campaign value of the activity links, for example \"spring-sale\". Set all three UTM values or none. Cannot be changed later.",
+ "utm_source value, for example \"facebook\".": "utm_source value, for example \"facebook\".",
+ "utm_medium value, for example \"cpc\".": "utm_medium value, for example \"cpc\".",
+ "Value of the tracking URL parameter used instead of UTM values. Cannot be changed later.": "Value of the tracking URL parameter used instead of UTM values. Cannot be changed later.",
+ "Optional level when the activity is part of a campaign tree (CAMPAIGN, AD_GROUP or AD). Cannot be changed later.": "Optional level when the activity is part of a campaign tree (CAMPAIGN, AD_GROUP or AD). Cannot be changed later.",
+ "Remote id of the parent activity in the campaign tree. Cannot be changed later.": "Remote id of the parent activity in the campaign tree. Cannot be changed later.",
+ "Handle of the sales channel the activity belongs to, if your partner manager gave you one. Cannot be changed later.": "Handle of the sales channel the activity belongs to, if your partner manager gave you one. Cannot be changed later.",
+ "Domain visitors arrive from, for example \"facebook.com\".": "Domain visitors arrive from, for example \"facebook.com\".",
+ "Public URL of a preview image of the ad or email.": "Public URL of a preview image of the ad or email.",
+ "DAILY or LIFETIME. Set together with the budget amount.": "DAILY or LIFETIME. Set together with the budget amount.",
+ "Budget total, for example 500 for 500.00, in the currency below.": "Budget total, for example 500 for 500.00, in the currency below.",
+ "Amount spent so far, in the currency below.": "Amount spent so far, in the currency below.",
+ "Planned start time, ISO 8601.": "Planned start time, ISO 8601.",
+ "Planned end time, ISO 8601.": "Planned end time, ISO 8601.",
"Unique handle of the entry within its type, for example \"ada-lovelace\". Reusing an existing handle updates that entry.": "Unique handle of the entry within its type, for example \"ada-lovelace\". Reusing an existing handle updates that entry.",
"Field values to write; fields you leave out keep their current values.": "Field values to write; fields you leave out keep their current values.",
"DRAFT hides the entry from the storefront, ACTIVE shows it. Only for publishable types; leave empty to keep the current status.": "DRAFT hides the entry from the storefront, ACTIVE shows it. Only for publishable types; leave empty to keep the current status.",
@@ -1434,6 +1758,75 @@
"Archived": "Archived",
"Draft order": "Draft order",
"Blog article": "Blog article",
+ "product_launch": "product_launch",
+ "product_discontinuation": "product_discontinuation",
+ "collection_launch": "collection_launch",
+ "bundle_launch": "bundle_launch",
+ "preorder_launch": "preorder_launch",
+ "in_person_event": "in_person_event",
+ "campaign": "campaign",
+ "brand_change": "brand_change",
+ "influencer_collaboration": "influencer_collaboration",
+ "brand_collaboration": "brand_collaboration",
+ "channel_launch": "channel_launch",
+ "ad_spend_change": "ad_spend_change",
+ "media_mention": "media_mention",
+ "attribution_change": "attribution_change",
+ "checkout_offer": "checkout_offer",
+ "amount_off_products_discount": "amount_off_products_discount",
+ "free_shipping_discount": "free_shipping_discount",
+ "buy_x_get_y_discount": "buy_x_get_y_discount",
+ "amount_off_order_discount": "amount_off_order_discount",
+ "seasonal_promotion": "seasonal_promotion",
+ "shipping_promotion": "shipping_promotion",
+ "loyalty_program_offer": "loyalty_program_offer",
+ "reward_program_offer": "reward_program_offer",
+ "subscription_program_offer": "subscription_program_offer",
+ "shop_cash_offer": "shop_cash_offer",
+ "pricing_experiment": "pricing_experiment",
+ "supplier_change": "supplier_change",
+ "warehouse_change": "warehouse_change",
+ "fulfillment_service_change": "fulfillment_service_change",
+ "landing_page_launch": "landing_page_launch",
+ "store_redesign": "store_redesign",
+ "payment_method_change": "payment_method_change",
+ "retail_store_change": "retail_store_change",
+ "popup_store": "popup_store",
+ "revenue_milestone": "revenue_milestone",
+ "order_milestone": "order_milestone",
+ "customer_milestone": "customer_milestone",
+ "capital_funding": "capital_funding",
+ "expansion_milestone": "expansion_milestone",
+ "award_recognition": "award_recognition",
+ "anniversary": "anniversary",
+ "market_change": "market_change",
+ "tax_change": "tax_change",
+ "loyalty_program_change": "loyalty_program_change",
+ "reward_program_change": "reward_program_change",
+ "subscription_program_change": "subscription_program_change",
+ "retention_program_change": "retention_program_change",
+ "return_program_change": "return_program_change",
+ "external_event": "external_event",
+ "team_change": "team_change",
+ "other": "other",
+ "START_DATE": "START_DATE",
+ "END_DATE": "END_DATE",
+ "NAME": "NAME",
+ "METRIC": "METRIC",
+ "EXPECTED_VALUE": "EXPECTED_VALUE",
+ "CREATED_AT": "CREATED_AT",
+ "ID": "ID",
+ "Yes": "Yes",
+ "No": "No",
+ "REGION": "REGION",
+ "LOCATION": "LOCATION",
+ "COMPANY_LOCATION": "COMPANY_LOCATION",
+ "CHANNEL": "CHANNEL",
+ "NONE": "NONE",
+ "UPDATED_AT": "UPDATED_AT",
+ "STATUS": "STATUS",
+ "MARKET_TYPE": "MARKET_TYPE",
+ "MARKET_CONDITION_TYPES": "MARKET_CONDITION_TYPES",
"Subscription contract": "Subscription contract",
"Available": "Available",
"Damaged": "Damaged",
@@ -1457,8 +1850,10 @@
"Other": "Other",
"Only the listed entry ids": "Only the listed entry ids",
"Every entry of the type": "Every entry of the type",
- "Yes": "Yes",
- "No": "No",
+ "Market": "Market",
+ "Company location (B2B)": "Company location (B2B)",
+ "App": "App",
+ "None": "None",
"Percentage": "Percentage",
"Fixed amount": "Fixed amount",
"All items": "All items",
@@ -1505,7 +1900,6 @@
"High": "High",
"Medium": "Medium",
"Low": "Low",
- "None": "None",
"Pending": "Pending",
"Authorized": "Authorized",
"Paid": "Paid",
@@ -1539,8 +1933,6 @@
"ORDER": "ORDER",
"DRAFTORDER": "DRAFTORDER",
"COMPANY": "COMPANY",
- "COMPANY_LOCATION": "COMPANY_LOCATION",
- "LOCATION": "LOCATION",
"MARKET": "MARKET",
"PAGE": "PAGE",
"BLOG": "BLOG",
@@ -1560,30 +1952,48 @@
"Customer name": "Customer name",
"Total price": "Total price",
"Relevance (with a query)": "Relevance (with a query)",
- "ID": "ID",
"Alphabetical": "Alphabetical",
"Most used first": "Most used first",
"Published at": "Published at",
"Updated at": "Updated at",
"Author": "Author",
"Blog title": "Blog title",
- "Collection default": "Collection default",
"Created": "Created",
+ "Running": "Running",
+ "Completed": "Completed",
+ "Failed": "Failed",
+ "Canceling": "Canceling",
+ "Canceled": "Canceled",
+ "Query": "Query",
+ "Completed at": "Completed at",
+ "Collection default": "Collection default",
"Processed at": "Processed at",
"Order number": "Order number",
"Starts at": "Starts at",
"Ends at": "Ends at",
"Number": "Number",
"Happened at": "Happened at",
+ "Start time": "Start time",
"Any": "Any",
"Pinned": "Pinned",
"Unpinned": "Unpinned",
"Pinned position": "Pinned position",
"Display name": "Display name",
+ "Due on receipt": "Due on receipt",
+ "Net (within a number of days)": "Net (within a number of days)",
+ "Fixed date": "Fixed date",
+ "Due on fulfillment": "Due on fulfillment",
"Inventory quantity": "Inventory quantity",
"App (sales channel)": "App (sales channel)",
- "Market": "Market",
- "Company location (B2B)": "Company location (B2B)",
+ "Orders (read_orders)": "Orders (read_orders)",
+ "Draft orders (read_draft_orders)": "Draft orders (read_draft_orders)",
+ "Products (read_products)": "Products (read_products)",
+ "Collections (read_products)": "Collections (read_products)",
+ "Files (read_files or read_themes)": "Files (read_files or read_themes)",
+ "URL redirects (read_online_store_navigation)": "URL redirects (read_online_store_navigation)",
+ "Code discounts": "Code discounts",
+ "Automatic discounts": "Automatic discounts",
+ "Discount redeem codes (read_discounts)": "Discount redeem codes (read_discounts)",
"Live theme (MAIN)": "Live theme (MAIN)",
"Demo": "Demo",
"Locked": "Locked",
@@ -1608,13 +2018,40 @@
"Refund to the original payment methods": "Refund to the original payment methods",
"Refund as store credit": "Refund as store credit",
"None (remove the minimum)": "None (remove the minimum)",
+ "ACTIVE": "ACTIVE",
+ "INACTIVE": "INACTIVE",
+ "PAUSED": "PAUSED",
+ "SCHEDULED": "SCHEDULED",
+ "DELETED_EXTERNALLY": "DELETED_EXTERNALLY",
+ "UNDEFINED": "UNDEFINED",
+ "ABANDONED_CART": "ABANDONED_CART",
+ "AD": "AD",
+ "AFFILIATE": "AFFILIATE",
+ "LINK": "LINK",
+ "LOYALTY": "LOYALTY",
+ "MESSAGE": "MESSAGE",
+ "NEWSLETTER": "NEWSLETTER",
+ "NOTIFICATION": "NOTIFICATION",
+ "POST": "POST",
+ "RETARGETING": "RETARGETING",
+ "TRANSACTIONAL": "TRANSACTIONAL",
+ "STOREFRONT_APP": "STOREFRONT_APP",
+ "SEO": "SEO",
+ "SEARCH": "SEARCH",
+ "DISPLAY": "DISPLAY",
+ "SOCIAL": "SOCIAL",
+ "EMAIL": "EMAIL",
+ "REFERRAL": "REFERRAL",
+ "DAILY": "DAILY",
+ "LIFETIME": "LIFETIME",
"Kilograms": "Kilograms",
"Grams": "Grams",
"Pounds": "Pounds",
"Ounces": "Ounces",
"Manage variants (create and delete as needed)": "Manage variants (create and delete as needed)",
+ "CAMPAIGN": "CAMPAIGN",
+ "AD_GROUP": "AD_GROUP",
"GET": "GET",
- "POST": "POST",
"PATCH": "PATCH",
"PUT": "PUT",
"DELETE": "DELETE",
diff --git a/packages/pieces/community/shopify/src/index.ts b/packages/pieces/community/shopify/src/index.ts
index 7b4fa10f464..1d9d6537d98 100644
--- a/packages/pieces/community/shopify/src/index.ts
+++ b/packages/pieces/community/shopify/src/index.ts
@@ -33,6 +33,18 @@ import { shopifyAiAddProductMedia } from './lib/actions/ai/add-product-media';
import { shopifyAiAddProductsToCollection } from './lib/actions/ai/add-products-to-collection';
import { shopifyAiAddTags } from './lib/actions/ai/add-tags';
import { shopifyAiListDeliveryZones } from './lib/actions/ai/list-delivery-zones';
+import { shopifyAiDeleteAnalyticsAnnotation } from './lib/actions/ai/delete-analytics-annotation';
+import { shopifyAiUpdateAnalyticsAnnotation } from './lib/actions/ai/update-analytics-annotation';
+import { shopifyAiCreateAnalyticsAnnotation } from './lib/actions/ai/create-analytics-annotation';
+import { shopifyAiDeleteAnalyticsTargets } from './lib/actions/ai/delete-analytics-targets';
+import { shopifyAiUpdateAnalyticsTarget } from './lib/actions/ai/update-analytics-target';
+import { shopifyAiCreateAnalyticsTarget } from './lib/actions/ai/create-analytics-target';
+import { shopifyAiListAnalyticsTargets } from './lib/actions/ai/list-analytics-targets';
+import { shopifyAiGetReturnPolicyProfile } from './lib/actions/ai/get-return-policy-profile';
+import { shopifyAiListReturnPolicyProfiles } from './lib/actions/ai/list-return-policy-profiles';
+import { shopifyAiListMarketRelationships } from './lib/actions/ai/list-market-relationships';
+import { shopifyAiGetMarket } from './lib/actions/ai/get-market';
+import { shopifyAiListMarkets } from './lib/actions/ai/list-markets';
import { shopifyAiSendPaymentMethodUpdateEmail } from './lib/actions/ai/send-payment-method-update-email';
import { shopifyAiResolveRequestedOrderEdit } from './lib/actions/ai/resolve-requested-order-edit';
import { shopifyAiDeclineRequestedOrderEdit } from './lib/actions/ai/decline-requested-order-edit';
@@ -45,18 +57,21 @@ import { shopifyAiArchiveOrder } from './lib/actions/ai/archive-order';
import { shopifyAiAttachVariantMedia } from './lib/actions/ai/attach-variant-media';
import { shopifyAiBulkDeleteMetaobjects } from './lib/actions/ai/bulk-delete-metaobjects';
import { shopifyAiCalculateRefund } from './lib/actions/ai/calculate-refund';
+import { shopifyAiCancelBulkOperation } from './lib/actions/ai/cancel-bulk-operation';
import { shopifyAiCancelFulfillmentOrder } from './lib/actions/ai/cancel-fulfillment-order';
import { shopifyAiCancelFulfillment } from './lib/actions/ai/cancel-fulfillment';
import { shopifyAiCaptureOrderPayment } from './lib/actions/ai/capture-order-payment';
import { shopifyAiCompleteDraftOrder } from './lib/actions/ai/complete-draft-order';
import { shopifyAiCountAbandonedCheckouts } from './lib/actions/ai/count-abandoned-checkouts';
import { shopifyAiCountBlogs } from './lib/actions/ai/count-blogs';
+import { shopifyAiCountCatalogs } from './lib/actions/ai/count-catalogs';
import { shopifyAiCountCollections } from './lib/actions/ai/count-collections';
import { shopifyAiCountCustomerSegments } from './lib/actions/ai/count-customer-segments';
import { shopifyAiCountCustomers } from './lib/actions/ai/count-customers';
import { shopifyAiCountDiscountCodes } from './lib/actions/ai/count-discount-codes';
import { shopifyAiCountDiscounts } from './lib/actions/ai/count-discounts';
import { shopifyAiCountDraftOrders } from './lib/actions/ai/count-draft-orders';
+import { shopifyAiCountEvents } from './lib/actions/ai/count-events';
import { shopifyAiCountGiftCards } from './lib/actions/ai/count-gift-cards';
import { shopifyAiCountLocations } from './lib/actions/ai/count-locations';
import { shopifyAiCountPages } from './lib/actions/ai/count-pages';
@@ -74,6 +89,7 @@ import { shopifyAiCreateFreeShippingDiscountCode } from './lib/actions/ai/create
import { shopifyAiCreateFulfillmentTrackingEvent } from './lib/actions/ai/create-fulfillment-tracking-event';
import { shopifyAiCreateFulfillment } from './lib/actions/ai/create-fulfillment';
import { shopifyAiCreateGiftCard } from './lib/actions/ai/create-gift-card';
+import { shopifyAiCreateMarketingEngagement } from './lib/actions/ai/create-marketing-engagement';
import { shopifyAiCreateOrderRiskAssessment } from './lib/actions/ai/create-order-risk-assessment';
import { shopifyAiCreateOrderWithLineItems } from './lib/actions/ai/create-order-with-line-items';
import { shopifyAiCreatePage } from './lib/actions/ai/create-page';
@@ -81,6 +97,7 @@ import { shopifyAiCreateProductOptions } from './lib/actions/ai/create-product-o
import { shopifyAiCreateProductRecord } from './lib/actions/ai/create-product-record';
import { shopifyAiCreateProductVariants } from './lib/actions/ai/create-product-variants';
import { shopifyAiCreateRefund } from './lib/actions/ai/create-refund';
+import { shopifyAiCreateScriptTag } from './lib/actions/ai/create-script-tag';
import { shopifyAiCreateSmartCollection } from './lib/actions/ai/create-smart-collection';
import { shopifyAiCreateTheme } from './lib/actions/ai/create-theme';
import { shopifyAiCreateUrlRedirect } from './lib/actions/ai/create-url-redirect';
@@ -95,6 +112,7 @@ import { shopifyAiDeleteCustomer } from './lib/actions/ai/delete-customer';
import { shopifyAiDeleteDiscountRedeemCodes } from './lib/actions/ai/delete-discount-redeem-codes';
import { shopifyAiDeleteDiscount } from './lib/actions/ai/delete-discount';
import { shopifyAiDeleteDraftOrder } from './lib/actions/ai/delete-draft-order';
+import { shopifyAiDeleteExternalMarketingActivity } from './lib/actions/ai/delete-external-marketing-activity';
import { shopifyAiDeleteFulfillmentService } from './lib/actions/ai/delete-fulfillment-service';
import { shopifyAiDeleteMetafields } from './lib/actions/ai/delete-metafields';
import { shopifyAiDeleteMetaobjectDefinition } from './lib/actions/ai/delete-metaobject-definition';
@@ -105,9 +123,12 @@ import { shopifyAiDeleteProductMedia } from './lib/actions/ai/delete-product-med
import { shopifyAiDeleteProductOptions } from './lib/actions/ai/delete-product-options';
import { shopifyAiDeleteProductVariants } from './lib/actions/ai/delete-product-variants';
import { shopifyAiDeleteProduct } from './lib/actions/ai/delete-product';
+import { shopifyAiDeleteSavedSearch } from './lib/actions/ai/delete-saved-search';
+import { shopifyAiDeleteScriptTag } from './lib/actions/ai/delete-script-tag';
import { shopifyAiDeleteThemeFiles } from './lib/actions/ai/delete-theme-files';
import { shopifyAiDeleteTheme } from './lib/actions/ai/delete-theme';
import { shopifyAiDeleteUrlRedirect } from './lib/actions/ai/delete-url-redirect';
+import { shopifyAiDeleteWebPresence } from './lib/actions/ai/delete-web-presence';
import { shopifyAiDetachVariantMedia } from './lib/actions/ai/detach-variant-media';
import { shopifyAiDuplicateProduct } from './lib/actions/ai/duplicate-product';
import { shopifyAiEnableStandardMetaobjectDefinition } from './lib/actions/ai/enable-standard-metaobject-definition';
@@ -116,13 +137,17 @@ import { shopifyAiGenerateCustomerActivationUrl } from './lib/actions/ai/generat
import { shopifyAiGetAbandonment } from './lib/actions/ai/get-abandonment';
import { shopifyAiGetArticle } from './lib/actions/ai/get-article';
import { shopifyAiGetBlog } from './lib/actions/ai/get-blog';
+import { shopifyAiGetBulkOperation } from './lib/actions/ai/get-bulk-operation';
+import { shopifyAiGetBusinessEntity } from './lib/actions/ai/get-business-entity';
import { shopifyAiGetCheckoutAbandonment } from './lib/actions/ai/get-checkout-abandonment';
import { shopifyAiGetCollectionByHandle } from './lib/actions/ai/get-collection-by-handle';
import { shopifyAiGetCollection } from './lib/actions/ai/get-collection';
import { shopifyAiGetCustomerProfile } from './lib/actions/ai/get-customer-profile';
import { shopifyAiGetDiscountRedeemCodeBulkCreation } from './lib/actions/ai/get-discount-redeem-code-bulk-creation';
import { shopifyAiGetDiscount } from './lib/actions/ai/get-discount';
+import { shopifyAiGetDomain } from './lib/actions/ai/get-domain';
import { shopifyAiGetDraftOrder } from './lib/actions/ai/get-draft-order';
+import { shopifyAiGetEvent } from './lib/actions/ai/get-event';
import { shopifyAiGetFulfillmentDetails } from './lib/actions/ai/get-fulfillment-details';
import { shopifyAiGetFulfillmentOrder } from './lib/actions/ai/get-fulfillment-order';
import { shopifyAiGetGiftCard } from './lib/actions/ai/get-gift-card';
@@ -130,6 +155,7 @@ import { shopifyAiGetGrantedAccessScopes } from './lib/actions/ai/get-granted-ac
import { shopifyAiGetInventoryItem } from './lib/actions/ai/get-inventory-item';
import { shopifyAiGetJob } from './lib/actions/ai/get-job';
import { shopifyAiGetLocation } from './lib/actions/ai/get-location';
+import { shopifyAiGetMarketingEvent } from './lib/actions/ai/get-marketing-event';
import { shopifyAiGetMetafieldDefinition } from './lib/actions/ai/get-metafield-definition';
import { shopifyAiGetMetafield } from './lib/actions/ai/get-metafield';
import { shopifyAiGetMetaobject } from './lib/actions/ai/get-metaobject';
@@ -144,6 +170,8 @@ import { shopifyAiGetProductMedia } from './lib/actions/ai/get-product-media';
import { shopifyAiGetProductVariantDetails } from './lib/actions/ai/get-product-variant-details';
import { shopifyAiGetPublication } from './lib/actions/ai/get-publication';
import { shopifyAiGetRefund } from './lib/actions/ai/get-refund';
+import { shopifyAiGetScriptTag } from './lib/actions/ai/get-script-tag';
+import { shopifyAiGetShopBillingPreferences } from './lib/actions/ai/get-shop-billing-preferences';
import { shopifyAiGetShop } from './lib/actions/ai/get-shop';
import { shopifyAiGetThemeFile } from './lib/actions/ai/get-theme-file';
import { shopifyAiGetTheme } from './lib/actions/ai/get-theme';
@@ -153,22 +181,32 @@ import { shopifyAiListAbandonedCheckouts } from './lib/actions/ai/list-abandoned
import { shopifyAiListArticleAuthors } from './lib/actions/ai/list-article-authors';
import { shopifyAiListArticleTags } from './lib/actions/ai/list-article-tags';
import { shopifyAiListArticles } from './lib/actions/ai/list-articles';
+import { shopifyAiListAvailableLocales } from './lib/actions/ai/list-available-locales';
import { shopifyAiListBlogs } from './lib/actions/ai/list-blogs';
+import { shopifyAiListBulkOperations } from './lib/actions/ai/list-bulk-operations';
+import { shopifyAiListBusinessEntities } from './lib/actions/ai/list-business-entities';
import { shopifyAiListCarrierServices } from './lib/actions/ai/list-carrier-services';
+import { shopifyAiListCatalogs } from './lib/actions/ai/list-catalogs';
import { shopifyAiListCollectionProducts } from './lib/actions/ai/list-collection-products';
import { shopifyAiListComments } from './lib/actions/ai/list-comments';
+import { shopifyAiListConsentPolicies } from './lib/actions/ai/list-consent-policies';
+import { shopifyAiListConsentPolicyRegions } from './lib/actions/ai/list-consent-policy-regions';
+import { shopifyAiListCustomerAccountPages } from './lib/actions/ai/list-customer-account-pages';
import { shopifyAiListCustomerAddresses } from './lib/actions/ai/list-customer-addresses';
import { shopifyAiListCustomerOrders } from './lib/actions/ai/list-customer-orders';
import { shopifyAiListDeliveryProfiles } from './lib/actions/ai/list-delivery-profiles';
import { shopifyAiListDiscountRedeemCodes } from './lib/actions/ai/list-discount-redeem-codes';
import { shopifyAiListDiscounts } from './lib/actions/ai/list-discounts';
import { shopifyAiListDraftOrders } from './lib/actions/ai/list-draft-orders';
+import { shopifyAiListEnabledCurrencies } from './lib/actions/ai/list-enabled-currencies';
+import { shopifyAiListEvents } from './lib/actions/ai/list-events';
import { shopifyAiListFulfillmentEvents } from './lib/actions/ai/list-fulfillment-events';
import { shopifyAiListFulfillmentOrderMoveLocations } from './lib/actions/ai/list-fulfillment-order-move-locations';
import { shopifyAiListFulfillmentServices } from './lib/actions/ai/list-fulfillment-services';
import { shopifyAiListInventoryItems } from './lib/actions/ai/list-inventory-items';
import { shopifyAiListInventoryLevels } from './lib/actions/ai/list-inventory-levels';
import { shopifyAiListLocations } from './lib/actions/ai/list-locations';
+import { shopifyAiListMarketingEvents } from './lib/actions/ai/list-marketing-events';
import { shopifyAiListMetafieldDefinitionTypes } from './lib/actions/ai/list-metafield-definition-types';
import { shopifyAiListMetafieldDefinitions } from './lib/actions/ai/list-metafield-definitions';
import { shopifyAiListMetafields } from './lib/actions/ai/list-metafields';
@@ -179,15 +217,22 @@ import { shopifyAiListOrderFulfillments } from './lib/actions/ai/list-order-fulf
import { shopifyAiListOrderRefunds } from './lib/actions/ai/list-order-refunds';
import { shopifyAiListOrderTransactions } from './lib/actions/ai/list-order-transactions';
import { shopifyAiListPages } from './lib/actions/ai/list-pages';
+import { shopifyAiListPaymentDisputes } from './lib/actions/ai/list-payment-disputes';
+import { shopifyAiListPaymentTermsTemplates } from './lib/actions/ai/list-payment-terms-templates';
import { shopifyAiListProductMedia } from './lib/actions/ai/list-product-media';
import { shopifyAiListProductVariants } from './lib/actions/ai/list-product-variants';
import { shopifyAiListPublications } from './lib/actions/ai/list-publications';
import { shopifyAiListSalesChannels } from './lib/actions/ai/list-sales-channels';
+import { shopifyAiListSavedSearches } from './lib/actions/ai/list-saved-searches';
+import { shopifyAiListScriptTags } from './lib/actions/ai/list-script-tags';
+import { shopifyAiListShopPayPaymentRequestReceipts } from './lib/actions/ai/list-shop-pay-payment-request-receipts';
+import { shopifyAiListShopPolicies } from './lib/actions/ai/list-shop-policies';
import { shopifyAiListStandardMetafieldDefinitionTemplates } from './lib/actions/ai/list-standard-metafield-definition-templates';
import { shopifyAiListTenderTransactions } from './lib/actions/ai/list-tender-transactions';
import { shopifyAiListThemeFiles } from './lib/actions/ai/list-theme-files';
import { shopifyAiListThemes } from './lib/actions/ai/list-themes';
import { shopifyAiListUrlRedirects } from './lib/actions/ai/list-url-redirects';
+import { shopifyAiListWebPresences } from './lib/actions/ai/list-web-presences';
import { shopifyAiMarkCommentNotSpam } from './lib/actions/ai/mark-comment-not-spam';
import { shopifyAiMarkCommentSpam } from './lib/actions/ai/mark-comment-spam';
import { shopifyAiMarkOrderAsPaid } from './lib/actions/ai/mark-order-as-paid';
@@ -215,6 +260,8 @@ import { shopifyAiSetFulfillmentOrdersDeadline } from './lib/actions/ai/set-fulf
import { shopifyAiSetInventoryQuantities } from './lib/actions/ai/set-inventory-quantities';
import { shopifyAiSetMetafields } from './lib/actions/ai/set-metafields';
import { shopifyAiSetProduct } from './lib/actions/ai/set-product';
+import { shopifyAiStartBulkMutation } from './lib/actions/ai/start-bulk-mutation';
+import { shopifyAiStartBulkQuery } from './lib/actions/ai/start-bulk-query';
import { shopifyAiStartOrderCancellation } from './lib/actions/ai/start-order-cancellation';
import { shopifyAiUnarchiveOrder } from './lib/actions/ai/unarchive-order';
import { shopifyAiUnpublishResource } from './lib/actions/ai/unpublish-resource';
@@ -225,6 +272,7 @@ import { shopifyAiUpdateCollection } from './lib/actions/ai/update-collection';
import { shopifyAiUpdateCustomerAddress } from './lib/actions/ai/update-customer-address';
import { shopifyAiUpdateCustomerProfile } from './lib/actions/ai/update-customer-profile';
import { shopifyAiUpdateDraftOrder } from './lib/actions/ai/update-draft-order';
+import { shopifyAiUpdateExternalMarketingActivity } from './lib/actions/ai/update-external-marketing-activity';
import { shopifyAiUpdateFreeShippingDiscountCode } from './lib/actions/ai/update-free-shipping-discount-code';
import { shopifyAiUpdateFulfillmentTracking } from './lib/actions/ai/update-fulfillment-tracking';
import { shopifyAiUpdateGiftCard } from './lib/actions/ai/update-gift-card';
@@ -236,8 +284,10 @@ import { shopifyAiUpdateProductFields } from './lib/actions/ai/update-product-fi
import { shopifyAiUpdateProductMedia } from './lib/actions/ai/update-product-media';
import { shopifyAiUpdateProductOption } from './lib/actions/ai/update-product-option';
import { shopifyAiUpdateProductVariants } from './lib/actions/ai/update-product-variants';
+import { shopifyAiUpdateScriptTag } from './lib/actions/ai/update-script-tag';
import { shopifyAiUpdateTheme } from './lib/actions/ai/update-theme';
import { shopifyAiUpdateUrlRedirect } from './lib/actions/ai/update-url-redirect';
+import { shopifyAiUpsertExternalMarketingActivity } from './lib/actions/ai/upsert-external-marketing-activity';
import { shopifyAiUpsertMetaobject } from './lib/actions/ai/upsert-metaobject';
import { shopifyAiUpsertThemeFiles } from './lib/actions/ai/upsert-theme-files';
import { shopifyAiVoidOrderTransaction } from './lib/actions/ai/void-order-transaction';
@@ -291,6 +341,18 @@ export const shopify = createPiece({
shopifyAiAddProductsToCollection,
shopifyAiAddTags,
shopifyAiListDeliveryZones,
+ shopifyAiDeleteAnalyticsAnnotation,
+ shopifyAiUpdateAnalyticsAnnotation,
+ shopifyAiCreateAnalyticsAnnotation,
+ shopifyAiDeleteAnalyticsTargets,
+ shopifyAiUpdateAnalyticsTarget,
+ shopifyAiCreateAnalyticsTarget,
+ shopifyAiListAnalyticsTargets,
+ shopifyAiGetReturnPolicyProfile,
+ shopifyAiListReturnPolicyProfiles,
+ shopifyAiListMarketRelationships,
+ shopifyAiGetMarket,
+ shopifyAiListMarkets,
shopifyAiSendPaymentMethodUpdateEmail,
shopifyAiResolveRequestedOrderEdit,
shopifyAiDeclineRequestedOrderEdit,
@@ -303,18 +365,21 @@ export const shopify = createPiece({
shopifyAiAttachVariantMedia,
shopifyAiBulkDeleteMetaobjects,
shopifyAiCalculateRefund,
+ shopifyAiCancelBulkOperation,
shopifyAiCancelFulfillmentOrder,
shopifyAiCancelFulfillment,
shopifyAiCaptureOrderPayment,
shopifyAiCompleteDraftOrder,
shopifyAiCountAbandonedCheckouts,
shopifyAiCountBlogs,
+ shopifyAiCountCatalogs,
shopifyAiCountCollections,
shopifyAiCountCustomerSegments,
shopifyAiCountCustomers,
shopifyAiCountDiscountCodes,
shopifyAiCountDiscounts,
shopifyAiCountDraftOrders,
+ shopifyAiCountEvents,
shopifyAiCountGiftCards,
shopifyAiCountLocations,
shopifyAiCountPages,
@@ -332,6 +397,7 @@ export const shopify = createPiece({
shopifyAiCreateFulfillmentTrackingEvent,
shopifyAiCreateFulfillment,
shopifyAiCreateGiftCard,
+ shopifyAiCreateMarketingEngagement,
shopifyAiCreateOrderRiskAssessment,
shopifyAiCreateOrderWithLineItems,
shopifyAiCreatePage,
@@ -339,6 +405,7 @@ export const shopify = createPiece({
shopifyAiCreateProductRecord,
shopifyAiCreateProductVariants,
shopifyAiCreateRefund,
+ shopifyAiCreateScriptTag,
shopifyAiCreateSmartCollection,
shopifyAiCreateTheme,
shopifyAiCreateUrlRedirect,
@@ -353,6 +420,7 @@ export const shopify = createPiece({
shopifyAiDeleteDiscountRedeemCodes,
shopifyAiDeleteDiscount,
shopifyAiDeleteDraftOrder,
+ shopifyAiDeleteExternalMarketingActivity,
shopifyAiDeleteFulfillmentService,
shopifyAiDeleteMetafields,
shopifyAiDeleteMetaobjectDefinition,
@@ -363,9 +431,12 @@ export const shopify = createPiece({
shopifyAiDeleteProductOptions,
shopifyAiDeleteProductVariants,
shopifyAiDeleteProduct,
+ shopifyAiDeleteSavedSearch,
+ shopifyAiDeleteScriptTag,
shopifyAiDeleteThemeFiles,
shopifyAiDeleteTheme,
shopifyAiDeleteUrlRedirect,
+ shopifyAiDeleteWebPresence,
shopifyAiDetachVariantMedia,
shopifyAiDuplicateProduct,
shopifyAiEnableStandardMetaobjectDefinition,
@@ -374,13 +445,17 @@ export const shopify = createPiece({
shopifyAiGetAbandonment,
shopifyAiGetArticle,
shopifyAiGetBlog,
+ shopifyAiGetBulkOperation,
+ shopifyAiGetBusinessEntity,
shopifyAiGetCheckoutAbandonment,
shopifyAiGetCollectionByHandle,
shopifyAiGetCollection,
shopifyAiGetCustomerProfile,
shopifyAiGetDiscountRedeemCodeBulkCreation,
shopifyAiGetDiscount,
+ shopifyAiGetDomain,
shopifyAiGetDraftOrder,
+ shopifyAiGetEvent,
shopifyAiGetFulfillmentDetails,
shopifyAiGetFulfillmentOrder,
shopifyAiGetGiftCard,
@@ -388,6 +463,7 @@ export const shopify = createPiece({
shopifyAiGetInventoryItem,
shopifyAiGetJob,
shopifyAiGetLocation,
+ shopifyAiGetMarketingEvent,
shopifyAiGetMetafieldDefinition,
shopifyAiGetMetafield,
shopifyAiGetMetaobject,
@@ -402,6 +478,8 @@ export const shopify = createPiece({
shopifyAiGetProductVariantDetails,
shopifyAiGetPublication,
shopifyAiGetRefund,
+ shopifyAiGetScriptTag,
+ shopifyAiGetShopBillingPreferences,
shopifyAiGetShop,
shopifyAiGetThemeFile,
shopifyAiGetTheme,
@@ -411,22 +489,32 @@ export const shopify = createPiece({
shopifyAiListArticleAuthors,
shopifyAiListArticleTags,
shopifyAiListArticles,
+ shopifyAiListAvailableLocales,
shopifyAiListBlogs,
+ shopifyAiListBulkOperations,
+ shopifyAiListBusinessEntities,
shopifyAiListCarrierServices,
+ shopifyAiListCatalogs,
shopifyAiListCollectionProducts,
shopifyAiListComments,
+ shopifyAiListConsentPolicies,
+ shopifyAiListConsentPolicyRegions,
+ shopifyAiListCustomerAccountPages,
shopifyAiListCustomerAddresses,
shopifyAiListCustomerOrders,
shopifyAiListDeliveryProfiles,
shopifyAiListDiscountRedeemCodes,
shopifyAiListDiscounts,
shopifyAiListDraftOrders,
+ shopifyAiListEnabledCurrencies,
+ shopifyAiListEvents,
shopifyAiListFulfillmentEvents,
shopifyAiListFulfillmentOrderMoveLocations,
shopifyAiListFulfillmentServices,
shopifyAiListInventoryItems,
shopifyAiListInventoryLevels,
shopifyAiListLocations,
+ shopifyAiListMarketingEvents,
shopifyAiListMetafieldDefinitionTypes,
shopifyAiListMetafieldDefinitions,
shopifyAiListMetafields,
@@ -437,15 +525,22 @@ export const shopify = createPiece({
shopifyAiListOrderRefunds,
shopifyAiListOrderTransactions,
shopifyAiListPages,
+ shopifyAiListPaymentDisputes,
+ shopifyAiListPaymentTermsTemplates,
shopifyAiListProductMedia,
shopifyAiListProductVariants,
shopifyAiListPublications,
shopifyAiListSalesChannels,
+ shopifyAiListSavedSearches,
+ shopifyAiListScriptTags,
+ shopifyAiListShopPayPaymentRequestReceipts,
+ shopifyAiListShopPolicies,
shopifyAiListStandardMetafieldDefinitionTemplates,
shopifyAiListTenderTransactions,
shopifyAiListThemeFiles,
shopifyAiListThemes,
shopifyAiListUrlRedirects,
+ shopifyAiListWebPresences,
shopifyAiMarkCommentNotSpam,
shopifyAiMarkCommentSpam,
shopifyAiMarkOrderAsPaid,
@@ -473,6 +568,8 @@ export const shopify = createPiece({
shopifyAiSetInventoryQuantities,
shopifyAiSetMetafields,
shopifyAiSetProduct,
+ shopifyAiStartBulkMutation,
+ shopifyAiStartBulkQuery,
shopifyAiStartOrderCancellation,
shopifyAiUnarchiveOrder,
shopifyAiUnpublishResource,
@@ -483,6 +580,7 @@ export const shopify = createPiece({
shopifyAiUpdateCustomerAddress,
shopifyAiUpdateCustomerProfile,
shopifyAiUpdateDraftOrder,
+ shopifyAiUpdateExternalMarketingActivity,
shopifyAiUpdateFreeShippingDiscountCode,
shopifyAiUpdateFulfillmentTracking,
shopifyAiUpdateGiftCard,
@@ -494,8 +592,10 @@ export const shopify = createPiece({
shopifyAiUpdateProductMedia,
shopifyAiUpdateProductOption,
shopifyAiUpdateProductVariants,
+ shopifyAiUpdateScriptTag,
shopifyAiUpdateTheme,
shopifyAiUpdateUrlRedirect,
+ shopifyAiUpsertExternalMarketingActivity,
shopifyAiUpsertMetaobject,
shopifyAiUpsertThemeFiles,
shopifyAiVoidOrderTransaction,
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/cancel-bulk-operation.ts b/packages/pieces/community/shopify/src/lib/actions/ai/cancel-bulk-operation.ts
new file mode 100644
index 00000000000..e47c02cb872
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/cancel-bulk-operation.ts
@@ -0,0 +1,54 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import {
+ GqlBulkOperation,
+ shopifyFields,
+ shopifyGraphqlClient,
+ shopifyMappers,
+ shopifyValues,
+} from '../../common/graphql';
+import { bulkOperationOutputSchema } from '../../output-schemas/store';
+
+export const shopifyAiCancelBulkOperation = createAction({
+ auth: shopifyAuth,
+ name: 'cancel_bulk_operation',
+ classification: 'DESTRUCTIVE',
+ displayName: 'Cancel Bulk Operation',
+ description: 'Stop a running bulk query or bulk mutation.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Starts cancelling a running bulk operation and returns it, usually with status CANCELING; it becomes CANCELED shortly after (check with get_bulk_operation). A cancelled bulk query produces no complete result file (partial_data_url may hold what was read), and a cancelled bulk mutation keeps every line it already applied; nothing is rolled back. It cannot be resumed; start a new operation instead. Cancelling an operation that already finished fails with "A bulk operation cannot be canceled when it is completed". Frees a slot when the per-shop limit of running bulk operations is reached.',
+ idempotent: false,
+ },
+ props: {
+ bulk_operation_id: Property.ShortText({
+ displayName: 'Bulk Operation ID',
+ description: 'The bulk operation id, numeric or "gid://shopify/BulkOperation/…". Find running ones with list_bulk_operations.',
+ required: true,
+ }),
+ },
+ outputSchema: bulkOperationOutputSchema,
+ async run({ auth, propsValue }) {
+ const rawId = shopifyValues.nonEmpty(propsValue.bulk_operation_id);
+ if (rawId === undefined) {
+ throw new Error('bulk_operation_id is required. Find running operations with list_bulk_operations.');
+ }
+ const id = shopifyGraphqlClient.toGid({ type: 'BulkOperation', id: rawId });
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ bulkOperationCancel: { bulkOperation: GqlBulkOperation | null } | null;
+ }>({
+ auth,
+ query: `mutation CancelBulkOperation($id: ID!) { bulkOperationCancel(id: $id) { bulkOperation { ${shopifyFields.BULK_OPERATION_FIELDS} } userErrors { field message } } }`,
+ variables: { id },
+ });
+ const operation = data.bulkOperationCancel?.bulkOperation;
+ if (!operation) {
+ throw new Error('Shopify did not return the bulk operation.');
+ }
+ return {
+ ...shopifyMappers.mapBulkOperation(operation),
+ redacted_fields: redactedFields,
+ };
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/count-catalogs.ts b/packages/pieces/community/shopify/src/lib/actions/ai/count-catalogs.ts
new file mode 100644
index 00000000000..5ddd5e47711
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/count-catalogs.ts
@@ -0,0 +1,54 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import { GqlCount, shopifyGraphqlClient, shopifyProps, shopifyValues } from '../../common/graphql';
+import { storeCountOutputSchema } from '../../output-schemas/store';
+
+export const shopifyAiCountCatalogs = createAction({
+ auth: shopifyAuth,
+ name: 'count_catalogs',
+ classification: 'READ',
+ displayName: 'Count Catalogs',
+ description: 'Count the store\'s catalogs, optionally by type or search.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Counts catalogs (market, B2B company-location and app catalogs), optionally only one type or those matching Shopify search syntax such as "status:ACTIVE". Plan requirement: B2B company-location catalogs exist only on Shopify Plus stores, so on other plans only market catalogs count. Shopify stops counting at 10,000; precision is AT_LEAST when it did. The required access scope is not documented. Read-only.',
+ idempotent: true,
+ },
+ props: {
+ type: Property.StaticDropdown({
+ displayName: 'Catalog Type',
+ description: 'Only count catalogs of this type. Leave empty for all types.',
+ required: false,
+ options: {
+ options: [
+ { label: 'Market', value: 'MARKET' },
+ { label: 'Company location (B2B)', value: 'COMPANY_LOCATION' },
+ { label: 'App', value: 'APP' },
+ { label: 'None', value: 'NONE' },
+ ],
+ },
+ }),
+ query: shopifyProps.searchQuery(
+ 'Shopify catalog search syntax, for example "status:ACTIVE" or "title:wholesale". Leave empty to count all.'
+ ),
+ },
+ outputSchema: storeCountOutputSchema,
+ async run({ auth, propsValue }) {
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ catalogsCount: GqlCount | null;
+ }>({
+ auth,
+ query: `query CountCatalogs($type: CatalogType, $query: String) { catalogsCount(type: $type, query: $query) { count precision } }`,
+ variables: {
+ type: propsValue.type,
+ query: shopifyValues.nonEmpty(propsValue.query),
+ },
+ });
+ return {
+ count: data.catalogsCount?.count ?? 0,
+ precision: data.catalogsCount?.precision ?? null,
+ redacted_fields: redactedFields,
+ };
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/count-events.ts b/packages/pieces/community/shopify/src/lib/actions/ai/count-events.ts
new file mode 100644
index 00000000000..95c460eb2f0
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/count-events.ts
@@ -0,0 +1,38 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import { GqlCount, shopifyGraphqlClient, shopifyProps, shopifyValues } from '../../common/graphql';
+import { storeCountOutputSchema } from '../../output-schemas/store';
+
+export const shopifyAiCountEvents = createAction({
+ auth: shopifyAuth,
+ name: 'count_events',
+ classification: 'READ',
+ displayName: 'Count Store Events',
+ description: 'Count store activity-log events, optionally filtered.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Counts store events (the activity log), optionally filtered with the same search syntax as list_events, for example "action:\'destroy\' AND subject_type:\'PRODUCT\'" or "created_at:>2026-09-01". Shopify stops counting at 10,000; precision is AT_LEAST when it did. No dedicated access scope is documented; the read scope of each subject type is expected to apply (not yet confirmed on a store). Read-only.',
+ idempotent: true,
+ },
+ props: {
+ query: shopifyProps.searchQuery(
+ 'Shopify event search syntax, for example "subject_type:\'ORDER\'" or "created_at:>2026-09-01". Leave empty to count all.'
+ ),
+ },
+ outputSchema: storeCountOutputSchema,
+ async run({ auth, propsValue }) {
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ eventsCount: GqlCount | null;
+ }>({
+ auth,
+ query: `query CountEvents($query: String) { eventsCount(query: $query) { count precision } }`,
+ variables: { query: shopifyValues.nonEmpty(propsValue.query) },
+ });
+ return {
+ count: data.eventsCount?.count ?? 0,
+ precision: data.eventsCount?.precision ?? null,
+ redacted_fields: redactedFields,
+ };
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/create-analytics-annotation.ts b/packages/pieces/community/shopify/src/lib/actions/ai/create-analytics-annotation.ts
new file mode 100644
index 00000000000..f3cf8b79808
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/create-analytics-annotation.ts
@@ -0,0 +1,106 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import { shopifyGraphqlClient, shopifyProps, shopifyValues } from '../../common/graphql';
+import {
+ analyticsFields,
+ analyticsMappers,
+ analyticsValues,
+ GqlAnalyticsAnnotation,
+} from '../../common/analytics';
+import { analyticsAnnotationOutputSchema } from '../../output-schemas/analytics';
+
+export const shopifyAiCreateAnalyticsAnnotation = createAction({
+ auth: shopifyAuth,
+ name: 'create_analytics_annotation',
+ classification: 'WRITE',
+ displayName: 'Create Analytics Annotation',
+ description: 'Mark a notable event (launch, campaign, redesign…) on the store\'s analytics charts.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Adds an annotation to the store\'s analytics timeline, so Shopify Analytics charts show a marker that explains a change in the numbers, for example a campaign, a product launch, a price test or a store redesign. type is one of the annotation types apps may create (for example campaign, product_launch, store_redesign, seasonal_promotion, ad_spend_change, other). title is required (at most 75 characters), description optional (at most 150). started_at and ended_at are ISO 8601 date-times with a time zone, for example 2026-11-28T00:00:00Z: leave ended_at empty for a point-in-time marker, or set open_ended for an event that is still running. The annotation is attributed to this app. There is NO action to list annotations, so keep the returned id: update_analytics_annotation and delete_analytics_annotation need it, and they only work on annotations this app created. Shopify caps how many annotations one app may keep per shop; past the cap it answers LIMIT_REACHED, and then an annotation must be deleted (by its saved id) or Shopify Support asked for a higher limit. Not idempotent: every call adds another annotation, so do not retry after a success. Needs the write_analytics_annotations access scope.',
+ idempotent: false,
+ },
+ props: {
+ type: shopifyProps.staticChoice({
+ displayName: 'Type',
+ description: 'The kind of event, for example campaign, product_launch, store_redesign or other.',
+ required: true,
+ values: analyticsFields.ANALYTICS_ANNOTATION_TYPES,
+ }),
+ title: Property.ShortText({
+ displayName: 'Title',
+ description: 'Text shown on the chart marker, at most 75 characters.',
+ required: true,
+ }),
+ description: Property.LongText({
+ displayName: 'Description',
+ description: 'Optional extra context, plain text, at most 150 characters.',
+ required: false,
+ }),
+ started_at: Property.ShortText({
+ displayName: 'Started At',
+ description: 'When the event started, ISO 8601 with a time zone, for example 2026-11-28T00:00:00Z.',
+ required: true,
+ }),
+ ended_at: Property.ShortText({
+ displayName: 'Ended At',
+ description:
+ 'When the event ended, ISO 8601 with a time zone. Leave empty for a point-in-time marker. Must not be before Started At.',
+ required: false,
+ }),
+ open_ended: Property.Checkbox({
+ displayName: 'Open-Ended',
+ description: 'The event is still running and has no end yet. Do not combine with Ended At.',
+ required: false,
+ defaultValue: false,
+ }),
+ },
+ outputSchema: analyticsAnnotationOutputSchema,
+ async run({ auth, propsValue }) {
+ const type = analyticsValues.readAnnotationType(propsValue.type);
+ if (type === undefined) {
+ throw new Error('type is required, for example campaign. Nothing was changed.');
+ }
+ const title = analyticsValues.readBoundedText({
+ value: propsValue.title,
+ label: 'title',
+ max: analyticsFields.ANNOTATION_TITLE_MAX,
+ });
+ if (title === undefined) {
+ throw new Error('title is required. Nothing was changed.');
+ }
+ const description = analyticsValues.readBoundedText({
+ value: propsValue.description,
+ label: 'description',
+ max: analyticsFields.ANNOTATION_DESCRIPTION_MAX,
+ });
+ const startedAt = analyticsValues.readDateTime({ value: propsValue.started_at, label: 'started_at' });
+ if (startedAt === undefined) {
+ throw new Error('started_at is required, for example 2026-11-28T00:00:00Z. Nothing was changed.');
+ }
+ const endedAt = shopifyValues.clearableValue({
+ value: analyticsValues.readDateTime({ value: propsValue.ended_at, label: 'ended_at' }),
+ clear: propsValue.open_ended,
+ valueName: 'ended_at',
+ clearName: 'open_ended',
+ });
+ analyticsValues.checkDateTimeOrder({ startedAt, endedAt: endedAt ?? undefined });
+ const input = shopifyValues.compact({ type, title, description, startedAt, endedAt });
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ analyticsAnnotationCreate: { analyticsAnnotation: GqlAnalyticsAnnotation | null } | null;
+ }>({
+ auth,
+ query: `mutation CreateAnalyticsAnnotation($input: AnalyticsAnnotationCreateInput!) { analyticsAnnotationCreate(input: $input) { analyticsAnnotation { ${analyticsFields.ANALYTICS_ANNOTATION_FIELDS} } userErrors { field message code } } }`,
+ variables: { input },
+ });
+ const annotation = data.analyticsAnnotationCreate?.analyticsAnnotation;
+ if (!annotation) {
+ throw new Error('Shopify did not return the created analytics annotation.');
+ }
+ return {
+ ...analyticsMappers.mapAnalyticsAnnotation(annotation),
+ redacted_fields: redactedFields,
+ };
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/create-analytics-target.ts b/packages/pieces/community/shopify/src/lib/actions/ai/create-analytics-target.ts
new file mode 100644
index 00000000000..f28397be064
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/create-analytics-target.ts
@@ -0,0 +1,170 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import {
+ GqlConnection,
+ ShopifyGraphqlResult,
+ shopifyFields,
+ shopifyGraphqlClient,
+ shopifyValues,
+} from '../../common/graphql';
+import {
+ analyticsFields,
+ analyticsMappers,
+ analyticsValues,
+ GqlAnalyticsTarget,
+} from '../../common/analytics';
+import { ShopifyAuth } from '../../common/types';
+import { createAnalyticsTargetOutputSchema } from '../../output-schemas/analytics';
+
+const TAKEN_CODE = 'TAKEN';
+const LOOKUP_PAGE_SIZE = 50;
+
+export const shopifyAiCreateAnalyticsTarget = createAction({
+ auth: shopifyAuth,
+ name: 'create_analytics_target',
+ classification: 'WRITE',
+ displayName: 'Create Analytics Target',
+ description: 'Set a goal for an analytics metric over a date range, shown in Shopify Analytics.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Creates an analytics target: a merchant goal for one metric over a date range, for example total_sales of 50000 from 2026-01-01 to 2026-03-31, or 1000 orders in a month. Shopify Analytics then shows progress toward it. metric is a ShopifyQL metric identifier; Shopify documents total_sales and orders as examples and answers INVALID_METRIC for a metric that cannot have a target. expected_value must be greater than 0 and is in the shop currency for money metrics. filters is an optional ShopifyQL filter expression that narrows the data, for example shipping_country = \'US\'. A target is unique by metric + start_date + end_date + filters: if one already exists, this action returns that existing target unchanged with already_existed true (it does not change its name or expected_value; use update_analytics_target for that), so a retry never creates a duplicate. The returned id works with update_analytics_target and delete_analytics_targets; list_analytics_targets finds targets later. Needs the write_reports access scope (read_reports to look up an existing duplicate).',
+ idempotent: false,
+ },
+ props: {
+ name: Property.ShortText({
+ displayName: 'Name',
+ description: 'Label for the target, for example "Q1 Sales Target".',
+ required: true,
+ }),
+ metric: Property.ShortText({
+ displayName: 'Metric',
+ description:
+ 'ShopifyQL metric identifier in lower case, for example total_sales or orders. Shopify rejects metrics that cannot have a target (INVALID_METRIC).',
+ required: true,
+ }),
+ start_date: Property.ShortText({
+ displayName: 'Start Date',
+ description: 'First day of the target period, YYYY-MM-DD.',
+ required: true,
+ }),
+ end_date: Property.ShortText({
+ displayName: 'End Date',
+ description: 'Last day of the target period, YYYY-MM-DD. Must not be before the start date.',
+ required: true,
+ }),
+ expected_value: Property.Number({
+ displayName: 'Expected Value',
+ description: 'The goal value, greater than 0 (for money metrics, an amount in the shop currency).',
+ required: true,
+ }),
+ filters: Property.ShortText({
+ displayName: 'Filters',
+ description:
+ 'Optional ShopifyQL filter expression that narrows the data, for example shipping_country = \'US\'. Leave empty to track the whole store.',
+ required: false,
+ }),
+ },
+ outputSchema: createAnalyticsTargetOutputSchema,
+ async run({ auth, propsValue }) {
+ const name = shopifyValues.nonEmpty(propsValue.name);
+ if (name === undefined) {
+ throw new Error('name is required. Nothing was changed.');
+ }
+ const metric = analyticsValues.readMetric(propsValue.metric);
+ if (metric === undefined) {
+ throw new Error('metric is required, for example total_sales. Nothing was changed.');
+ }
+ const startDate = shopifyValues.readIsoDate(propsValue.start_date);
+ const endDate = shopifyValues.readIsoDate(propsValue.end_date);
+ if (startDate === undefined || endDate === undefined) {
+ throw new Error('start_date and end_date are required, as YYYY-MM-DD. Nothing was changed.');
+ }
+ analyticsValues.checkDateOrder({ start: startDate, end: endDate });
+ const expectedValue = analyticsValues.readExpectedValue(propsValue.expected_value);
+ if (expectedValue === undefined) {
+ throw new Error('expected_value is required and must be greater than 0. Nothing was changed.');
+ }
+ const filters = shopifyValues.nonEmpty(propsValue.filters);
+ const input = shopifyValues.compact({ name, metric, startDate, endDate, expectedValue, filters });
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ analyticsTargetCreate: {
+ analyticsTarget: GqlAnalyticsTarget | null;
+ userErrors?: { field?: string[] | null; message?: string | null; code?: string | null }[] | null;
+ } | null;
+ }>({
+ auth,
+ query: `mutation CreateAnalyticsTarget($input: AnalyticsTargetCreateInput!) { analyticsTargetCreate(input: $input) { analyticsTarget { ${analyticsFields.ANALYTICS_TARGET_FIELDS} } userErrors { field message code } } }`,
+ variables: { input },
+ toleratedUserErrorCodes: [TAKEN_CODE],
+ });
+ const created = data.analyticsTargetCreate?.analyticsTarget;
+ const taken = (data.analyticsTargetCreate?.userErrors ?? []).find((item) => item.code === TAKEN_CODE);
+ if (created) {
+ return {
+ ...analyticsMappers.mapAnalyticsTarget(created),
+ already_existed: taken !== undefined,
+ redacted_fields: redactedFields,
+ };
+ }
+ if (!taken) {
+ throw new Error('Shopify did not return the created analytics target.');
+ }
+ const existing = await findExistingTarget({ auth, metric, startDate, endDate, filters });
+ if (!existing) {
+ throw new Error(
+ `Shopify rejected the request: ${taken.message ?? 'the target already exists'} (TAKEN). No target with this metric, dates and filters was found with list_analytics_targets; check it there. Nothing was changed.`
+ );
+ }
+ return {
+ ...analyticsMappers.mapAnalyticsTarget(existing.target),
+ already_existed: true,
+ redacted_fields: [...redactedFields, ...existing.redactedFields],
+ };
+ },
+});
+
+async function findExistingTarget({
+ auth,
+ metric,
+ startDate,
+ endDate,
+ filters,
+}: {
+ auth: ShopifyAuth;
+ metric: string;
+ startDate: string;
+ endDate: string;
+ filters: string | undefined;
+}): Promise<{ target: GqlAnalyticsTarget; redactedFields: string[] } | null> {
+ const search = `metric:${metric} start_date:${startDate} end_date:${endDate}`;
+ const wanted = filters ?? '';
+ let after: string | undefined = undefined;
+ for (;;) {
+ const response: ShopifyGraphqlResult<FindTargetsData> = await shopifyGraphqlClient.request<FindTargetsData>({
+ auth,
+ query: `query FindAnalyticsTarget($first: Int!, $after: String, $query: String) { analyticsTargets(first: $first, after: $after, query: $query) { nodes { ${analyticsFields.ANALYTICS_TARGET_FIELDS} } ${shopifyFields.PAGE_INFO_FIELDS} } }`,
+ variables: { first: LOOKUP_PAGE_SIZE, after, query: search },
+ });
+ const { data, redactedFields } = response;
+ const match = (data.analyticsTargets?.nodes ?? []).find(
+ (target) =>
+ target.metric === metric &&
+ target.startDate === startDate &&
+ target.endDate === endDate &&
+ (target.filters ?? '').trim() === wanted
+ );
+ if (match) {
+ return { target: match, redactedFields };
+ }
+ const pageInfo: GqlConnection<GqlAnalyticsTarget>['pageInfo'] = data.analyticsTargets?.pageInfo;
+ if (!pageInfo?.hasNextPage || !pageInfo.endCursor || pageInfo.endCursor === after) {
+ return null;
+ }
+ after = pageInfo.endCursor;
+ }
+}
+
+type FindTargetsData = {
+ analyticsTargets: GqlConnection<GqlAnalyticsTarget> | null;
+};
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/create-marketing-engagement.ts b/packages/pieces/community/shopify/src/lib/actions/ai/create-marketing-engagement.ts
new file mode 100644
index 00000000000..91e8a98ab44
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/create-marketing-engagement.ts
@@ -0,0 +1,187 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import {
+ GqlMarketingEngagement,
+ shopifyFields,
+ shopifyGraphqlClient,
+ shopifyMappers,
+ shopifyValues,
+} from '../../common/graphql';
+
+const COUNT_FIELDS: [string, string][] = [
+ ['impressions_count', 'impressionsCount'],
+ ['views_count', 'viewsCount'],
+ ['clicks_count', 'clicksCount'],
+ ['shares_count', 'sharesCount'],
+ ['favorites_count', 'favoritesCount'],
+ ['comments_count', 'commentsCount'],
+ ['unsubscribes_count', 'unsubscribesCount'],
+ ['complaints_count', 'complaintsCount'],
+ ['fails_count', 'failsCount'],
+ ['sends_count', 'sendsCount'],
+ ['unique_views_count', 'uniqueViewsCount'],
+ ['unique_clicks_count', 'uniqueClicksCount'],
+ ['sessions_count', 'sessionsCount'],
+];
+
+const DECIMAL_FIELDS: [string, string][] = [
+ ['orders', 'orders'],
+ ['first_time_customers', 'firstTimeCustomers'],
+ ['returning_customers', 'returningCustomers'],
+ ['primary_conversions', 'primaryConversions'],
+ ['all_conversions', 'allConversions'],
+];
+import { marketingEngagementOutputSchema } from '../../output-schemas/store';
+
+export const shopifyAiCreateMarketingEngagement = createAction({
+ auth: shopifyAuth,
+ name: 'create_marketing_engagement',
+ classification: 'WRITE',
+ displayName: 'Report Marketing Engagement',
+ description: 'Report one day of engagement metrics for a marketing activity or channel.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Records engagement metrics (impressions, clicks, sends, ad spend, sales, conversions and so on) for ONE day, occurred_on, on an external marketing activity (by marketing_activity_id or remote_id) or on a whole channel (by channel_handle); pass exactly one of the three. The numbers are daily values for that day only, never running totals: Shopify phased out cumulative metrics, so this action always sends them as non-cumulative. Send at least one metric. Each call records another engagement entry, so do not repeat a day that was already reported. Needs the write_marketing_events access scope.',
+ idempotent: false,
+ },
+ props: {
+ marketing_activity_id: Property.ShortText({
+ displayName: 'Marketing Activity ID',
+ description: 'The activity id, numeric or "gid://shopify/MarketingActivity/…". Use this, the remote id, or a channel handle.',
+ required: false,
+ }),
+ remote_id: Property.ShortText({
+ displayName: 'Remote ID',
+ description: 'Your own id the activity was created with, for example "fb-campaign-2026-spring".',
+ required: false,
+ }),
+ channel_handle: Property.ShortText({
+ displayName: 'Channel Handle',
+ description: 'For channel-level metrics only: the channel handle your Shopify partner manager gave you. Leave empty for activity metrics.',
+ required: false,
+ }),
+ occurred_on: Property.ShortText({
+ displayName: 'Day',
+ description: 'The day the metrics cover, YYYY-MM-DD, for example "2026-09-22".',
+ required: true,
+ }),
+ utc_offset: Property.ShortText({
+ displayName: 'UTC Offset',
+ description: 'Time zone offset of that day, for example "+00:00" or "-05:00".',
+ required: true,
+ }),
+ impressions_count: Property.Number({ displayName: 'Impressions', description: 'Times the content was shown that day.', required: false }),
+ views_count: Property.Number({ displayName: 'Views', description: 'Views that day.', required: false }),
+ clicks_count: Property.Number({ displayName: 'Clicks', description: 'Clicks that day.', required: false }),
+ shares_count: Property.Number({ displayName: 'Shares', description: 'Shares that day.', required: false }),
+ favorites_count: Property.Number({ displayName: 'Favorites', description: 'Favorites or likes that day.', required: false }),
+ comments_count: Property.Number({ displayName: 'Comments', description: 'Comments that day.', required: false }),
+ unsubscribes_count: Property.Number({ displayName: 'Unsubscribes', description: 'Unsubscribes that day.', required: false }),
+ complaints_count: Property.Number({ displayName: 'Complaints', description: 'Spam complaints that day.', required: false }),
+ fails_count: Property.Number({ displayName: 'Failed Sends', description: 'Messages that failed to send that day.', required: false }),
+ sends_count: Property.Number({ displayName: 'Sends', description: 'Messages sent that day.', required: false }),
+ unique_views_count: Property.Number({ displayName: 'Unique Views', description: 'Unique viewers that day.', required: false }),
+ unique_clicks_count: Property.Number({ displayName: 'Unique Clicks', description: 'Unique clickers that day.', required: false }),
+ sessions_count: Property.Number({ displayName: 'Sessions', description: 'Store sessions from the activity that day.', required: false }),
+ orders: Property.Number({ displayName: 'Orders', description: 'Orders attributed to the activity that day (may be fractional for shared attribution).', required: false }),
+ first_time_customers: Property.Number({ displayName: 'First-Time Customers', description: 'New customers attributed that day.', required: false }),
+ returning_customers: Property.Number({ displayName: 'Returning Customers', description: 'Returning customers attributed that day.', required: false }),
+ primary_conversions: Property.Number({ displayName: 'Primary Conversions', description: 'Primary conversions that day.', required: false }),
+ all_conversions: Property.Number({ displayName: 'All Conversions', description: 'All conversions that day.', required: false }),
+ ad_spend_amount: Property.Number({ displayName: 'Ad Spend', description: 'Amount spent that day, in the currency below.', required: false }),
+ sales_amount: Property.Number({ displayName: 'Sales', description: 'Sales attributed that day, in the currency below.', required: false }),
+ currency: Property.ShortText({
+ displayName: 'Currency',
+ description: 'ISO currency code of ad spend and sales, for example "USD". Needed when either is set.',
+ required: false,
+ }),
+ },
+ outputSchema: marketingEngagementOutputSchema,
+ async run({ auth, propsValue }) {
+ const occurredOn = shopifyValues.readIsoDate(propsValue.occurred_on);
+ if (!occurredOn) {
+ throw new Error('occurred_on is required, YYYY-MM-DD. Nothing was recorded.');
+ }
+ const utcOffset = shopifyValues.nonEmpty(propsValue.utc_offset);
+ if (!utcOffset || !/^[+-]\d{2}:\d{2}$/.test(utcOffset)) {
+ throw new Error('utc_offset must look like "+00:00" or "-05:00". Nothing was recorded.');
+ }
+ const values: Record<string, unknown> = propsValue;
+ const metrics: Record<string, unknown> = {};
+ for (const [prop, field] of COUNT_FIELDS) {
+ const value = values[prop];
+ if (value === undefined || value === null) {
+ continue;
+ }
+ if (typeof value !== 'number' || !Number.isInteger(value) || value < 0) {
+ throw new Error(`${prop} must be a whole number of 0 or more. Nothing was recorded.`);
+ }
+ metrics[field] = value;
+ }
+ for (const [prop, field] of DECIMAL_FIELDS) {
+ const value = values[prop];
+ if (value === undefined || value === null) {
+ continue;
+ }
+ if (typeof value !== 'number' || !Number.isFinite(value) || value < 0) {
+ throw new Error(`${prop} must be 0 or more. Nothing was recorded.`);
+ }
+ metrics[field] = String(value);
+ }
+ const money = shopifyValues.compact({
+ adSpend: shopifyValues.buildMoneyInput({ amount: propsValue.ad_spend_amount, currency: propsValue.currency, label: 'ad_spend_amount' }),
+ sales: shopifyValues.buildMoneyInput({ amount: propsValue.sales_amount, currency: propsValue.currency, label: 'sales_amount' }),
+ });
+ if (Object.keys(metrics).length === 0 && Object.keys(money).length === 0) {
+ throw new Error('Send at least one metric for the day. Nothing was recorded.');
+ }
+ const target = readTarget({
+ marketingActivityId: propsValue.marketing_activity_id,
+ remoteId: propsValue.remote_id,
+ channelHandle: propsValue.channel_handle,
+ });
+ const marketingEngagement = {
+ occurredOn,
+ utcOffset,
+ ...metrics,
+ ...money,
+ isCumulative: false,
+ };
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ marketingEngagementCreate: { marketingEngagement: GqlMarketingEngagement | null } | null;
+ }>({
+ auth,
+ query: `mutation CreateMarketingEngagement($marketingActivityId: ID, $remoteId: String, $channelHandle: String, $marketingEngagement: MarketingEngagementInput!) { marketingEngagementCreate(marketingActivityId: $marketingActivityId, remoteId: $remoteId, channelHandle: $channelHandle, marketingEngagement: $marketingEngagement) { marketingEngagement { ${shopifyFields.MARKETING_ENGAGEMENT_FIELDS} } userErrors { field message code } } }`,
+ variables: { ...target, marketingEngagement },
+ });
+ const engagement = data.marketingEngagementCreate?.marketingEngagement;
+ if (!engagement) {
+ throw new Error('Shopify did not return the recorded engagement.');
+ }
+ return {
+ ...shopifyMappers.mapMarketingEngagement(engagement),
+ redacted_fields: redactedFields,
+ };
+ },
+});
+
+function readTarget({
+ marketingActivityId,
+ remoteId,
+ channelHandle,
+}: {
+ marketingActivityId: string | undefined | null;
+ remoteId: string | undefined | null;
+ channelHandle: string | undefined | null;
+}): { marketingActivityId?: string; remoteId?: string; channelHandle?: string } {
+ const handle = shopifyValues.nonEmpty(channelHandle);
+ const hasActivity = shopifyValues.nonEmpty(marketingActivityId) !== undefined || shopifyValues.nonEmpty(remoteId) !== undefined;
+ if (handle && hasActivity) {
+ throw new Error('Pass exactly one of marketing_activity_id, remote_id or channel_handle. Nothing was recorded.');
+ }
+ if (handle) {
+ return { channelHandle: handle };
+ }
+ return shopifyValues.readMarketingActivityTarget({ marketingActivityId, remoteId });
+}
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/create-script-tag.ts b/packages/pieces/community/shopify/src/lib/actions/ai/create-script-tag.ts
new file mode 100644
index 00000000000..97b2f36b686
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/create-script-tag.ts
@@ -0,0 +1,68 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import {
+ GqlScriptTag,
+ shopifyFields,
+ shopifyGraphqlClient,
+ shopifyMappers,
+ shopifyProps,
+ shopifyValues,
+} from '../../common/graphql';
+import { scriptTagOutputSchema } from '../../output-schemas/store';
+
+export const shopifyAiCreateScriptTag = createAction({
+ auth: shopifyAuth,
+ name: 'create_script_tag',
+ classification: 'WRITE',
+ displayName: 'Create Script Tag',
+ description: 'Load a remote JavaScript file on every online store page.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Creates a script tag so the online store loads the given remote JavaScript file on every storefront page, and returns it. The script runs in every shopper\'s browser with full access to the page, so only add a script URL the merchant explicitly asked for and trusts, and say which URL you are adding. It only works on vintage themes; Online Store 2.0 themes ignore script tags. The display scope is always ONLINE_STORE (the order-status scopes are deprecated). Each call adds another tag, even for the same URL, so check list_script_tags with src first. Needs the write_script_tags access scope. Shopify no longer lets many apps create or update script tags: if it answers "This app can\'t create or update script tags", do not retry; a theme app extension is needed instead.',
+ idempotent: false,
+ },
+ props: {
+ src: Property.ShortText({
+ displayName: 'Script URL',
+ description: 'HTTPS URL of the JavaScript file, for example "https://cdn.example.com/widget.js".',
+ required: true,
+ }),
+ cache: shopifyProps.booleanChoice({
+ displayName: 'Cache',
+ description: 'Yes lets Shopify serve the script from its CDN cache (changes to the file then show up with a delay). Leave empty for Shopify\'s default.',
+ }),
+ },
+ outputSchema: scriptTagOutputSchema,
+ async run({ auth, propsValue }) {
+ const src = readScriptUrl(propsValue.src);
+ const input = shopifyValues.compact({
+ src,
+ displayScope: 'ONLINE_STORE',
+ cache: shopifyValues.toBooleanChoice(propsValue.cache),
+ });
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ scriptTagCreate: { scriptTag: GqlScriptTag | null } | null;
+ }>({
+ auth,
+ query: `mutation CreateScriptTag($input: ScriptTagInput!) { scriptTagCreate(input: $input) { scriptTag { ${shopifyFields.SCRIPT_TAG_FIELDS} } userErrors { field message } } }`,
+ variables: { input },
+ });
+ const tag = data.scriptTagCreate?.scriptTag;
+ if (!tag) {
+ throw new Error('Shopify did not return the new script tag.');
+ }
+ return {
+ ...shopifyMappers.mapScriptTag(tag),
+ redacted_fields: redactedFields,
+ };
+ },
+});
+
+function readScriptUrl(value: string | undefined | null): string {
+ const src = shopifyValues.nonEmpty(value);
+ if (!src || !/^https:\/\/\S+$/i.test(src)) {
+ throw new Error('src must be an https:// URL of a JavaScript file. Nothing was created.');
+ }
+ return src;
+}
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/delete-analytics-annotation.ts b/packages/pieces/community/shopify/src/lib/actions/ai/delete-analytics-annotation.ts
new file mode 100644
index 00000000000..3818c55e894
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/delete-analytics-annotation.ts
@@ -0,0 +1,41 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import { shopifyGraphqlClient } from '../../common/graphql';
+import { deleteAnalyticsAnnotationOutputSchema } from '../../output-schemas/analytics';
+
+export const shopifyAiDeleteAnalyticsAnnotation = createAction({
+ auth: shopifyAuth,
+ name: 'delete_analytics_annotation',
+ classification: 'DESTRUCTIVE',
+ displayName: 'Delete Analytics Annotation',
+ description: 'Remove an analytics annotation this app created.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Permanently deletes one analytics annotation, so its marker disappears from the store\'s analytics charts. Pass the id returned by create_analytics_annotation (there is no action to list annotations). Only annotations this app created can be deleted; any other id fails with NOT_FOUND. Deleting frees a slot when create_analytics_annotation answered LIMIT_REACHED. There is no undo: recreating it gives a new id. Confirm with the user first. A repeat call fails with NOT_FOUND because it is gone. Needs the write_analytics_annotations access scope.',
+ idempotent: false,
+ },
+ props: {
+ annotation_id: Property.ShortText({
+ displayName: 'Analytics Annotation ID',
+ description:
+ 'The annotation id, numeric or "gid://shopify/AnalyticsAnnotation/…", as returned by create_analytics_annotation.',
+ required: true,
+ }),
+ },
+ outputSchema: deleteAnalyticsAnnotationOutputSchema,
+ async run({ auth, propsValue }) {
+ const id = shopifyGraphqlClient.toGid({ type: 'AnalyticsAnnotation', id: propsValue.annotation_id });
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ analyticsAnnotationDelete: { deletedId?: string | null } | null;
+ }>({
+ auth,
+ query: `mutation DeleteAnalyticsAnnotation($id: ID!) { analyticsAnnotationDelete(id: $id) { deletedId userErrors { field message code } } }`,
+ variables: { id },
+ });
+ return {
+ deleted_annotation_id: data.analyticsAnnotationDelete?.deletedId ?? id,
+ redacted_fields: redactedFields,
+ };
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/delete-analytics-targets.ts b/packages/pieces/community/shopify/src/lib/actions/ai/delete-analytics-targets.ts
new file mode 100644
index 00000000000..1482af6afda
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/delete-analytics-targets.ts
@@ -0,0 +1,66 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import { shopifyGraphqlClient, shopifyValues } from '../../common/graphql';
+import { deleteAnalyticsTargetsOutputSchema } from '../../output-schemas/analytics';
+
+const NOT_FOUND_CODE = 'NOT_FOUND';
+
+export const shopifyAiDeleteAnalyticsTargets = createAction({
+ auth: shopifyAuth,
+ name: 'delete_analytics_targets',
+ classification: 'DESTRUCTIVE',
+ displayName: 'Delete Analytics Targets',
+ description: 'Permanently delete one or more analytics targets.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Permanently deletes one or more analytics targets (merchant goals shown in Shopify Analytics). There is no undo; recreating one with create_analytics_target gives it a new id. Confirm with the user first and name the targets (name, metric, period) being removed. Get the ids from list_analytics_targets. Shopify deletes every id it finds even when others are not found: deleted_ids lists what was removed, not_deleted_ids and errors list the rest (for example NOT_FOUND because it was already deleted). The step fails only when nothing at all was deleted. A repeat call reports the ids as not found. Needs the write_reports access scope.',
+ idempotent: false,
+ },
+ props: {
+ target_ids: Property.Array({
+ displayName: 'Analytics Target IDs',
+ description: 'Targets to delete, numeric or "gid://shopify/AnalyticsTarget/…". Find them with list_analytics_targets.',
+ required: true,
+ }),
+ },
+ outputSchema: deleteAnalyticsTargetsOutputSchema,
+ async run({ auth, propsValue }) {
+ const ids = shopifyValues.toGidList({ type: 'AnalyticsTarget', value: propsValue.target_ids });
+ if (!ids) {
+ throw new Error('Provide at least one analytics target id. Nothing was deleted.');
+ }
+ const uniqueIds = [...new Set(ids)];
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ analyticsTargetsDelete: {
+ deletedIds?: string[] | null;
+ userErrors?: { field?: string[] | null; message?: string | null; code?: string | null }[] | null;
+ } | null;
+ }>({
+ auth,
+ query: `mutation DeleteAnalyticsTargets($ids: [ID!]!) { analyticsTargetsDelete(ids: $ids) { deletedIds userErrors { field message code } } }`,
+ variables: { ids: uniqueIds },
+ toleratedUserErrorCodes: [NOT_FOUND_CODE],
+ });
+ const deletedIds = data.analyticsTargetsDelete?.deletedIds ?? [];
+ const deleted = new Set(deletedIds);
+ const notDeletedIds = uniqueIds.filter((id) => !deleted.has(id));
+ const errors = (data.analyticsTargetsDelete?.userErrors ?? []).map((item) => {
+ const field = (item.field ?? []).join('.');
+ const code = item.code ? ` (${item.code})` : '';
+ return `${field ? `${field}: ` : ''}${item.message ?? 'Unknown error'}${code}`;
+ });
+ if (deletedIds.length === 0) {
+ throw new Error(
+ `No analytics target was deleted. ${errors.length > 0 ? `Shopify said: ${errors.join('; ')}` : 'Shopify returned no deleted ids.'} Check the ids with list_analytics_targets.`
+ );
+ }
+ return {
+ deleted_ids: deletedIds,
+ deleted_count: deletedIds.length,
+ not_deleted_ids: notDeletedIds,
+ errors,
+ redacted_fields: redactedFields,
+ };
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/delete-external-marketing-activity.ts b/packages/pieces/community/shopify/src/lib/actions/ai/delete-external-marketing-activity.ts
new file mode 100644
index 00000000000..92076182ca8
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/delete-external-marketing-activity.ts
@@ -0,0 +1,58 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import { shopifyGraphqlClient, shopifyValues } from '../../common/graphql';
+
+const DELETE_QUEUED_CODE = 'DELETE_JOB_ENQUEUED';
+import { deleteMarketingActivityOutputSchema } from '../../output-schemas/store';
+
+export const shopifyAiDeleteExternalMarketingActivity = createAction({
+ auth: shopifyAuth,
+ name: 'delete_external_marketing_activity',
+ classification: 'DESTRUCTIVE',
+ displayName: 'Delete External Marketing Activity',
+ description: 'Delete an external marketing activity.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Deletes one external marketing activity, identified by exactly one of marketing_activity_id or remote_id, and returns the deleted id. Its reported engagement goes with it and cannot be restored; to keep the history and only mark it as over, use update_external_marketing_activity with an INACTIVE status instead. Shopify refuses to delete an activity that still has child events (code CANNOT_DELETE_ACTIVITY_WITH_CHILD_EVENTS). If Shopify answers that the deletion was queued (code DELETE_JOB_ENQUEUED, not yet confirmed on a store) the output says deletion_queued: true. A repeat call fails because the activity is gone. Needs the write_marketing_events access scope.',
+ idempotent: false,
+ },
+ props: {
+ marketing_activity_id: Property.ShortText({
+ displayName: 'Marketing Activity ID',
+ description: 'The activity id, numeric or "gid://shopify/MarketingActivity/…". Use this or the remote id.',
+ required: false,
+ }),
+ remote_id: Property.ShortText({
+ displayName: 'Remote ID',
+ description: 'Your own id the activity was created with, for example "fb-campaign-2026-spring".',
+ required: false,
+ }),
+ },
+ outputSchema: deleteMarketingActivityOutputSchema,
+ async run({ auth, propsValue }) {
+ const target = shopifyValues.readMarketingActivityTarget({
+ marketingActivityId: propsValue.marketing_activity_id,
+ remoteId: propsValue.remote_id,
+ });
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ marketingActivityDeleteExternal: {
+ deletedMarketingActivityId?: string | null;
+ userErrors?: { code?: string | null }[] | null;
+ } | null;
+ }>({
+ auth,
+ query: `mutation DeleteExternalMarketingActivity($marketingActivityId: ID, $remoteId: String) { marketingActivityDeleteExternal(marketingActivityId: $marketingActivityId, remoteId: $remoteId) { deletedMarketingActivityId userErrors { field message code } } }`,
+ variables: target,
+ toleratedUserErrorCodes: [DELETE_QUEUED_CODE],
+ });
+ const payload = data.marketingActivityDeleteExternal;
+ const queued = (payload?.userErrors ?? []).some((item) => item.code === DELETE_QUEUED_CODE);
+ return {
+ deleted_marketing_activity_id: payload?.deletedMarketingActivityId ?? target.marketingActivityId ?? null,
+ remote_id: target.remoteId ?? null,
+ deletion_queued: queued,
+ redacted_fields: redactedFields,
+ };
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/delete-saved-search.ts b/packages/pieces/community/shopify/src/lib/actions/ai/delete-saved-search.ts
new file mode 100644
index 00000000000..c23d4b4b33f
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/delete-saved-search.ts
@@ -0,0 +1,40 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import { shopifyGraphqlClient } from '../../common/graphql';
+import { deleteSavedSearchOutputSchema } from '../../output-schemas/store';
+
+export const shopifyAiDeleteSavedSearch = createAction({
+ auth: shopifyAuth,
+ name: 'delete_saved_search',
+ classification: 'DESTRUCTIVE',
+ displayName: 'Delete Saved Search',
+ description: 'Delete a saved admin search (a saved filter view).',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Deletes one saved search: a named filter view that staff saved in the Shopify admin (for example "Unfulfilled orders over $100" on the orders list). Staff lose that view for everyone; the records it matched are not touched. Get the id from list_saved_searches (id), choosing the resource_type the search belongs to. Needs the write access scope of the resource the search belongs to (for example write_orders for an order search). A repeat call fails because the search is gone.',
+ idempotent: false,
+ },
+ props: {
+ saved_search_id: Property.ShortText({
+ displayName: 'Saved Search ID',
+ description: 'The saved search id, numeric or "gid://shopify/SavedSearch/…" (see id from list_saved_searches).',
+ required: true,
+ }),
+ },
+ outputSchema: deleteSavedSearchOutputSchema,
+ async run({ auth, propsValue }) {
+ const id = shopifyGraphqlClient.toGid({ type: 'SavedSearch', id: propsValue.saved_search_id });
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ savedSearchDelete: { deletedSavedSearchId?: string | null } | null;
+ }>({
+ auth,
+ query: `mutation DeleteSavedSearch($input: SavedSearchDeleteInput!) { savedSearchDelete(input: $input) { deletedSavedSearchId userErrors { field message } } }`,
+ variables: { input: { id } },
+ });
+ return {
+ deleted_saved_search_id: data.savedSearchDelete?.deletedSavedSearchId ?? id,
+ redacted_fields: redactedFields,
+ };
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/delete-script-tag.ts b/packages/pieces/community/shopify/src/lib/actions/ai/delete-script-tag.ts
new file mode 100644
index 00000000000..5c5835a7f2e
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/delete-script-tag.ts
@@ -0,0 +1,40 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import { shopifyGraphqlClient } from '../../common/graphql';
+import { deleteScriptTagOutputSchema } from '../../output-schemas/store';
+
+export const shopifyAiDeleteScriptTag = createAction({
+ auth: shopifyAuth,
+ name: 'delete_script_tag',
+ classification: 'DESTRUCTIVE',
+ displayName: 'Delete Script Tag',
+ description: 'Stop the online store from loading a script tag.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Deletes one script tag, so the storefront stops loading that JavaScript file at once; whatever the script did (widgets, tracking, chat) stops working on the store. Recreate it with create_script_tag if needed. A repeat call fails because the tag is gone. Needs the write_script_tags access scope.',
+ idempotent: false,
+ },
+ props: {
+ script_tag_id: Property.ShortText({
+ displayName: 'Script Tag ID',
+ description: 'The script tag id, numeric or "gid://shopify/ScriptTag/…". Find it with list_script_tags.',
+ required: true,
+ }),
+ },
+ outputSchema: deleteScriptTagOutputSchema,
+ async run({ auth, propsValue }) {
+ const id = shopifyGraphqlClient.toGid({ type: 'ScriptTag', id: propsValue.script_tag_id });
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ scriptTagDelete: { deletedScriptTagId?: string | null } | null;
+ }>({
+ auth,
+ query: `mutation DeleteScriptTag($id: ID!) { scriptTagDelete(id: $id) { deletedScriptTagId userErrors { field message } } }`,
+ variables: { id },
+ });
+ return {
+ deleted_script_tag_id: data.scriptTagDelete?.deletedScriptTagId ?? id,
+ redacted_fields: redactedFields,
+ };
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/delete-web-presence.ts b/packages/pieces/community/shopify/src/lib/actions/ai/delete-web-presence.ts
new file mode 100644
index 00000000000..ad4b9e1d08f
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/delete-web-presence.ts
@@ -0,0 +1,40 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import { shopifyGraphqlClient } from '../../common/graphql';
+import { deleteWebPresenceOutputSchema } from '../../output-schemas/store';
+
+export const shopifyAiDeleteWebPresence = createAction({
+ auth: shopifyAuth,
+ name: 'delete_web_presence',
+ classification: 'DESTRUCTIVE',
+ displayName: 'Delete Markets Web Presence',
+ description: 'Remove a Markets web presence (a market\'s domain or subfolder storefront).',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Deletes one Markets web presence: the domain or subfolder (for example example.com/fr-ca) through which a market\'s shoppers reach the storefront in their languages. Shoppers of those markets immediately lose that URL, links and search results pointing to it stop working, and there is no action here to recreate it (only the Shopify admin can), so confirm with the user first and name the URL being removed. Shopify may refuse to delete the web presence of the shop\'s primary domain (not yet confirmed on a store). Plan requirement: a web presence only exists when the store uses Markets with an extra domain or subfolder; get its id from list_web_presences (id), which covers subfolder presences too (they have no domain of their own). A repeat call fails because it is gone. Needs the read_markets and write_markets access scopes.',
+ idempotent: false,
+ },
+ props: {
+ web_presence_id: Property.ShortText({
+ displayName: 'Web Presence ID',
+ description: 'The web presence id, numeric or "gid://shopify/MarketWebPresence/…" (see id from list_web_presences).',
+ required: true,
+ }),
+ },
+ outputSchema: deleteWebPresenceOutputSchema,
+ async run({ auth, propsValue }) {
+ const id = shopifyGraphqlClient.toGid({ type: 'MarketWebPresence', id: propsValue.web_presence_id });
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ webPresenceDelete: { deletedId?: string | null } | null;
+ }>({
+ auth,
+ query: `mutation DeleteWebPresence($id: ID!) { webPresenceDelete(id: $id) { deletedId userErrors { field message code } } }`,
+ variables: { id },
+ });
+ return {
+ deleted_web_presence_id: data.webPresenceDelete?.deletedId ?? id,
+ redacted_fields: redactedFields,
+ };
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/get-bulk-operation.ts b/packages/pieces/community/shopify/src/lib/actions/ai/get-bulk-operation.ts
new file mode 100644
index 00000000000..b23e6993619
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/get-bulk-operation.ts
@@ -0,0 +1,48 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import {
+ GqlBulkOperation,
+ shopifyFields,
+ shopifyGraphqlClient,
+ shopifyMappers,
+} from '../../common/graphql';
+import { bulkOperationOutputSchema } from '../../output-schemas/store';
+
+export const shopifyAiGetBulkOperation = createAction({
+ auth: shopifyAuth,
+ name: 'get_bulk_operation',
+ classification: 'READ',
+ displayName: 'Get Bulk Operation',
+ description: 'Check the status and result file of a bulk query or bulk mutation.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Returns one bulk operation (started by start_bulk_query or start_bulk_mutation): its status (CREATED, RUNNING, CANCELING, CANCELED, COMPLETED, FAILED, EXPIRED), type, error code, object counts and, once COMPLETED, the url of the JSONL result file (partial_data_url holds what was produced before a failure). This is a single read, not a wait: call it again later while status is CREATED or RUNNING. Result links expire after seven days. Read-only.',
+ idempotent: true,
+ },
+ props: {
+ bulk_operation_id: Property.ShortText({
+ displayName: 'Bulk Operation ID',
+ description: 'The bulk_operation_id returned when the operation was started, numeric or "gid://shopify/BulkOperation/…".',
+ required: true,
+ }),
+ },
+ outputSchema: bulkOperationOutputSchema,
+ async run({ auth, propsValue }) {
+ const id = shopifyGraphqlClient.toGid({ type: 'BulkOperation', id: propsValue.bulk_operation_id });
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ bulkOperation: GqlBulkOperation | null;
+ }>({
+ auth,
+ query: `query GetBulkOperation($id: ID!) { bulkOperation(id: $id) { ${shopifyFields.BULK_OPERATION_FIELDS} } }`,
+ variables: { id },
+ });
+ if (!data.bulkOperation) {
+ throw new Error(`Bulk operation ${id} was not found.`);
+ }
+ return {
+ ...shopifyMappers.mapBulkOperation(data.bulkOperation),
+ redacted_fields: redactedFields,
+ };
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/get-business-entity.ts b/packages/pieces/community/shopify/src/lib/actions/ai/get-business-entity.ts
new file mode 100644
index 00000000000..677c72255ce
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/get-business-entity.ts
@@ -0,0 +1,50 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import {
+ GqlBusinessEntity,
+ shopifyFields,
+ shopifyGraphqlClient,
+ shopifyMappers,
+ shopifyValues,
+} from '../../common/graphql';
+import { businessEntityOutputSchema } from '../../output-schemas/store';
+
+export const shopifyAiGetBusinessEntity = createAction({
+ auth: shopifyAuth,
+ name: 'get_business_entity',
+ classification: 'READ',
+ displayName: 'Get Business Entity',
+ description: 'Get one business entity, or the primary one when no id is given.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Returns one business entity (a legal entity the merchant trades through): names, primary and archived flags, legal entity id and address. Leave business_entity_id empty to get the store\'s primary entity. Pass the id exactly as list_business_entities returned it; non-numeric ids are sent unchanged. The required access scope is not documented; availability on every plan is to be confirmed. Read-only.',
+ idempotent: true,
+ },
+ props: {
+ business_entity_id: Property.ShortText({
+ displayName: 'Business Entity ID',
+ description: 'The entity id as returned by list_business_entities (a numeric id is read as "gid://shopify/BusinessEntity/…"). Leave empty for the primary entity.',
+ required: false,
+ }),
+ },
+ outputSchema: businessEntityOutputSchema,
+ async run({ auth, propsValue }) {
+ const rawId = shopifyValues.nonEmpty(propsValue.business_entity_id);
+ const id = rawId ? shopifyGraphqlClient.toGid({ type: 'BusinessEntity', id: rawId }) : undefined;
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ businessEntity: GqlBusinessEntity | null;
+ }>({
+ auth,
+ query: `query GetBusinessEntity($id: ID) { businessEntity(id: $id) { ${shopifyFields.BUSINESS_ENTITY_FIELDS} } }`,
+ variables: shopifyValues.compact({ id }),
+ });
+ if (!data.businessEntity) {
+ throw new Error(id ? `Business entity ${id} was not found.` : 'Shopify returned no primary business entity.');
+ }
+ return {
+ ...shopifyMappers.mapBusinessEntity(data.businessEntity),
+ redacted_fields: redactedFields,
+ };
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/get-domain.ts b/packages/pieces/community/shopify/src/lib/actions/ai/get-domain.ts
new file mode 100644
index 00000000000..162035ddfcb
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/get-domain.ts
@@ -0,0 +1,66 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import {
+ GqlDomain,
+ shopifyFields,
+ shopifyGraphqlClient,
+ shopifyMappers,
+ shopifyValues,
+} from '../../common/graphql';
+import { domainOutputSchema } from '../../output-schemas/store';
+
+export const shopifyAiGetDomain = createAction({
+ auth: shopifyAuth,
+ name: 'get_domain',
+ classification: 'READ',
+ displayName: 'Get Domain',
+ description: 'Get one of the store\'s domains by id, or the primary domain.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Returns one store domain: id, host, URL, whether SSL is on, its default and alternate languages and country, and the Markets web presence it serves (web_presence_id, subfolder suffix and root URLs per language). Leave domain_id empty to get the shop\'s primary domain. To find other domains, use list_web_presences (domain_id on each domain presence). Read-only. No access scope is documented for this query.',
+ idempotent: true,
+ },
+ props: {
+ domain_id: Property.ShortText({
+ displayName: 'Domain ID',
+ description: 'The domain id, numeric or "gid://shopify/Domain/…" (see domain_id from list_web_presences). Leave empty for the primary domain.',
+ required: false,
+ }),
+ },
+ outputSchema: domainOutputSchema,
+ async run({ auth, propsValue }) {
+ const domainId = shopifyValues.nonEmpty(propsValue.domain_id);
+ if (!domainId) {
+ const primary = await shopifyGraphqlClient.request<{
+ shop: { primaryDomain: GqlDomain | null } | null;
+ }>({
+ auth,
+ query: `query GetPrimaryDomain { shop { primaryDomain { ${shopifyFields.DOMAIN_FIELDS} } } }`,
+ });
+ const domain = primary.data.shop?.primaryDomain;
+ if (!domain) {
+ throw new Error('Shopify did not return the primary domain.');
+ }
+ return {
+ ...shopifyMappers.mapDomain(domain),
+ redacted_fields: primary.redactedFields,
+ };
+ }
+ const id = shopifyGraphqlClient.toGid({ type: 'Domain', id: domainId });
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ domain: GqlDomain | null;
+ }>({
+ auth,
+ query: `query GetDomain($id: ID!) { domain(id: $id) { ${shopifyFields.DOMAIN_FIELDS} } }`,
+ variables: { id },
+ });
+ if (!data.domain) {
+ throw new Error(`Domain ${id} was not found.`);
+ }
+ return {
+ ...shopifyMappers.mapDomain(data.domain),
+ redacted_fields: redactedFields,
+ };
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/get-event.ts b/packages/pieces/community/shopify/src/lib/actions/ai/get-event.ts
new file mode 100644
index 00000000000..105f42c5e29
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/get-event.ts
@@ -0,0 +1,48 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import {
+ GqlEvent,
+ shopifyFields,
+ shopifyGraphqlClient,
+ shopifyMappers,
+} from '../../common/graphql';
+import { eventOutputSchema } from '../../output-schemas/store';
+
+export const shopifyAiGetEvent = createAction({
+ auth: shopifyAuth,
+ name: 'get_event',
+ classification: 'READ',
+ displayName: 'Get Store Event',
+ description: 'Get one store activity-log event.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Returns one store event: its action (for example create, update, destroy, published), message, subject id and type for basic events or the raw comment text for staff comments, the app that caused it and when it happened. A numeric id is read as a basic event; pass the full "gid://shopify/CommentEvent/…" id for a staff comment. Find ids with list_events. No dedicated access scope is documented; the read scope of the event\'s subject is expected to apply (not yet confirmed on a store). Read-only.',
+ idempotent: true,
+ },
+ props: {
+ event_id: Property.ShortText({
+ displayName: 'Event ID',
+ description: 'The event id, numeric (a basic event) or a full id such as "gid://shopify/BasicEvent/422690323" or "gid://shopify/CommentEvent/…". Find it with list_events.',
+ required: true,
+ }),
+ },
+ outputSchema: eventOutputSchema,
+ async run({ auth, propsValue }) {
+ const id = shopifyGraphqlClient.toGid({ type: 'BasicEvent', id: propsValue.event_id });
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ event: GqlEvent | null;
+ }>({
+ auth,
+ query: `query GetEvent($id: ID!) { event(id: $id) { ${shopifyFields.EVENT_FIELDS} } }`,
+ variables: { id },
+ });
+ if (!data.event) {
+ throw new Error(`Event ${id} was not found.`);
+ }
+ return {
+ ...shopifyMappers.mapEvent(data.event),
+ redacted_fields: redactedFields,
+ };
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/get-market.ts b/packages/pieces/community/shopify/src/lib/actions/ai/get-market.ts
new file mode 100644
index 00000000000..1566214ce82
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/get-market.ts
@@ -0,0 +1,44 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import { shopifyGraphqlClient } from '../../common/graphql';
+import { GqlMarket, marketsFields, marketsMappers } from '../../common/markets';
+import { marketOutputSchema } from '../../output-schemas/markets';
+
+export const shopifyAiGetMarket = createAction({
+ auth: shopifyAuth,
+ name: 'get_market',
+ classification: 'READ',
+ displayName: 'Get Market',
+ description: 'Get one Shopify Market with its conditions, hierarchy, catalogs, currency and return policy.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Returns one Market in detail: status, type, the conditions that put a buyer in it (condition_types; up to 100 regions with codes; up to 50 retail locations, company locations and channels, each with an application level of SPECIFIED or ALL), parent_markets and child_markets (up to 50 each, with counts), currency settings (base currency, local currencies, rounding), tax- and duties-inclusive pricing, up to 10 catalogs with their price list (id, name, currency), up to 10 web presences with root URLs per locale, and its return policy profile with the return and edit rules. A *_truncated flag is true when Shopify has more than were returned. Parent and child markets are eventually consistent after a hierarchy change (compare relationships_version from list_market_relationships). Get the market id from list_markets. Needs the read_markets access scope; catalogs and price lists also need read_products, company locations read_companies, return policy read_legal_policies; parts the token cannot read are empty and listed in redacted_fields. Read-only.',
+ idempotent: true,
+ },
+ props: {
+ market_id: Property.ShortText({
+ displayName: 'Market ID',
+ description: 'The market id, numeric or "gid://shopify/Market/…". Find it with list_markets.',
+ required: true,
+ }),
+ },
+ outputSchema: marketOutputSchema,
+ async run({ auth, propsValue }) {
+ const id = shopifyGraphqlClient.toGid({ type: 'Market', id: propsValue.market_id });
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ market: GqlMarket | null;
+ }>({
+ auth,
+ query: `query GetMarket($id: ID!) { market(id: $id) { ${marketsFields.MARKET_DETAIL_FIELDS} } }`,
+ variables: { id },
+ });
+ if (!data.market) {
+ throw new Error(`Market ${id} was not found. Find market ids with list_markets.`);
+ }
+ return {
+ ...marketsMappers.mapMarketDetail(data.market),
+ redacted_fields: redactedFields,
+ };
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/get-marketing-event.ts b/packages/pieces/community/shopify/src/lib/actions/ai/get-marketing-event.ts
new file mode 100644
index 00000000000..3f273e5471f
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/get-marketing-event.ts
@@ -0,0 +1,48 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import {
+ GqlMarketingEvent,
+ shopifyFields,
+ shopifyGraphqlClient,
+ shopifyMappers,
+} from '../../common/graphql';
+import { marketingEventOutputSchema } from '../../output-schemas/store';
+
+export const shopifyAiGetMarketingEvent = createAction({
+ auth: shopifyAuth,
+ name: 'get_marketing_event',
+ classification: 'READ',
+ displayName: 'Get Marketing Event',
+ description: 'Get one marketing event by id.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Returns one marketing event: its tactic, channel, remote id, UTM values, start/end times, manage and preview URLs and the app it belongs to. Shopify documents marketing events as tied to the marketing app, so a custom-app token may only be able to read events it created itself (confirm on the store); another app\'s event can come back as not found. Find ids with list_marketing_events. Needs the read_marketing_events access scope. Read-only.',
+ idempotent: true,
+ },
+ props: {
+ marketing_event_id: Property.ShortText({
+ displayName: 'Marketing Event ID',
+ description: 'The marketing event id, numeric or "gid://shopify/MarketingEvent/…". Find it with list_marketing_events.',
+ required: true,
+ }),
+ },
+ outputSchema: marketingEventOutputSchema,
+ async run({ auth, propsValue }) {
+ const id = shopifyGraphqlClient.toGid({ type: 'MarketingEvent', id: propsValue.marketing_event_id });
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ marketingEvent: GqlMarketingEvent | null;
+ }>({
+ auth,
+ query: `query GetMarketingEvent($id: ID!) { marketingEvent(id: $id) { ${shopifyFields.MARKETING_EVENT_FIELDS} } }`,
+ variables: { id },
+ });
+ if (!data.marketingEvent) {
+ throw new Error(`Marketing event ${id} was not found, or it belongs to another app.`);
+ }
+ return {
+ ...shopifyMappers.mapMarketingEvent(data.marketingEvent),
+ redacted_fields: redactedFields,
+ };
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/get-return-policy-profile.ts b/packages/pieces/community/shopify/src/lib/actions/ai/get-return-policy-profile.ts
new file mode 100644
index 00000000000..b5b2e02ed6b
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/get-return-policy-profile.ts
@@ -0,0 +1,45 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import { shopifyGraphqlClient } from '../../common/graphql';
+import { GqlReturnPolicyProfile, marketsFields, marketsMappers } from '../../common/markets';
+import { returnPolicyProfileOutputSchema } from '../../output-schemas/markets';
+
+export const shopifyAiGetReturnPolicyProfile = createAction({
+ auth: shopifyAuth,
+ name: 'get_return_policy_profile',
+ classification: 'READ',
+ displayName: 'Get Return Policy Profile',
+ description: 'Get one return policy profile with its return and cancellation rules and markets.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Returns one return policy profile: name (empty for the default profile), is_default, updated_at, the return rules (return_rules_enabled; when false returns are unrestricted; can_accept_returns, return_window_days where -1 is unlimited, return_window_starting_from, extend_window_to_business_day), the edit/cancellation rules (edit_rules_enabled, can_accept_edits, edit_window_minutes where -1 means until fulfillment) and the markets it applies to. Get the id from list_return_policy_profiles, or from return_policy_profile_id in list_markets / get_market. Needs the read_legal_policies access scope; market names also need read_markets. Read-only.',
+ idempotent: true,
+ },
+ props: {
+ return_policy_profile_id: Property.ShortText({
+ displayName: 'Return Policy Profile ID',
+ description:
+ 'The profile id, numeric or "gid://shopify/ReturnPolicyProfile/…". Find it with list_return_policy_profiles or in a market\'s return_policy_profile_id.',
+ required: true,
+ }),
+ },
+ outputSchema: returnPolicyProfileOutputSchema,
+ async run({ auth, propsValue }) {
+ const id = shopifyGraphqlClient.toGid({ type: 'ReturnPolicyProfile', id: propsValue.return_policy_profile_id });
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ returnPolicyProfile: GqlReturnPolicyProfile | null;
+ }>({
+ auth,
+ query: `query GetReturnPolicyProfile($id: ID!) { returnPolicyProfile(id: $id) { ${marketsFields.RETURN_POLICY_PROFILE_FIELDS} } }`,
+ variables: { id },
+ });
+ if (!data.returnPolicyProfile) {
+ throw new Error(`Return policy profile ${id} was not found. Find ids with list_return_policy_profiles.`);
+ }
+ return {
+ ...marketsMappers.mapReturnPolicyProfile(data.returnPolicyProfile),
+ redacted_fields: redactedFields,
+ };
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/get-script-tag.ts b/packages/pieces/community/shopify/src/lib/actions/ai/get-script-tag.ts
new file mode 100644
index 00000000000..242420e70c2
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/get-script-tag.ts
@@ -0,0 +1,48 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import {
+ GqlScriptTag,
+ shopifyFields,
+ shopifyGraphqlClient,
+ shopifyMappers,
+} from '../../common/graphql';
+import { scriptTagOutputSchema } from '../../output-schemas/store';
+
+export const shopifyAiGetScriptTag = createAction({
+ auth: shopifyAuth,
+ name: 'get_script_tag',
+ classification: 'READ',
+ displayName: 'Get Script Tag',
+ description: 'Get one script tag.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Returns one script tag: the src URL of the JavaScript file the storefront loads, its display scope, cache flag and timestamps. Find ids with list_script_tags. Needs the read_script_tags access scope. Read-only.',
+ idempotent: true,
+ },
+ props: {
+ script_tag_id: Property.ShortText({
+ displayName: 'Script Tag ID',
+ description: 'The script tag id, numeric or "gid://shopify/ScriptTag/…". Find it with list_script_tags.',
+ required: true,
+ }),
+ },
+ outputSchema: scriptTagOutputSchema,
+ async run({ auth, propsValue }) {
+ const id = shopifyGraphqlClient.toGid({ type: 'ScriptTag', id: propsValue.script_tag_id });
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ scriptTag: GqlScriptTag | null;
+ }>({
+ auth,
+ query: `query GetScriptTag($id: ID!) { scriptTag(id: $id) { ${shopifyFields.SCRIPT_TAG_FIELDS} } }`,
+ variables: { id },
+ });
+ if (!data.scriptTag) {
+ throw new Error(`Script tag ${id} was not found.`);
+ }
+ return {
+ ...shopifyMappers.mapScriptTag(data.scriptTag),
+ redacted_fields: redactedFields,
+ };
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/get-shop-billing-preferences.ts b/packages/pieces/community/shopify/src/lib/actions/ai/get-shop-billing-preferences.ts
new file mode 100644
index 00000000000..fb6acd51734
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/get-shop-billing-preferences.ts
@@ -0,0 +1,32 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import { shopifyGraphqlClient } from '../../common/graphql';
+import { shopBillingPreferencesOutputSchema } from '../../output-schemas/store';
+
+export const shopifyAiGetShopBillingPreferences = createAction({
+ auth: shopifyAuth,
+ name: 'get_shop_billing_preferences',
+ classification: 'READ',
+ displayName: 'Get Shop Billing Currency',
+ description: 'Get the currency the merchant pays Shopify and apps in.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Returns the currency the merchant uses to pay for Shopify apps and services (their billing currency). This is not the currency customers pay in; for that use get_shop (currency_code) or list_enabled_currencies. No access scope needed. Read-only.',
+ idempotent: true,
+ },
+ props: {},
+ outputSchema: shopBillingPreferencesOutputSchema,
+ async run({ auth }) {
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ shopBillingPreferences: { currency?: string | null } | null;
+ }>({
+ auth,
+ query: `query GetShopBillingPreferences { shopBillingPreferences { currency } }`,
+ });
+ return {
+ billing_currency: data.shopBillingPreferences?.currency ?? null,
+ redacted_fields: redactedFields,
+ };
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/list-analytics-targets.ts b/packages/pieces/community/shopify/src/lib/actions/ai/list-analytics-targets.ts
new file mode 100644
index 00000000000..3f7a15546e9
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/list-analytics-targets.ts
@@ -0,0 +1,63 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import {
+ GqlConnection,
+ shopifyFields,
+ shopifyGraphqlClient,
+ shopifyMappers,
+ shopifyProps,
+ shopifyValues,
+} from '../../common/graphql';
+import { analyticsFields, analyticsMappers, GqlAnalyticsTarget } from '../../common/analytics';
+import { listAnalyticsTargetsOutputSchema } from '../../output-schemas/analytics';
+
+const MAX_PAGE_SIZE = 100;
+
+export const shopifyAiListAnalyticsTargets = createAction({
+ auth: shopifyAuth,
+ name: 'list_analytics_targets',
+ classification: 'SEARCH',
+ displayName: 'List Analytics Targets',
+ description: 'List and search the store\'s analytics targets (goals for a metric over a date range).',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists the store\'s analytics targets: merchant goals such as "total_sales of 50000 between 2026-01-01 and 2026-03-31". Use it to find a target id for update_analytics_target or delete_analytics_targets, or to check whether a target already exists before create_analytics_target. Each item has id (gid://shopify/AnalyticsTarget/…), name, metric, start_date, end_date, expected_value (exact decimal string), currency_code, filters (ShopifyQL filter expression or empty), shopifyql_query (a ShopifyQL query that returns the current value of the metric for the target, to compare progress) and timestamps. Filter with Shopify search syntax in query: "metric:total_sales", "name:Q1*", "start_date:>=2026-01-01", "end_date:<=2026-03-31", "filters:\\"shipping_country = \'US\'\\"". Paged: pass end_cursor back as the cursor while has_next_page is true. Needs the read_reports access scope. Read-only.',
+ idempotent: true,
+ },
+ props: {
+ query: shopifyProps.searchQuery(
+ 'Shopify search syntax, for example "metric:total_sales" or "start_date:>=2026-01-01 end_date:<=2026-12-31". Leave empty to list all.'
+ ),
+ sort_key: shopifyProps.staticChoice({
+ displayName: 'Sort By',
+ description: 'Field to sort by. Defaults to ID.',
+ required: false,
+ values: analyticsFields.ANALYTICS_TARGET_SORT_KEYS,
+ }),
+ reverse: shopifyProps.reverse(),
+ first: shopifyProps.first({ max: MAX_PAGE_SIZE }),
+ after: shopifyProps.after(),
+ },
+ outputSchema: listAnalyticsTargetsOutputSchema,
+ async run({ auth, propsValue }) {
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ analyticsTargets: GqlConnection<GqlAnalyticsTarget> | null;
+ }>({
+ auth,
+ query: `query ListAnalyticsTargets($first: Int!, $after: String, $reverse: Boolean, $sortKey: AnalyticsTargetSortKeys, $query: String) { analyticsTargets(first: $first, after: $after, reverse: $reverse, sortKey: $sortKey, query: $query) { nodes { ${analyticsFields.ANALYTICS_TARGET_FIELDS} } ${shopifyFields.PAGE_INFO_FIELDS} } }`,
+ variables: {
+ first: shopifyValues.readFirst({ value: propsValue.first, max: MAX_PAGE_SIZE }),
+ after: shopifyValues.nonEmpty(propsValue.after),
+ reverse: propsValue.reverse ?? false,
+ sortKey: shopifyValues.nonEmpty(propsValue.sort_key),
+ query: shopifyValues.nonEmpty(propsValue.query),
+ },
+ });
+ return shopifyMappers.toPage({
+ connection: data.analyticsTargets,
+ map: analyticsMappers.mapAnalyticsTarget,
+ redactedFields,
+ });
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/list-available-locales.ts b/packages/pieces/community/shopify/src/lib/actions/ai/list-available-locales.ts
new file mode 100644
index 00000000000..575fc94344c
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/list-available-locales.ts
@@ -0,0 +1,39 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import {
+ GqlLocale,
+ shopifyFields,
+ shopifyGraphqlClient,
+ shopifyMappers,
+} from '../../common/graphql';
+import { listAvailableLocalesOutputSchema } from '../../output-schemas/store';
+
+export const shopifyAiListAvailableLocales = createAction({
+ auth: shopifyAuth,
+ name: 'list_available_locales',
+ classification: 'SEARCH',
+ displayName: 'List Available Locales',
+ description: 'List every language locale Shopify supports.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists every locale Shopify supports (ISO code such as "fr" or "pt-BR" and its name). This is Shopify\'s full catalogue of languages a shop could enable, not the languages this shop has published. Returns the full list in one call (no paging). No access scope needed. Read-only.',
+ idempotent: true,
+ },
+ props: {},
+ outputSchema: listAvailableLocalesOutputSchema,
+ async run({ auth }) {
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ availableLocales: GqlLocale[] | null;
+ }>({
+ auth,
+ query: `query ListAvailableLocales { availableLocales { ${shopifyFields.LOCALE_FIELDS} } }`,
+ });
+ const items = (data.availableLocales ?? []).map(shopifyMappers.mapLocale);
+ return {
+ items,
+ count: items.length,
+ redacted_fields: redactedFields,
+ };
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/list-bulk-operations.ts b/packages/pieces/community/shopify/src/lib/actions/ai/list-bulk-operations.ts
new file mode 100644
index 00000000000..5e5c100471b
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/list-bulk-operations.ts
@@ -0,0 +1,99 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import {
+ GqlBulkOperation,
+ GqlConnection,
+ shopifyFields,
+ shopifyGraphqlClient,
+ shopifyMappers,
+ shopifyProps,
+ shopifyValues,
+} from '../../common/graphql';
+
+const MAX_PAGE_SIZE = 250;
+import { listBulkOperationsOutputSchema } from '../../output-schemas/store';
+
+export const shopifyAiListBulkOperations = createAction({
+ auth: shopifyAuth,
+ name: 'list_bulk_operations',
+ classification: 'SEARCH',
+ displayName: 'List Bulk Operations',
+ description: 'List this app\'s bulk queries and bulk mutations, newest first.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists the bulk operations this app token started (bulk queries and bulk mutations), newest first by default, with status, type, counts and result URLs. Use status RUNNING to see what is still in progress before starting another one (up to five of each type can run per shop at the same time from API version 2026-01). Optional filters: status, type, and extra Shopify search syntax such as "created_at:>2026-09-01". Paged: pass end_cursor back as the cursor while has_next_page is true. Read-only.',
+ idempotent: true,
+ },
+ props: {
+ status: Property.StaticDropdown({
+ displayName: 'Status',
+ description: 'Only operations in this state.',
+ required: false,
+ options: {
+ options: [
+ { label: 'Created', value: 'created' },
+ { label: 'Running', value: 'running' },
+ { label: 'Completed', value: 'completed' },
+ { label: 'Failed', value: 'failed' },
+ { label: 'Canceling', value: 'canceling' },
+ { label: 'Canceled', value: 'canceled' },
+ ],
+ },
+ }),
+ operation_type: Property.StaticDropdown({
+ displayName: 'Type',
+ description: 'Only bulk queries or only bulk mutations.',
+ required: false,
+ options: {
+ options: [
+ { label: 'Query', value: 'query' },
+ { label: 'Mutation', value: 'mutation' },
+ ],
+ },
+ }),
+ query: shopifyProps.searchQuery(
+ 'Extra Shopify search syntax, for example "created_at:>2026-09-01". Leave empty for no extra filter.'
+ ),
+ sort_key: Property.StaticDropdown({
+ displayName: 'Sort By',
+ description: 'Field to sort by. Defaults to the creation time.',
+ required: false,
+ options: {
+ options: [
+ { label: 'Created at', value: 'CREATED_AT' },
+ { label: 'Completed at', value: 'COMPLETED_AT' },
+ ],
+ },
+ }),
+ reverse: shopifyProps.reverse(),
+ first: shopifyProps.first({ max: MAX_PAGE_SIZE }),
+ after: shopifyProps.after(),
+ },
+ outputSchema: listBulkOperationsOutputSchema,
+ async run({ auth, propsValue }) {
+ const query = shopifyValues.joinSearch([
+ propsValue.status ? `status:${propsValue.status}` : undefined,
+ propsValue.operation_type ? `operation_type:${propsValue.operation_type}` : undefined,
+ shopifyValues.nonEmpty(propsValue.query),
+ ]);
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ bulkOperations: GqlConnection<GqlBulkOperation>;
+ }>({
+ auth,
+ query: `query ListBulkOperations($first: Int!, $after: String, $query: String, $sortKey: BulkOperationsSortKeys, $reverse: Boolean) { bulkOperations(first: $first, after: $after, query: $query, sortKey: $sortKey, reverse: $reverse) { nodes { ${shopifyFields.BULK_OPERATION_FIELDS} } ${shopifyFields.PAGE_INFO_FIELDS} } }`,
+ variables: {
+ first: shopifyValues.readFirst({ value: propsValue.first, max: MAX_PAGE_SIZE }),
+ after: shopifyValues.nonEmpty(propsValue.after),
+ query,
+ sortKey: propsValue.sort_key,
+ reverse: propsValue.reverse ?? false,
+ },
+ });
+ return shopifyMappers.toPage({
+ connection: data.bulkOperations,
+ map: shopifyMappers.mapBulkOperation,
+ redactedFields,
+ });
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/list-business-entities.ts b/packages/pieces/community/shopify/src/lib/actions/ai/list-business-entities.ts
new file mode 100644
index 00000000000..88ebcce26b9
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/list-business-entities.ts
@@ -0,0 +1,39 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import {
+ GqlBusinessEntity,
+ shopifyFields,
+ shopifyGraphqlClient,
+ shopifyMappers,
+} from '../../common/graphql';
+import { listBusinessEntitiesOutputSchema } from '../../output-schemas/store';
+
+export const shopifyAiListBusinessEntities = createAction({
+ auth: shopifyAuth,
+ name: 'list_business_entities',
+ classification: 'SEARCH',
+ displayName: 'List Business Entities',
+ description: 'List the legal entities the merchant operates the store through.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists the store\'s business entities: the legal entities the merchant trades through (every store has one primary entity; more exist when the merchant sells through several legal entities in different countries). Each has its id, display and company name, primary and archived flags, legal entity id and address. Entity ids are passed through exactly as returned (they are not always numeric), so hand them to get_business_entity unchanged. Returns the full list in one call (no paging). The required access scope is not documented; availability on every plan is to be confirmed. Read-only.',
+ idempotent: true,
+ },
+ props: {},
+ outputSchema: listBusinessEntitiesOutputSchema,
+ async run({ auth }) {
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ businessEntities: GqlBusinessEntity[] | null;
+ }>({
+ auth,
+ query: `query ListBusinessEntities { businessEntities { ${shopifyFields.BUSINESS_ENTITY_FIELDS} } }`,
+ });
+ const items = (data.businessEntities ?? []).map(shopifyMappers.mapBusinessEntity);
+ return {
+ items,
+ count: items.length,
+ redacted_fields: redactedFields,
+ };
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/list-catalogs.ts b/packages/pieces/community/shopify/src/lib/actions/ai/list-catalogs.ts
new file mode 100644
index 00000000000..ad7687a67c2
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/list-catalogs.ts
@@ -0,0 +1,84 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import {
+ GqlCatalog,
+ GqlConnection,
+ shopifyFields,
+ shopifyGraphqlClient,
+ shopifyMappers,
+ shopifyProps,
+ shopifyValues,
+} from '../../common/graphql';
+
+const MAX_PAGE_SIZE = 200;
+import { listCatalogsOutputSchema } from '../../output-schemas/store';
+
+export const shopifyAiListCatalogs = createAction({
+ auth: shopifyAuth,
+ name: 'list_catalogs',
+ classification: 'SEARCH',
+ displayName: 'List Catalogs',
+ description: 'List the store\'s catalogs (market, B2B company-location and app catalogs).',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists catalogs, which control which products are published and at what prices in a given context: market catalogs (per Markets market), company-location catalogs (B2B) and app catalogs. Each item has its type, title, status, price list (id, name, currency), publication id and, for market or company-location catalogs, how many markets or locations use it. Plan requirement: B2B company-location catalogs exist only on Shopify Plus stores, so on other plans expect only market catalogs or an empty list. Filter by type, or with Shopify search syntax such as "title:wholesale", "status:ACTIVE" or "market_id:123". Paged: pass end_cursor back as the cursor while has_next_page is true. The required access scope is not documented (read_products or read_markets expected). Read-only.',
+ idempotent: true,
+ },
+ props: {
+ type: Property.StaticDropdown({
+ displayName: 'Catalog Type',
+ description: 'Only catalogs of this type. Leave empty for all types.',
+ required: false,
+ options: {
+ options: [
+ { label: 'Market', value: 'MARKET' },
+ { label: 'Company location (B2B)', value: 'COMPANY_LOCATION' },
+ { label: 'App', value: 'APP' },
+ { label: 'None', value: 'NONE' },
+ ],
+ },
+ }),
+ query: shopifyProps.searchQuery(
+ 'Shopify catalog search syntax, for example "title:wholesale", "status:ACTIVE" or "company_id:123". Leave empty to list all.'
+ ),
+ sort_key: Property.StaticDropdown({
+ displayName: 'Sort By',
+ description: 'Field to sort by. Defaults to the id.',
+ required: false,
+ options: {
+ options: [
+ { label: 'ID', value: 'ID' },
+ { label: 'Title', value: 'TITLE' },
+ { label: 'Type', value: 'TYPE' },
+ { label: 'Relevance (with a query)', value: 'RELEVANCE' },
+ ],
+ },
+ }),
+ reverse: shopifyProps.reverse(),
+ first: shopifyProps.first({ max: MAX_PAGE_SIZE }),
+ after: shopifyProps.after(),
+ },
+ outputSchema: listCatalogsOutputSchema,
+ async run({ auth, propsValue }) {
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ catalogs: GqlConnection<GqlCatalog>;
+ }>({
+ auth,
+ query: `query ListCatalogs($first: Int!, $after: String, $type: CatalogType, $query: String, $sortKey: CatalogSortKeys, $reverse: Boolean) { catalogs(first: $first, after: $after, type: $type, query: $query, sortKey: $sortKey, reverse: $reverse) { nodes { ${shopifyFields.CATALOG_FIELDS} } ${shopifyFields.PAGE_INFO_FIELDS} } }`,
+ variables: {
+ first: shopifyValues.readFirst({ value: propsValue.first, max: MAX_PAGE_SIZE }),
+ after: shopifyValues.nonEmpty(propsValue.after),
+ type: propsValue.type,
+ query: shopifyValues.nonEmpty(propsValue.query),
+ sortKey: propsValue.sort_key,
+ reverse: propsValue.reverse ?? false,
+ },
+ });
+ return shopifyMappers.toPage({
+ connection: data.catalogs,
+ map: shopifyMappers.mapCatalog,
+ redactedFields,
+ });
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/list-consent-policies.ts b/packages/pieces/community/shopify/src/lib/actions/ai/list-consent-policies.ts
new file mode 100644
index 00000000000..9c4dfe0af89
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/list-consent-policies.ts
@@ -0,0 +1,83 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import {
+ GqlConsentPolicy,
+ shopifyFields,
+ shopifyGraphqlClient,
+ shopifyMappers,
+ shopifyProps,
+ shopifyValues,
+} from '../../common/graphql';
+import { listConsentPoliciesOutputSchema } from '../../output-schemas/store';
+
+export const shopifyAiListConsentPolicies = createAction({
+ auth: shopifyAuth,
+ name: 'list_consent_policies',
+ classification: 'SEARCH',
+ displayName: 'List Privacy Consent Policies',
+ description: 'List the store\'s customer privacy consent policies per country or region.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists the store\'s customer privacy consent policies: for each country (and optional region such as a US state), whether visitors must give consent before tracking and whether a data-sale opt-out is required. Optional filters: country_code, region_code (full ISO 3166-2 code such as "USCA"; a short one like "CA" is prefixed with country_code), consent_required, data_sale_opt_out_required, or one policy id. Returns every match in one call (no paging). Use list_consent_policy_regions for the countries and regions a policy can exist for. The read_privacy_settings access scope is expected (not stated on the query page; to be confirmed). Read-only.',
+ idempotent: true,
+ },
+ props: {
+ country_code: Property.ShortText({
+ displayName: 'Country Code',
+ description: 'Only policies for this two-letter country code, for example "US" or "DE".',
+ required: false,
+ }),
+ region_code: Property.ShortText({
+ displayName: 'Region Code',
+ description:
+ 'Only policies for this ISO 3166-2 region code, country prefix included, for example "USCA" for California. A short code such as "CA" is prefixed with the country code when one is given.',
+ required: false,
+ }),
+ consent_required: shopifyProps.booleanChoice({
+ displayName: 'Consent Required',
+ description: 'Yes returns only policies that require consent, No only those that do not. Leave empty for both.',
+ }),
+ data_sale_opt_out_required: shopifyProps.booleanChoice({
+ displayName: 'Data Sale Opt-Out Required',
+ description: 'Yes returns only policies that require a data-sale opt-out, No only those that do not. Leave empty for both.',
+ }),
+ policy_id: Property.ShortText({
+ displayName: 'Policy ID',
+ description: 'Only this policy, numeric or "gid://shopify/ConsentPolicy/…".',
+ required: false,
+ }),
+ },
+ outputSchema: listConsentPoliciesOutputSchema,
+ async run({ auth, propsValue }) {
+ const countryCode = shopifyValues.nonEmpty(propsValue.country_code)?.toUpperCase();
+ if (countryCode !== undefined && !/^[A-Z]{2}$/.test(countryCode)) {
+ throw new Error('country_code must be a two-letter code such as "US".');
+ }
+ const regionRaw = shopifyValues.nonEmpty(propsValue.region_code)?.toUpperCase().replace(/-/g, '');
+ const regionCode =
+ regionRaw !== undefined && countryCode !== undefined && regionRaw.length <= 3 && !regionRaw.startsWith(countryCode)
+ ? `${countryCode}${regionRaw}`
+ : regionRaw;
+ const policyId = shopifyValues.nonEmpty(propsValue.policy_id);
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ consentPolicy: GqlConsentPolicy[] | null;
+ }>({
+ auth,
+ query: `query ListConsentPolicies($id: ID, $countryCode: PrivacyCountryCode, $regionCode: String, $consentRequired: Boolean, $dataSaleOptOutRequired: Boolean) { consentPolicy(id: $id, countryCode: $countryCode, regionCode: $regionCode, consentRequired: $consentRequired, dataSaleOptOutRequired: $dataSaleOptOutRequired) { ${shopifyFields.CONSENT_POLICY_FIELDS} } }`,
+ variables: shopifyValues.compact({
+ id: policyId ? shopifyGraphqlClient.toGid({ type: 'ConsentPolicy', id: policyId }) : undefined,
+ countryCode,
+ regionCode,
+ consentRequired: shopifyValues.toBooleanChoice(propsValue.consent_required),
+ dataSaleOptOutRequired: shopifyValues.toBooleanChoice(propsValue.data_sale_opt_out_required),
+ }),
+ });
+ const items = (data.consentPolicy ?? []).map(shopifyMappers.mapConsentPolicy);
+ return {
+ items,
+ count: items.length,
+ redacted_fields: redactedFields,
+ };
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/list-consent-policy-regions.ts b/packages/pieces/community/shopify/src/lib/actions/ai/list-consent-policy-regions.ts
new file mode 100644
index 00000000000..3775f8b2947
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/list-consent-policy-regions.ts
@@ -0,0 +1,39 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import {
+ GqlConsentPolicyRegion,
+ shopifyFields,
+ shopifyGraphqlClient,
+ shopifyMappers,
+} from '../../common/graphql';
+import { listConsentPolicyRegionsOutputSchema } from '../../output-schemas/store';
+
+export const shopifyAiListConsentPolicyRegions = createAction({
+ auth: shopifyAuth,
+ name: 'list_consent_policy_regions',
+ classification: 'SEARCH',
+ displayName: 'List Consent Policy Regions',
+ description: 'List the countries and regions a privacy consent policy can be set for.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists the countries and regions (ISO 3166 country code plus optional region code) for which Shopify lets the store create or update a customer privacy consent policy. It does not say which policies exist; use list_consent_policies for that. Returns the full list in one call (no paging). The read_privacy_settings access scope is expected (not stated on the query page; to be confirmed). Read-only.',
+ idempotent: true,
+ },
+ props: {},
+ outputSchema: listConsentPolicyRegionsOutputSchema,
+ async run({ auth }) {
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ consentPolicyRegions: GqlConsentPolicyRegion[] | null;
+ }>({
+ auth,
+ query: `query ListConsentPolicyRegions { consentPolicyRegions { ${shopifyFields.CONSENT_POLICY_REGION_FIELDS} } }`,
+ });
+ const items = (data.consentPolicyRegions ?? []).map(shopifyMappers.mapConsentPolicyRegion);
+ return {
+ items,
+ count: items.length,
+ redacted_fields: redactedFields,
+ };
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/list-customer-account-pages.ts b/packages/pieces/community/shopify/src/lib/actions/ai/list-customer-account-pages.ts
new file mode 100644
index 00000000000..aaba712d5ac
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/list-customer-account-pages.ts
@@ -0,0 +1,52 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import {
+ GqlConnection,
+ GqlCustomerAccountPage,
+ shopifyFields,
+ shopifyGraphqlClient,
+ shopifyMappers,
+ shopifyProps,
+ shopifyValues,
+} from '../../common/graphql';
+
+const MAX_PAGE_SIZE = 250;
+import { listCustomerAccountPagesOutputSchema } from '../../output-schemas/store';
+
+export const shopifyAiListCustomerAccountPages = createAction({
+ auth: shopifyAuth,
+ name: 'list_customer_account_pages',
+ classification: 'SEARCH',
+ displayName: 'List Customer Account Pages',
+ description: 'List the pages of the store\'s customer account area.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists the pages of the store\'s customer accounts area: built-in pages (orders, profile, settings; page_kind CustomerAccountNativePage with a page_type) and pages added by app extensions (page_kind CustomerAccountAppExtensionPage), each with id, handle, title and default cursor. This belongs to the new customer accounts; a store still on classic accounts may return nothing. Paged: pass end_cursor back as the cursor while has_next_page is true. The required access scope is not documented. Read-only.',
+ idempotent: true,
+ },
+ props: {
+ reverse: shopifyProps.reverse(),
+ first: shopifyProps.first({ max: MAX_PAGE_SIZE }),
+ after: shopifyProps.after(),
+ },
+ outputSchema: listCustomerAccountPagesOutputSchema,
+ async run({ auth, propsValue }) {
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ customerAccountPages: GqlConnection<GqlCustomerAccountPage> | null;
+ }>({
+ auth,
+ query: `query ListCustomerAccountPages($first: Int!, $after: String, $reverse: Boolean) { customerAccountPages(first: $first, after: $after, reverse: $reverse) { nodes { ${shopifyFields.CUSTOMER_ACCOUNT_PAGE_FIELDS} } ${shopifyFields.PAGE_INFO_FIELDS} } }`,
+ variables: {
+ first: shopifyValues.readFirst({ value: propsValue.first, max: MAX_PAGE_SIZE }),
+ after: shopifyValues.nonEmpty(propsValue.after),
+ reverse: propsValue.reverse ?? false,
+ },
+ });
+ return shopifyMappers.toPage({
+ connection: data.customerAccountPages,
+ map: shopifyMappers.mapCustomerAccountPage,
+ redactedFields,
+ });
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/list-enabled-currencies.ts b/packages/pieces/community/shopify/src/lib/actions/ai/list-enabled-currencies.ts
new file mode 100644
index 00000000000..dc5f34c8111
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/list-enabled-currencies.ts
@@ -0,0 +1,59 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import {
+ GqlConnection,
+ GqlCurrencySetting,
+ shopifyFields,
+ shopifyGraphqlClient,
+ shopifyMappers,
+ shopifyProps,
+ shopifyValues,
+} from '../../common/graphql';
+import { listEnabledCurrenciesOutputSchema } from '../../output-schemas/store';
+
+const MAX_PAGE_SIZE = 250;
+
+export const shopifyAiListEnabledCurrencies = createAction({
+ auth: shopifyAuth,
+ name: 'list_enabled_currencies',
+ classification: 'SEARCH',
+ displayName: 'List Store Currencies',
+ description: 'List the currencies the store sells in, with manual exchange rates.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists the store\'s currency settings: each currency code and name, whether it is enabled for selling, and its manual exchange rate if the merchant set one (null means Shopify converts automatically). Also returns shop_currency_code, the currency the store reports in, and enabled_presentment_currencies, the currency codes customers can pay in. items can be empty on a store without multi-currency settings (for example without Shopify Payments); enabled_presentment_currencies still lists what customers can pay in, so do not read an empty items list as "no currencies". Paged: pass end_cursor back as the cursor while has_next_page is true. The required access scope is not documented (expected: none beyond the connection). Read-only.',
+ idempotent: true,
+ },
+ outputSchema: listEnabledCurrenciesOutputSchema,
+ props: {
+ first: shopifyProps.first({ max: MAX_PAGE_SIZE }),
+ after: shopifyProps.after(),
+ },
+ async run({ auth, propsValue }) {
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ shop: {
+ currencyCode?: string | null;
+ enabledPresentmentCurrencies?: string[] | null;
+ currencySettings: GqlConnection<GqlCurrencySetting> | null;
+ };
+ }>({
+ auth,
+ query: `query ListEnabledCurrencies($first: Int!, $after: String) { shop { currencyCode enabledPresentmentCurrencies currencySettings(first: $first, after: $after) { nodes { ${shopifyFields.CURRENCY_SETTING_FIELDS} } ${shopifyFields.PAGE_INFO_FIELDS} } } }`,
+ variables: {
+ first: shopifyValues.readFirst({ value: propsValue.first, max: MAX_PAGE_SIZE }),
+ after: shopifyValues.nonEmpty(propsValue.after),
+ },
+ primaryPaths: ['shop.currencySettings'],
+ });
+ return {
+ shop_currency_code: data.shop.currencyCode ?? null,
+ enabled_presentment_currencies: data.shop.enabledPresentmentCurrencies ?? [],
+ ...shopifyMappers.toPage({
+ connection: data.shop.currencySettings,
+ map: shopifyMappers.mapCurrencySetting,
+ redactedFields,
+ }),
+ };
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/list-events.ts b/packages/pieces/community/shopify/src/lib/actions/ai/list-events.ts
new file mode 100644
index 00000000000..17eb4bec71d
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/list-events.ts
@@ -0,0 +1,68 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import {
+ GqlConnection,
+ GqlEvent,
+ shopifyFields,
+ shopifyGraphqlClient,
+ shopifyMappers,
+ shopifyProps,
+ shopifyValues,
+} from '../../common/graphql';
+
+const MAX_PAGE_SIZE = 250;
+import { listEventsOutputSchema } from '../../output-schemas/store';
+
+export const shopifyAiListEvents = createAction({
+ auth: shopifyAuth,
+ name: 'list_events',
+ classification: 'SEARCH',
+ displayName: 'List Store Events',
+ description: 'List or search the store\'s activity log (who created, changed or deleted what).',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists store events, the activity log that records actions such as creating, updating, publishing or deleting products, orders, customers, collections, discounts, pages and blog content, plus staff timeline comments. Each event has its action, message, subject id and type (for basic events), the app that caused it and a timestamp. Filter with Shopify search syntax: "action:\'destroy\' AND subject_type:\'PRODUCT\'" finds deleted products, "created_at:>2026-09-01" limits the time, "comments:false" leaves out staff comments. No dedicated access scope is documented; the read scope of each subject type is expected to apply (for example read_products for product events; not yet confirmed on a store). Paged: pass end_cursor back as the cursor while has_next_page is true. Use count_events for a total. Read-only.',
+ idempotent: true,
+ },
+ props: {
+ query: shopifyProps.searchQuery(
+ 'Shopify event search syntax, for example "action:\'destroy\' AND subject_type:\'PRODUCT\'" or "created_at:>2026-09-01". Leave empty to list all.'
+ ),
+ sort_key: Property.StaticDropdown({
+ displayName: 'Sort By',
+ description: 'Field to sort by. Defaults to the id.',
+ required: false,
+ options: {
+ options: [
+ { label: 'ID', value: 'ID' },
+ { label: 'Created at', value: 'CREATED_AT' },
+ ],
+ },
+ }),
+ reverse: shopifyProps.reverse(),
+ first: shopifyProps.first({ max: MAX_PAGE_SIZE }),
+ after: shopifyProps.after(),
+ },
+ outputSchema: listEventsOutputSchema,
+ async run({ auth, propsValue }) {
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ events: GqlConnection<GqlEvent> | null;
+ }>({
+ auth,
+ query: `query ListEvents($first: Int!, $after: String, $query: String, $sortKey: EventSortKeys, $reverse: Boolean) { events(first: $first, after: $after, query: $query, sortKey: $sortKey, reverse: $reverse) { nodes { ${shopifyFields.EVENT_FIELDS} } ${shopifyFields.PAGE_INFO_FIELDS} } }`,
+ variables: {
+ first: shopifyValues.readFirst({ value: propsValue.first, max: MAX_PAGE_SIZE }),
+ after: shopifyValues.nonEmpty(propsValue.after),
+ query: shopifyValues.nonEmpty(propsValue.query),
+ sortKey: propsValue.sort_key,
+ reverse: propsValue.reverse ?? false,
+ },
+ });
+ return shopifyMappers.toPage({
+ connection: data.events,
+ map: shopifyMappers.mapEvent,
+ redactedFields,
+ });
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/list-market-relationships.ts b/packages/pieces/community/shopify/src/lib/actions/ai/list-market-relationships.ts
new file mode 100644
index 00000000000..3195ebd4149
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/list-market-relationships.ts
@@ -0,0 +1,56 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import {
+ GqlConnection,
+ shopifyFields,
+ shopifyGraphqlClient,
+ shopifyMappers,
+ shopifyProps,
+ shopifyValues,
+} from '../../common/graphql';
+import { GqlMarketRelationship, marketsFields, marketsMappers } from '../../common/markets';
+import { listMarketRelationshipsOutputSchema } from '../../output-schemas/markets';
+
+const MAX_PAGE_SIZE = 100;
+
+export const shopifyAiListMarketRelationships = createAction({
+ auth: shopifyAuth,
+ name: 'list_market_relationships',
+ classification: 'READ',
+ displayName: 'List Market Relationships',
+ description: 'List the parent/child links between the store\'s Markets.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists every parent/child link between the store\'s Markets in one flat list, so you can rebuild the whole market tree without calling get_market per market. Each item has the relationship id and the parent_market_id/name/handle and child_market_id/name/handle (parent fields can be empty). Shopify rebuilds these links in the background after a market, its conditions or its regions change, so right after such a change the list can still show the old hierarchy: relationships_version identifies the build that was read; read again later and compare it with a previous value to know whether the rebuild has landed. Market ids work with get_market. Paged: pass end_cursor back as the cursor while has_next_page is true; keep the same relationships_version across pages, and if it changes while paging, start over. Needs the read_markets access scope. Read-only.',
+ idempotent: true,
+ },
+ props: {
+ reverse: shopifyProps.reverse(),
+ first: shopifyProps.first({ max: MAX_PAGE_SIZE }),
+ after: shopifyProps.after(),
+ },
+ outputSchema: listMarketRelationshipsOutputSchema,
+ async run({ auth, propsValue }) {
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ marketRelationships: GqlConnection<GqlMarketRelationship> | null;
+ marketRelationshipsStatus: { version?: string | null } | null;
+ }>({
+ auth,
+ query: `query ListMarketRelationships($first: Int!, $after: String, $reverse: Boolean) { marketRelationshipsStatus { version } marketRelationships(first: $first, after: $after, reverse: $reverse) { nodes { ${marketsFields.MARKET_RELATIONSHIP_FIELDS} } ${shopifyFields.PAGE_INFO_FIELDS} } }`,
+ variables: {
+ first: shopifyValues.readFirst({ value: propsValue.first, max: MAX_PAGE_SIZE }),
+ after: shopifyValues.nonEmpty(propsValue.after),
+ reverse: propsValue.reverse ?? false,
+ },
+ });
+ return {
+ ...shopifyMappers.toPage({
+ connection: data.marketRelationships,
+ map: marketsMappers.mapMarketRelationship,
+ redactedFields,
+ }),
+ relationships_version: data.marketRelationshipsStatus?.version ?? null,
+ };
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/list-marketing-events.ts b/packages/pieces/community/shopify/src/lib/actions/ai/list-marketing-events.ts
new file mode 100644
index 00000000000..9ab0afd7c23
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/list-marketing-events.ts
@@ -0,0 +1,68 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import {
+ GqlConnection,
+ GqlMarketingEvent,
+ shopifyFields,
+ shopifyGraphqlClient,
+ shopifyMappers,
+ shopifyProps,
+ shopifyValues,
+} from '../../common/graphql';
+
+const MAX_PAGE_SIZE = 250;
+import { listMarketingEventsOutputSchema } from '../../output-schemas/store';
+
+export const shopifyAiListMarketingEvents = createAction({
+ auth: shopifyAuth,
+ name: 'list_marketing_events',
+ classification: 'SEARCH',
+ displayName: 'List Marketing Events',
+ description: 'List marketing events (campaigns, ads, emails) recorded on the store.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists marketing events: the campaigns, ads, emails and posts that marketing apps recorded on the store, each with its tactic, channel, UTM values, start/end times and the app it belongs to. Shopify documents this list as the events "associated with the marketing app", so a custom-app token may only see the events it created itself (for example with upsert_external_marketing_activity), not those of other marketing apps; an empty list does not prove the store runs no marketing. Filter with Shopify search syntax such as "type:AD", "started_at:>2026-01-01" or description:"<exact event description>" (the description filter matches the whole text only, not a word in it). Paged: pass end_cursor back as the cursor while has_next_page is true. Needs the read_marketing_events access scope. Read-only.',
+ idempotent: true,
+ },
+ props: {
+ query: shopifyProps.searchQuery(
+ 'Shopify marketing event search syntax, for example "type:AD", "app_id:123" or "started_at:>2026-01-01". Leave empty to list all.'
+ ),
+ sort_key: Property.StaticDropdown({
+ displayName: 'Sort By',
+ description: 'Field to sort by. Defaults to the id.',
+ required: false,
+ options: {
+ options: [
+ { label: 'ID', value: 'ID' },
+ { label: 'Start time', value: 'STARTED_AT' },
+ ],
+ },
+ }),
+ reverse: shopifyProps.reverse(),
+ first: shopifyProps.first({ max: MAX_PAGE_SIZE }),
+ after: shopifyProps.after(),
+ },
+ outputSchema: listMarketingEventsOutputSchema,
+ async run({ auth, propsValue }) {
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ marketingEvents: GqlConnection<GqlMarketingEvent>;
+ }>({
+ auth,
+ query: `query ListMarketingEvents($first: Int!, $after: String, $query: String, $sortKey: MarketingEventSortKeys, $reverse: Boolean) { marketingEvents(first: $first, after: $after, query: $query, sortKey: $sortKey, reverse: $reverse) { nodes { ${shopifyFields.MARKETING_EVENT_FIELDS} } ${shopifyFields.PAGE_INFO_FIELDS} } }`,
+ variables: {
+ first: shopifyValues.readFirst({ value: propsValue.first, max: MAX_PAGE_SIZE }),
+ after: shopifyValues.nonEmpty(propsValue.after),
+ query: shopifyValues.nonEmpty(propsValue.query),
+ sortKey: propsValue.sort_key,
+ reverse: propsValue.reverse ?? false,
+ },
+ });
+ return shopifyMappers.toPage({
+ connection: data.marketingEvents,
+ map: shopifyMappers.mapMarketingEvent,
+ redactedFields,
+ });
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/list-markets.ts b/packages/pieces/community/shopify/src/lib/actions/ai/list-markets.ts
new file mode 100644
index 00000000000..8e324639752
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/list-markets.ts
@@ -0,0 +1,70 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import {
+ GqlConnection,
+ shopifyFields,
+ shopifyGraphqlClient,
+ shopifyMappers,
+ shopifyProps,
+ shopifyValues,
+} from '../../common/graphql';
+import { GqlMarket, marketsFields, marketsMappers } from '../../common/markets';
+import { listMarketsOutputSchema } from '../../output-schemas/markets';
+
+const MAX_PAGE_SIZE = 15;
+
+export const shopifyAiListMarkets = createAction({
+ auth: shopifyAuth,
+ name: 'list_markets',
+ classification: 'SEARCH',
+ displayName: 'List Markets',
+ description: 'List and search the store\'s Shopify Markets with their hierarchy, regions, currency and return policy.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists the store\'s Markets (the buyer groups that get their own currency, prices, catalogs, domains and return policy). Use it to find a market id for get_market, to see which countries a market covers, or to see how markets nest. Each item has id (gid://shopify/Market/…), name, handle, status (ACTIVE or DRAFT), type (REGION, LOCATION, COMPANY_LOCATION, CHANNEL or NONE), condition_types, up to 10 regions with their country or subdivision code, up to 10 parent_markets and child_markets (id and name), return_policy_profile_id/name (pass to get_return_policy_profile), base_currency_code, local_currencies and up to 5 web_presences; each *_truncated flag is true when there are more, then call get_market for the full lists. Parent and child markets are eventually consistent after a hierarchy change (see list_market_relationships). Filter with type, or with Shopify search syntax in query: "status:ACTIVE", "name:Europe", "market_type:REGION", "market_condition_types:REGION". Paged: pass end_cursor back as the cursor while has_next_page is true. Needs the read_markets access scope; the return policy fields also need read_legal_policies and are listed in redacted_fields without it. Read-only.',
+ idempotent: true,
+ },
+ props: {
+ query: shopifyProps.searchQuery(
+ 'Shopify markets search syntax, for example "status:ACTIVE", "name:Europe" or "market_type:REGION". Leave empty to list all.'
+ ),
+ type: shopifyProps.staticChoice({
+ displayName: 'Market Type',
+ description: 'Only return markets of this type. Leave empty for all types.',
+ required: false,
+ values: marketsFields.MARKET_TYPES,
+ }),
+ sort_key: shopifyProps.staticChoice({
+ displayName: 'Sort By',
+ description: 'Field to sort by. Defaults to NAME.',
+ required: false,
+ values: marketsFields.MARKET_SORT_KEYS,
+ }),
+ reverse: shopifyProps.reverse(),
+ first: shopifyProps.first({ max: MAX_PAGE_SIZE }),
+ after: shopifyProps.after(),
+ },
+ outputSchema: listMarketsOutputSchema,
+ async run({ auth, propsValue }) {
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ markets: GqlConnection<GqlMarket> | null;
+ }>({
+ auth,
+ query: `query ListMarkets($first: Int!, $after: String, $reverse: Boolean, $sortKey: MarketsSortKeys, $query: String, $type: MarketType) { markets(first: $first, after: $after, reverse: $reverse, sortKey: $sortKey, query: $query, type: $type) { nodes { ${marketsFields.MARKET_SUMMARY_FIELDS} } ${shopifyFields.PAGE_INFO_FIELDS} } }`,
+ variables: {
+ first: shopifyValues.readFirst({ value: propsValue.first, max: MAX_PAGE_SIZE }),
+ after: shopifyValues.nonEmpty(propsValue.after),
+ reverse: propsValue.reverse ?? false,
+ sortKey: shopifyValues.nonEmpty(propsValue.sort_key),
+ query: shopifyValues.nonEmpty(propsValue.query),
+ type: shopifyValues.nonEmpty(propsValue.type),
+ },
+ });
+ return shopifyMappers.toPage({
+ connection: data.markets,
+ map: marketsMappers.mapMarketSummary,
+ redactedFields,
+ });
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/list-payment-disputes.ts b/packages/pieces/community/shopify/src/lib/actions/ai/list-payment-disputes.ts
new file mode 100644
index 00000000000..0661c76e82d
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/list-payment-disputes.ts
@@ -0,0 +1,56 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import {
+ GqlConnection,
+ GqlDispute,
+ shopifyFields,
+ shopifyGraphqlClient,
+ shopifyMappers,
+ shopifyProps,
+ shopifyValues,
+} from '../../common/graphql';
+import { listPaymentDisputesOutputSchema } from '../../output-schemas/store';
+
+const MAX_PAGE_SIZE = 200;
+
+export const shopifyAiListPaymentDisputes = createAction({
+ auth: shopifyAuth,
+ name: 'list_payment_disputes',
+ classification: 'SEARCH',
+ displayName: 'List Payment Disputes',
+ description: 'List Shopify Payments disputes (chargebacks and inquiries).',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists Shopify Payments disputes: chargebacks and inquiries that buyers filed with their card issuer, each with status (for example NEEDS_RESPONSE, UNDER_REVIEW, WON, LOST), type, reason, amount and currency, the evidence due date, when evidence was sent, and the order. Plan requirement: only stores that use Shopify Payments have disputes; on other stores, and on development stores using a test gateway, the list is empty. Filter with Shopify search syntax such as "status:needs_response" or "initiated_at:>2026-09-01". Paged: pass end_cursor back as the cursor while has_next_page is true. Needs the read_shopify_payments_disputes access scope. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: listPaymentDisputesOutputSchema,
+ props: {
+ query: shopifyProps.searchQuery(
+ 'Shopify dispute search syntax, for example "status:needs_response" or "initiated_at:>2026-09-01". Leave empty to list all.'
+ ),
+ reverse: shopifyProps.reverse(),
+ first: shopifyProps.first({ max: MAX_PAGE_SIZE }),
+ after: shopifyProps.after(),
+ },
+ async run({ auth, propsValue }) {
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ disputes: GqlConnection<GqlDispute>;
+ }>({
+ auth,
+ query: `query ListPaymentDisputes($first: Int!, $after: String, $query: String, $reverse: Boolean) { disputes(first: $first, after: $after, query: $query, reverse: $reverse) { nodes { ${shopifyFields.DISPUTE_FIELDS} } ${shopifyFields.PAGE_INFO_FIELDS} } }`,
+ variables: {
+ first: shopifyValues.readFirst({ value: propsValue.first, max: MAX_PAGE_SIZE }),
+ after: shopifyValues.nonEmpty(propsValue.after),
+ query: shopifyValues.nonEmpty(propsValue.query),
+ reverse: propsValue.reverse ?? false,
+ },
+ });
+ return shopifyMappers.toPage({
+ connection: data.disputes,
+ map: shopifyMappers.mapDispute,
+ redactedFields,
+ });
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/list-payment-terms-templates.ts b/packages/pieces/community/shopify/src/lib/actions/ai/list-payment-terms-templates.ts
new file mode 100644
index 00000000000..9420aa24aa9
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/list-payment-terms-templates.ts
@@ -0,0 +1,54 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import {
+ GqlPaymentTermsTemplate,
+ shopifyFields,
+ shopifyGraphqlClient,
+ shopifyMappers,
+} from '../../common/graphql';
+import { listPaymentTermsTemplatesOutputSchema } from '../../output-schemas/store';
+
+export const shopifyAiListPaymentTermsTemplates = createAction({
+ auth: shopifyAuth,
+ name: 'list_payment_terms_templates',
+ classification: 'SEARCH',
+ displayName: 'List Payment Terms Templates',
+ description: 'List the payment terms Shopify offers (due on receipt, net 30, fixed date…).',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists the payment terms templates Shopify offers for orders and draft orders that are paid later: due on receipt, due on fulfillment, net terms (for example Net 30 with due_in_days 30) and a fixed date. Each has an id, name, translated name, description, due_in_days and type. Optionally only one type. Returns the full list in one call (no paging). Needs the read_payment_terms access scope (not stated on the query page; to be confirmed). Read-only.',
+ idempotent: true,
+ },
+ props: {
+ payment_terms_type: Property.StaticDropdown({
+ displayName: 'Terms Type',
+ description: 'Only templates of this type. Leave empty for all.',
+ required: false,
+ options: {
+ options: [
+ { label: 'Due on receipt', value: 'RECEIPT' },
+ { label: 'Net (within a number of days)', value: 'NET' },
+ { label: 'Fixed date', value: 'FIXED' },
+ { label: 'Due on fulfillment', value: 'FULFILLMENT' },
+ ],
+ },
+ }),
+ },
+ outputSchema: listPaymentTermsTemplatesOutputSchema,
+ async run({ auth, propsValue }) {
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ paymentTermsTemplates: GqlPaymentTermsTemplate[] | null;
+ }>({
+ auth,
+ query: `query ListPaymentTermsTemplates($paymentTermsType: PaymentTermsType) { paymentTermsTemplates(paymentTermsType: $paymentTermsType) { ${shopifyFields.PAYMENT_TERMS_TEMPLATE_FIELDS} } }`,
+ variables: { paymentTermsType: propsValue.payment_terms_type },
+ });
+ const items = (data.paymentTermsTemplates ?? []).map(shopifyMappers.mapPaymentTermsTemplate);
+ return {
+ items,
+ count: items.length,
+ redacted_fields: redactedFields,
+ };
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/list-return-policy-profiles.ts b/packages/pieces/community/shopify/src/lib/actions/ai/list-return-policy-profiles.ts
new file mode 100644
index 00000000000..de7c7099587
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/list-return-policy-profiles.ts
@@ -0,0 +1,57 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import {
+ GqlConnection,
+ shopifyFields,
+ shopifyGraphqlClient,
+ shopifyMappers,
+ shopifyProps,
+ shopifyValues,
+} from '../../common/graphql';
+import { GqlReturnPolicyProfile, marketsFields, marketsMappers } from '../../common/markets';
+import { listReturnPolicyProfilesOutputSchema } from '../../output-schemas/markets';
+
+const MAX_PAGE_SIZE = 25;
+
+export const shopifyAiListReturnPolicyProfiles = createAction({
+ auth: shopifyAuth,
+ name: 'list_return_policy_profiles',
+ classification: 'SEARCH',
+ displayName: 'List Return Policy Profiles',
+ description: 'List the store\'s return policy profiles with their return and cancellation rules and markets.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists the store\'s return policy profiles: the default profile (is_default true, name empty) and any market-specific ones. Use it to answer "what is the return window in market X" or "which markets use a custom return policy". Each item has id (for get_return_policy_profile), name, is_default, updated_at, the return rules (return_rules_enabled; when false returns are unrestricted; can_accept_returns, return_window_days where -1 is unlimited, return_window_starting_from, extend_window_to_business_day), the edit/cancellation rules (edit_rules_enabled, can_accept_edits, edit_window_minutes where -1 means until fulfillment) and the markets it applies to (id, name, handle; ids work with get_market). Set default to Yes for only the default profile or No for only the custom ones. Paged: pass end_cursor back as the cursor while has_next_page is true. Needs the read_legal_policies access scope; the market names also need read_markets and are listed in redacted_fields without it. Read-only.',
+ idempotent: true,
+ },
+ props: {
+ default: shopifyProps.booleanChoice({
+ displayName: 'Default Profile Only',
+ description: 'Yes returns only the default profile, No only the custom profiles. Leave empty for all.',
+ }),
+ reverse: shopifyProps.reverse(),
+ first: shopifyProps.first({ max: MAX_PAGE_SIZE }),
+ after: shopifyProps.after(),
+ },
+ outputSchema: listReturnPolicyProfilesOutputSchema,
+ async run({ auth, propsValue }) {
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ returnPolicyProfiles: GqlConnection<GqlReturnPolicyProfile> | null;
+ }>({
+ auth,
+ query: `query ListReturnPolicyProfiles($first: Int!, $after: String, $reverse: Boolean, $default: Boolean) { returnPolicyProfiles(first: $first, after: $after, reverse: $reverse, default: $default) { nodes { ${marketsFields.RETURN_POLICY_PROFILE_FIELDS} } ${shopifyFields.PAGE_INFO_FIELDS} } }`,
+ variables: {
+ first: shopifyValues.readFirst({ value: propsValue.first, max: MAX_PAGE_SIZE }),
+ after: shopifyValues.nonEmpty(propsValue.after),
+ reverse: propsValue.reverse ?? false,
+ default: shopifyValues.toBooleanChoice(propsValue.default),
+ },
+ });
+ return shopifyMappers.toPage({
+ connection: data.returnPolicyProfiles,
+ map: marketsMappers.mapReturnPolicyProfile,
+ redactedFields,
+ });
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/list-saved-searches.ts b/packages/pieces/community/shopify/src/lib/actions/ai/list-saved-searches.ts
new file mode 100644
index 00000000000..79fc9215cbc
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/list-saved-searches.ts
@@ -0,0 +1,77 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import {
+ GqlConnection,
+ GqlSavedSearch,
+ shopifyFields,
+ shopifyGraphqlClient,
+ shopifyMappers,
+ shopifyProps,
+ shopifyValues,
+} from '../../common/graphql';
+
+const MAX_PAGE_SIZE = 250;
+
+const SAVED_SEARCH_ROOTS: Record<string, { label: string; root: string }> = {
+ ORDER: { label: 'Orders (read_orders)', root: 'orderSavedSearches' },
+ DRAFT_ORDER: { label: 'Draft orders (read_draft_orders)', root: 'draftOrderSavedSearches' },
+ PRODUCT: { label: 'Products (read_products)', root: 'productSavedSearches' },
+ COLLECTION: { label: 'Collections (read_products)', root: 'collectionSavedSearches' },
+ FILE: { label: 'Files (read_files or read_themes)', root: 'fileSavedSearches' },
+ URL_REDIRECT: { label: 'URL redirects (read_online_store_navigation)', root: 'urlRedirectSavedSearches' },
+ CODE_DISCOUNT: { label: 'Code discounts', root: 'codeDiscountSavedSearches' },
+ AUTOMATIC_DISCOUNT: { label: 'Automatic discounts', root: 'automaticDiscountSavedSearches' },
+ DISCOUNT_REDEEM_CODE: { label: 'Discount redeem codes (read_discounts)', root: 'discountRedeemCodeSavedSearches' },
+};
+import { listSavedSearchesOutputSchema } from '../../output-schemas/store';
+
+export const shopifyAiListSavedSearches = createAction({
+ auth: shopifyAuth,
+ name: 'list_saved_searches',
+ classification: 'SEARCH',
+ displayName: 'List Saved Searches',
+ description: 'List the saved admin searches (saved filter views) of one resource type.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists the saved searches of one admin resource list: the named filter views staff saved in the Shopify admin (for example "Unfulfilled orders over $100" on the orders list). Each item has id (what delete_saved_search takes), name, query (the full filter string), search_terms and resource_type. resource_type is required and picks the list: ORDER, DRAFT_ORDER, PRODUCT, COLLECTION, FILE, URL_REDIRECT, CODE_DISCOUNT, AUTOMATIC_DISCOUNT or DISCOUNT_REDEEM_CODE. Customer saved searches are not listed because Shopify replaced them with customer segments. Needs the read scope of that resource: read_orders, read_draft_orders, read_products (products and collections), read_files or read_themes (files), read_online_store_navigation (URL redirects) or read_discounts (redeem codes); for code and automatic discounts read_discounts is expected (not stated on the query pages; to be confirmed). Paged: pass end_cursor back as the cursor while has_next_page is true. Read-only.',
+ idempotent: true,
+ },
+ props: {
+ resource_type: Property.StaticDropdown({
+ displayName: 'Resource Type',
+ description: 'Which admin list the saved searches belong to.',
+ required: true,
+ options: {
+ options: Object.entries(SAVED_SEARCH_ROOTS).map(([value, entry]) => ({ label: entry.label, value })),
+ },
+ }),
+ reverse: shopifyProps.reverse(),
+ first: shopifyProps.first({ max: MAX_PAGE_SIZE }),
+ after: shopifyProps.after(),
+ },
+ outputSchema: listSavedSearchesOutputSchema,
+ async run({ auth, propsValue }) {
+ const resourceType = shopifyValues.nonEmpty(propsValue.resource_type)?.toUpperCase();
+ const entry = resourceType ? SAVED_SEARCH_ROOTS[resourceType] : undefined;
+ if (!resourceType || !entry) {
+ throw new Error(`resource_type must be one of ${Object.keys(SAVED_SEARCH_ROOTS).join(', ')}.`);
+ }
+ const { data, redactedFields } = await shopifyGraphqlClient.request<
+ Record<string, GqlConnection<GqlSavedSearch> | null>
+ >({
+ auth,
+ query: `query ListSavedSearches($first: Int!, $after: String, $reverse: Boolean) { ${entry.root}(first: $first, after: $after, reverse: $reverse) { nodes { ${shopifyFields.SAVED_SEARCH_FIELDS} } ${shopifyFields.PAGE_INFO_FIELDS} } }`,
+ variables: {
+ first: shopifyValues.readFirst({ value: propsValue.first, max: MAX_PAGE_SIZE }),
+ after: shopifyValues.nonEmpty(propsValue.after),
+ reverse: propsValue.reverse ?? false,
+ },
+ });
+ return shopifyMappers.toPage({
+ connection: data[entry.root],
+ map: shopifyMappers.mapSavedSearch,
+ redactedFields,
+ });
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/list-script-tags.ts b/packages/pieces/community/shopify/src/lib/actions/ai/list-script-tags.ts
new file mode 100644
index 00000000000..3cbeb9d1712
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/list-script-tags.ts
@@ -0,0 +1,62 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import {
+ GqlConnection,
+ GqlScriptTag,
+ shopifyFields,
+ shopifyGraphqlClient,
+ shopifyMappers,
+ shopifyProps,
+ shopifyValues,
+} from '../../common/graphql';
+
+const MAX_PAGE_SIZE = 250;
+import { listScriptTagsOutputSchema } from '../../output-schemas/store';
+
+export const shopifyAiListScriptTags = createAction({
+ auth: shopifyAuth,
+ name: 'list_script_tags',
+ classification: 'SEARCH',
+ displayName: 'List Script Tags',
+ description: 'List the script tags that load JavaScript on the online store.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists script tags: remote JavaScript files that the storefront loads on every page of a vintage (non-Online Store 2.0) theme, each with its src URL, display scope and cache flag. Script tags are a legacy surface; themes built on Online Store 2.0 ignore them. Filter by exact script URL with src, or with Shopify search syntax such as "src:https://cdn.example.com/widget.js" or "created_at:>2026-01-01". Paged: pass end_cursor back as the cursor while has_next_page is true. Needs the read_script_tags access scope. Read-only.',
+ idempotent: true,
+ },
+ props: {
+ src: Property.ShortText({
+ displayName: 'Script URL',
+ description: 'Only return script tags with exactly this src URL, for example "https://cdn.example.com/widget.js".',
+ required: false,
+ }),
+ query: shopifyProps.searchQuery(
+ 'Shopify script tag search syntax, for example "created_at:>2026-01-01" or "id:>=1000". Leave empty to list all.'
+ ),
+ reverse: shopifyProps.reverse(),
+ first: shopifyProps.first({ max: MAX_PAGE_SIZE }),
+ after: shopifyProps.after(),
+ },
+ outputSchema: listScriptTagsOutputSchema,
+ async run({ auth, propsValue }) {
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ scriptTags: GqlConnection<GqlScriptTag>;
+ }>({
+ auth,
+ query: `query ListScriptTags($first: Int!, $after: String, $query: String, $src: URL, $reverse: Boolean) { scriptTags(first: $first, after: $after, query: $query, src: $src, reverse: $reverse) { nodes { ${shopifyFields.SCRIPT_TAG_FIELDS} } ${shopifyFields.PAGE_INFO_FIELDS} } }`,
+ variables: {
+ first: shopifyValues.readFirst({ value: propsValue.first, max: MAX_PAGE_SIZE }),
+ after: shopifyValues.nonEmpty(propsValue.after),
+ query: shopifyValues.nonEmpty(propsValue.query),
+ src: shopifyValues.nonEmpty(propsValue.src),
+ reverse: propsValue.reverse ?? false,
+ },
+ });
+ return shopifyMappers.toPage({
+ connection: data.scriptTags,
+ map: shopifyMappers.mapScriptTag,
+ redactedFields,
+ });
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/list-shop-pay-payment-request-receipts.ts b/packages/pieces/community/shopify/src/lib/actions/ai/list-shop-pay-payment-request-receipts.ts
new file mode 100644
index 00000000000..575c67c1544
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/list-shop-pay-payment-request-receipts.ts
@@ -0,0 +1,68 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import {
+ GqlConnection,
+ GqlShopPayReceipt,
+ shopifyFields,
+ shopifyGraphqlClient,
+ shopifyMappers,
+ shopifyProps,
+ shopifyValues,
+} from '../../common/graphql';
+import { listShopPayPaymentRequestReceiptsOutputSchema } from '../../output-schemas/store';
+
+const MAX_PAGE_SIZE = 110;
+
+export const shopifyAiListShopPayPaymentRequestReceipts = createAction({
+ auth: shopifyAuth,
+ name: 'list_shop_pay_payment_request_receipts',
+ classification: 'SEARCH',
+ displayName: 'List Shop Pay Payment Receipts',
+ description: 'List Shop Pay payment request receipts.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists Shop Pay payment request receipts: one per Shop Pay payment request a buyer completed, with its token, your source identifier, creation time, processing state (READY, PROCESSING, COMPLETED, FAILED, ACTION_REQUIRED) with any error, the resulting order and the request totals in the presentment currency. Plan requirement: only stores that take payments through Shopify Payments with Shop Pay payment requests (API 2026-01 and later) have receipts; elsewhere the list is empty. Filter with Shopify search syntax such as "state:COMPLETED", "source_identifier:1282823" or "created_at:>2026-09-01". Paged: pass end_cursor back as the cursor while has_next_page is true. The required access scope is not documented. Read-only.',
+ idempotent: true,
+ },
+ outputSchema: listShopPayPaymentRequestReceiptsOutputSchema,
+ props: {
+ query: shopifyProps.searchQuery(
+ 'Shopify receipt search syntax, for example "state:COMPLETED" or "created_at:>2026-09-01". Leave empty to list all.'
+ ),
+ sort_key: Property.StaticDropdown({
+ displayName: 'Sort By',
+ description: 'Field to sort by. Defaults to the id.',
+ required: false,
+ options: {
+ options: [
+ { label: 'ID', value: 'ID' },
+ { label: 'Created at', value: 'CREATED_AT' },
+ ],
+ },
+ }),
+ reverse: shopifyProps.reverse(),
+ first: shopifyProps.first({ max: MAX_PAGE_SIZE }),
+ after: shopifyProps.after(),
+ },
+ async run({ auth, propsValue }) {
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ shopPayPaymentRequestReceipts: GqlConnection<GqlShopPayReceipt> | null;
+ }>({
+ auth,
+ query: `query ListShopPayPaymentRequestReceipts($first: Int!, $after: String, $query: String, $sortKey: ShopPayPaymentRequestReceiptsSortKeys, $reverse: Boolean) { shopPayPaymentRequestReceipts(first: $first, after: $after, query: $query, sortKey: $sortKey, reverse: $reverse) { nodes { ${shopifyFields.SHOP_PAY_RECEIPT_FIELDS} } ${shopifyFields.PAGE_INFO_FIELDS} } }`,
+ variables: {
+ first: shopifyValues.readFirst({ value: propsValue.first, max: MAX_PAGE_SIZE }),
+ after: shopifyValues.nonEmpty(propsValue.after),
+ query: shopifyValues.nonEmpty(propsValue.query),
+ sortKey: propsValue.sort_key,
+ reverse: propsValue.reverse ?? false,
+ },
+ });
+ return shopifyMappers.toPage({
+ connection: data.shopPayPaymentRequestReceipts,
+ map: shopifyMappers.mapShopPayReceipt,
+ redactedFields,
+ });
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/list-shop-policies.ts b/packages/pieces/community/shopify/src/lib/actions/ai/list-shop-policies.ts
new file mode 100644
index 00000000000..aca0eaa8c16
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/list-shop-policies.ts
@@ -0,0 +1,40 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import {
+ GqlShopPolicy,
+ shopifyFields,
+ shopifyGraphqlClient,
+ shopifyMappers,
+} from '../../common/graphql';
+import { listShopPoliciesOutputSchema } from '../../output-schemas/store';
+
+export const shopifyAiListShopPolicies = createAction({
+ auth: shopifyAuth,
+ name: 'list_shop_policies',
+ classification: 'SEARCH',
+ displayName: 'List Store Policies',
+ description: 'List the store\'s legal policies (refund, shipping, privacy, terms).',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists the store\'s legal policies (refund, shipping, privacy, terms of service, terms of sale, legal notice, subscription, contact information) with their type, title, public URL and full HTML body. Policies the merchant never filled in may be missing from the list. Returns the full list in one call (no paging). Needs the read_legal_policies access scope. Read-only.',
+ idempotent: true,
+ },
+ props: {},
+ outputSchema: listShopPoliciesOutputSchema,
+ async run({ auth }) {
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ shop: { shopPolicies: GqlShopPolicy[] | null };
+ }>({
+ auth,
+ query: `query ListShopPolicies { shop { shopPolicies { ${shopifyFields.SHOP_POLICY_FIELDS} } } }`,
+ primaryPaths: ['shop.shopPolicies'],
+ });
+ const items = (data.shop.shopPolicies ?? []).map(shopifyMappers.mapShopPolicy);
+ return {
+ items,
+ count: items.length,
+ redacted_fields: redactedFields,
+ };
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/list-web-presences.ts b/packages/pieces/community/shopify/src/lib/actions/ai/list-web-presences.ts
new file mode 100644
index 00000000000..5aa12973f92
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/list-web-presences.ts
@@ -0,0 +1,52 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import {
+ GqlConnection,
+ GqlWebPresence,
+ shopifyFields,
+ shopifyGraphqlClient,
+ shopifyMappers,
+ shopifyProps,
+ shopifyValues,
+} from '../../common/graphql';
+
+const MAX_PAGE_SIZE = 60;
+import { listWebPresencesOutputSchema } from '../../output-schemas/store';
+
+export const shopifyAiListWebPresences = createAction({
+ auth: shopifyAuth,
+ name: 'list_web_presences',
+ classification: 'SEARCH',
+ displayName: 'List Markets Web Presences',
+ description: 'List the store\'s Markets web presences (the domains and subfolders markets are sold through).',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Lists the store\'s Markets web presences: the domains or subfolders (for example example.com/fr-ca) through which markets\' shoppers reach the storefront. Each item has id (what delete_web_presence takes), kind ("domain" or "subfolder"), subfolder_suffix (for example "fr-ca", empty for a domain presence), domain_id / domain_host / domain_url (empty for a subfolder presence, which has no domain of its own), default_locale and root_urls (the storefront URL per language). A store that does not use Markets with extra domains or subfolders may return only its primary domain presence or nothing. Paged: pass end_cursor back as the cursor while has_next_page is true. Needs the read_markets access scope. Read-only.',
+ idempotent: true,
+ },
+ props: {
+ reverse: shopifyProps.reverse(),
+ first: shopifyProps.first({ max: MAX_PAGE_SIZE }),
+ after: shopifyProps.after(),
+ },
+ outputSchema: listWebPresencesOutputSchema,
+ async run({ auth, propsValue }) {
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ webPresences: GqlConnection<GqlWebPresence> | null;
+ }>({
+ auth,
+ query: `query ListWebPresences($first: Int!, $after: String, $reverse: Boolean) { webPresences(first: $first, after: $after, reverse: $reverse) { nodes { ${shopifyFields.WEB_PRESENCE_FIELDS} } ${shopifyFields.PAGE_INFO_FIELDS} } }`,
+ variables: {
+ first: shopifyValues.readFirst({ value: propsValue.first, max: MAX_PAGE_SIZE }),
+ after: shopifyValues.nonEmpty(propsValue.after),
+ reverse: propsValue.reverse ?? false,
+ },
+ });
+ return shopifyMappers.toPage({
+ connection: data.webPresences,
+ map: shopifyMappers.mapWebPresence,
+ redactedFields,
+ });
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/start-bulk-mutation.ts b/packages/pieces/community/shopify/src/lib/actions/ai/start-bulk-mutation.ts
new file mode 100644
index 00000000000..2a061be8d21
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/start-bulk-mutation.ts
@@ -0,0 +1,173 @@
+import { randomUUID } from 'crypto';
+import { HttpError, HttpMethod, httpClient } from '@activepieces/pieces-common';
+import { createAction, Property, tryCatch } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import {
+ GqlBulkOperation,
+ GqlStagedTarget,
+ shopifyFields,
+ shopifyGraphqlClient,
+ shopifyMappers,
+ shopifyValues,
+} from '../../common/graphql';
+
+const JSONL_FILENAME = 'bulk_op_vars.jsonl';
+const JSONL_MIME_TYPE = 'text/jsonl';
+const STAGED_PATH_PARAMETER = 'key';
+const MAX_UPLOAD_ERROR_BODY = 500;
+import { startBulkMutationOutputSchema } from '../../output-schemas/store';
+
+export const shopifyAiStartBulkMutation = createAction({
+ auth: shopifyAuth,
+ name: 'start_bulk_mutation',
+ classification: 'WRITE',
+ displayName: 'Start Bulk Mutation',
+ description: 'Run one GraphQL mutation many times in the background, once per variables object.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Starts a Shopify bulk mutation operation that runs the given GraphQL mutation once for every object in variables (for example create or update thousands of products), and returns only the operation (bulk_operation_id and status). In one call it uploads the variables as a JSONL file to Shopify\'s staged upload storage and then starts the operation, so there is nothing else to upload. Poll get_bulk_operation with the id until status is COMPLETED, then download the JSONL result file from its url (one line per input line, including any userErrors per line). The mutation must be a single mutation that takes its input from variables, and it needs the access scopes it would need normally. These are real writes applied in bulk and a started operation cannot be undone, only stopped early with cancel_bulk_operation (lines already processed stay applied), so confirm the mutation and the number of lines with the user first. From API version 2026-01 each app can run up to five bulk mutations per shop at the same time. Each call starts another operation and would apply every line again, so never repeat it after a success.',
+ idempotent: false,
+ },
+ props: {
+ mutation: Property.LongText({
+ displayName: 'Mutation',
+ description:
+ 'One GraphQL Admin mutation that reads its input from variables, for example "mutation call($product: ProductCreateInput!) { productCreate(product: $product) { product { id title } userErrors { field message } } }".',
+ required: true,
+ }),
+ variables: Property.Json({
+ displayName: 'Variables per Execution',
+ description:
+ 'A JSON array with one object per execution; each object holds the variables for one run of the mutation, for example [{"product": {"title": "Sweater"}}, {"product": {"title": "Scarf"}}].',
+ required: true,
+ }),
+ client_identifier: Property.ShortText({
+ displayName: 'Client Identifier',
+ description: 'Optional label of your own to recognise the operation later.',
+ required: false,
+ }),
+ },
+ outputSchema: startBulkMutationOutputSchema,
+ async run({ auth, propsValue }) {
+ const mutation = shopifyValues.nonEmpty(propsValue.mutation);
+ if (!mutation || !/^\s*mutation\b/i.test(mutation)) {
+ throw new Error('mutation must be a GraphQL mutation document starting with "mutation". Nothing was started.');
+ }
+ const lines = readVariableLines(propsValue.variables);
+ const staged = await shopifyGraphqlClient.request<{
+ stagedUploadsCreate: { stagedTargets?: GqlStagedTarget[] | null } | null;
+ }>({
+ auth,
+ query: `mutation StageBulkMutationVariables($input: [StagedUploadInput!]!) { stagedUploadsCreate(input: $input) { stagedTargets { url resourceUrl parameters { name value } } userErrors { field message } } }`,
+ variables: {
+ input: [
+ {
+ resource: 'BULK_MUTATION_VARIABLES',
+ filename: JSONL_FILENAME,
+ mimeType: JSONL_MIME_TYPE,
+ httpMethod: 'POST',
+ },
+ ],
+ },
+ });
+ const target = staged.data.stagedUploadsCreate?.stagedTargets?.[0];
+ const uploadUrl = target?.url;
+ const parameters = target?.parameters ?? [];
+ const stagedUploadPath = parameters.find((parameter) => parameter.name === STAGED_PATH_PARAMETER)?.value;
+ if (!uploadUrl || !stagedUploadPath) {
+ throw new Error('Shopify did not return a staged upload target for the variables file. Nothing was started.');
+ }
+ const multipart = buildMultipart({
+ fields: parameters,
+ fileContent: lines.join('\n'),
+ });
+ const upload = await tryCatch(() =>
+ httpClient.sendRequest({
+ method: HttpMethod.POST,
+ url: uploadUrl,
+ headers: { 'Content-Type': multipart.contentType },
+ body: multipart.body,
+ responseType: 'text',
+ })
+ );
+ if (upload.error) {
+ throw new Error(`Uploading the variables file to Shopify's staged storage failed: ${describeUploadError(upload.error)}. Nothing was started.`);
+ }
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ bulkOperationRunMutation: { bulkOperation: GqlBulkOperation | null } | null;
+ }>({
+ auth,
+ query: `mutation StartBulkMutation($mutation: String!, $stagedUploadPath: String!, $clientIdentifier: String) { bulkOperationRunMutation(mutation: $mutation, stagedUploadPath: $stagedUploadPath, clientIdentifier: $clientIdentifier) { bulkOperation { ${shopifyFields.BULK_OPERATION_FIELDS} } userErrors { field message code } } }`,
+ variables: {
+ mutation,
+ stagedUploadPath,
+ clientIdentifier: shopifyValues.nonEmpty(propsValue.client_identifier),
+ },
+ });
+ const operation = data.bulkOperationRunMutation?.bulkOperation;
+ if (!operation) {
+ throw new Error('Shopify did not return the bulk operation.');
+ }
+ return {
+ bulk_operation_id: operation.id,
+ ...shopifyMappers.mapBulkOperation(operation),
+ line_count: lines.length,
+ staged_upload_path: stagedUploadPath,
+ redacted_fields: [...staged.redactedFields, ...redactedFields],
+ };
+ },
+});
+
+function describeUploadError(error: Error): string {
+ if (!(error instanceof HttpError)) {
+ return error.message;
+ }
+ const body = error.response.body;
+ const text = typeof body === 'string' ? body : JSON.stringify(body ?? '');
+ const detail = text.length > MAX_UPLOAD_ERROR_BODY ? `${text.slice(0, MAX_UPLOAD_ERROR_BODY)}…` : text;
+ return `the storage host returned HTTP ${error.response.status}: ${detail}`;
+}
+
+function readVariableLines(value: unknown): string[] {
+ const list = Array.isArray(value) ? value : readJsonArray(value);
+ if (!list || list.length === 0) {
+ throw new Error('variables must be a JSON array with at least one object, one per execution. Nothing was started.');
+ }
+ return list.map((item, index) => {
+ if (!shopifyValues.isRecord(item)) {
+ throw new Error(`variables[${index}] must be an object of mutation variables. Nothing was started.`);
+ }
+ return JSON.stringify(item);
+ });
+}
+
+function readJsonArray(value: unknown): unknown[] | undefined {
+ if (typeof value !== 'string' || !value.trim().startsWith('[')) {
+ return undefined;
+ }
+ try {
+ const parsed: unknown = JSON.parse(value);
+ return Array.isArray(parsed) ? parsed : undefined;
+ } catch {
+ return undefined;
+ }
+}
+
+function buildMultipart({
+ fields,
+ fileContent,
+}: {
+ fields: { name: string; value: string }[];
+ fileContent: string;
+}): { body: Buffer; contentType: string } {
+ const boundary = `----ShopifyBulkUpload${randomUUID().replace(/-/g, '')}`;
+ const fieldParts = fields.map(
+ (field) => `--${boundary}\r\nContent-Disposition: form-data; name="${field.name}"\r\n\r\n${field.value}\r\n`
+ );
+ const filePart = `--${boundary}\r\nContent-Disposition: form-data; name="file"; filename="${JSONL_FILENAME}"\r\nContent-Type: ${JSONL_MIME_TYPE}\r\n\r\n${fileContent}\r\n--${boundary}--\r\n`;
+ return {
+ body: Buffer.from([...fieldParts, filePart].join(''), 'utf8'),
+ contentType: `multipart/form-data; boundary=${boundary}`,
+ };
+}
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/start-bulk-query.ts b/packages/pieces/community/shopify/src/lib/actions/ai/start-bulk-query.ts
new file mode 100644
index 00000000000..a7ab63ec403
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/start-bulk-query.ts
@@ -0,0 +1,58 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import {
+ GqlBulkOperation,
+ shopifyFields,
+ shopifyGraphqlClient,
+ shopifyMappers,
+ shopifyValues,
+} from '../../common/graphql';
+import { startBulkQueryOutputSchema } from '../../output-schemas/store';
+
+export const shopifyAiStartBulkQuery = createAction({
+ auth: shopifyAuth,
+ name: 'start_bulk_query',
+ classification: 'SEARCH',
+ displayName: 'Start Bulk Export Query',
+ description: 'Start a background bulk query that exports a large dataset to a JSONL file.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Starts a Shopify bulk query operation that runs the given GraphQL query in the background over the whole dataset (no paging; the background run does not count against the API rate limit) and returns only the operation (bulk_operation_id and status). Poll get_bulk_operation with that id until status is COMPLETED, then download the JSONL file from its url; the file is kept for seven days. Use it for exports too large for the list actions. The query must contain at least one connection field (for example products or orders), supports up to five connections and a nesting depth of two, and is written without first/after arguments on those connections; it needs the same access scopes as running it normally. From API version 2026-01 each app can run up to five bulk queries per shop at the same time; above that Shopify refuses until one finishes (cancel one with cancel_bulk_operation). Each call starts another operation, so do not repeat it while the first one runs. Read-only for store data.',
+ idempotent: false,
+ },
+ props: {
+ query: Property.LongText({
+ displayName: 'Bulk Query',
+ description:
+ 'A GraphQL Admin query without paging arguments, for example "{ products { edges { node { id title variants { edges { node { id sku } } } } } } }".',
+ required: true,
+ }),
+ },
+ outputSchema: startBulkQueryOutputSchema,
+ async run({ auth, propsValue }) {
+ const query = shopifyValues.nonEmpty(propsValue.query);
+ if (!query) {
+ throw new Error('query is required. Nothing was started.');
+ }
+ if (/^\s*mutation\b/i.test(query)) {
+ throw new Error('query must be a read query; use start_bulk_mutation to run a mutation in bulk. Nothing was started.');
+ }
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ bulkOperationRunQuery: { bulkOperation: GqlBulkOperation | null } | null;
+ }>({
+ auth,
+ query: `mutation StartBulkQuery($query: String!) { bulkOperationRunQuery(query: $query) { bulkOperation { ${shopifyFields.BULK_OPERATION_FIELDS} } userErrors { field message code } } }`,
+ variables: { query },
+ });
+ const operation = data.bulkOperationRunQuery?.bulkOperation;
+ if (!operation) {
+ throw new Error('Shopify did not return the bulk operation.');
+ }
+ return {
+ bulk_operation_id: operation.id,
+ ...shopifyMappers.mapBulkOperation(operation),
+ redacted_fields: redactedFields,
+ };
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/update-analytics-annotation.ts b/packages/pieces/community/shopify/src/lib/actions/ai/update-analytics-annotation.ts
new file mode 100644
index 00000000000..ad2e774a2b4
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/update-analytics-annotation.ts
@@ -0,0 +1,122 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import { shopifyGraphqlClient, shopifyProps, shopifyValues } from '../../common/graphql';
+import {
+ analyticsFields,
+ analyticsMappers,
+ analyticsValues,
+ GqlAnalyticsAnnotation,
+} from '../../common/analytics';
+import { analyticsAnnotationOutputSchema } from '../../output-schemas/analytics';
+
+export const shopifyAiUpdateAnalyticsAnnotation = createAction({
+ auth: shopifyAuth,
+ name: 'update_analytics_annotation',
+ classification: 'WRITE',
+ displayName: 'Update Analytics Annotation',
+ description: 'Change the type, title, description or dates of an analytics annotation this app created.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Changes one analytics annotation and returns it; every field you leave empty keeps its value. Pass the id returned by create_analytics_annotation (there is no action to list annotations). Only annotations this app created can be changed; any other id, or one already deleted, fails with NOT_FOUND. type must be one of the types apps may set; title at most 75 characters, description at most 150 (clear_description removes it). started_at/ended_at are ISO 8601 date-times with a time zone; make_open_ended removes the end so the event shows as still running (use ended_at to close it again). Repeating the same update leaves the same state. Needs the write_analytics_annotations access scope.',
+ idempotent: true,
+ },
+ props: {
+ annotation_id: Property.ShortText({
+ displayName: 'Analytics Annotation ID',
+ description:
+ 'The annotation id, numeric or "gid://shopify/AnalyticsAnnotation/…", as returned by create_analytics_annotation.',
+ required: true,
+ }),
+ type: shopifyProps.staticChoice({
+ displayName: 'Type',
+ description: 'New kind of event. Leave empty to keep it.',
+ required: false,
+ values: analyticsFields.ANALYTICS_ANNOTATION_TYPES,
+ }),
+ title: Property.ShortText({
+ displayName: 'Title',
+ description: 'New chart marker text, at most 75 characters. Leave empty to keep it.',
+ required: false,
+ }),
+ description: Property.LongText({
+ displayName: 'Description',
+ description: 'New plain-text context, at most 150 characters. Leave empty to keep it.',
+ required: false,
+ }),
+ clear_description: Property.Checkbox({
+ displayName: 'Clear Description',
+ description: 'Remove the description. Do not combine with Description.',
+ required: false,
+ defaultValue: false,
+ }),
+ started_at: Property.ShortText({
+ displayName: 'Started At',
+ description: 'New start, ISO 8601 with a time zone, for example 2026-11-28T00:00:00Z. Leave empty to keep it.',
+ required: false,
+ }),
+ ended_at: Property.ShortText({
+ displayName: 'Ended At',
+ description: 'New end, ISO 8601 with a time zone. Leave empty to keep it.',
+ required: false,
+ }),
+ make_open_ended: Property.Checkbox({
+ displayName: 'Make Open-Ended',
+ description: 'Remove the end so the event shows as still running. Do not combine with Ended At.',
+ required: false,
+ defaultValue: false,
+ }),
+ },
+ outputSchema: analyticsAnnotationOutputSchema,
+ async run({ auth, propsValue }) {
+ const startedAt = analyticsValues.readDateTime({ value: propsValue.started_at, label: 'started_at' });
+ const endedAt = shopifyValues.clearableValue({
+ value: analyticsValues.readDateTime({ value: propsValue.ended_at, label: 'ended_at' }),
+ clear: propsValue.make_open_ended,
+ valueName: 'ended_at',
+ clearName: 'make_open_ended',
+ });
+ analyticsValues.checkDateTimeOrder({ startedAt, endedAt: endedAt ?? undefined });
+ const input = shopifyValues.compact({
+ type: analyticsValues.readAnnotationType(propsValue.type),
+ title: analyticsValues.readBoundedText({
+ value: propsValue.title,
+ label: 'title',
+ max: analyticsFields.ANNOTATION_TITLE_MAX,
+ }),
+ description: shopifyValues.clearableValue({
+ value: analyticsValues.readBoundedText({
+ value: propsValue.description,
+ label: 'description',
+ max: analyticsFields.ANNOTATION_DESCRIPTION_MAX,
+ }),
+ clear: propsValue.clear_description,
+ valueName: 'description',
+ clearName: 'clear_description',
+ }),
+ startedAt,
+ endedAt,
+ });
+ if (Object.keys(input).length === 0) {
+ throw new Error(
+ 'Nothing to update: provide type, title, description, clear_description, started_at, ended_at or make_open_ended. Nothing was changed.'
+ );
+ }
+ const id = shopifyGraphqlClient.toGid({ type: 'AnalyticsAnnotation', id: propsValue.annotation_id });
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ analyticsAnnotationUpdate: { analyticsAnnotation: GqlAnalyticsAnnotation | null } | null;
+ }>({
+ auth,
+ query: `mutation UpdateAnalyticsAnnotation($id: ID!, $input: AnalyticsAnnotationUpdateInput!) { analyticsAnnotationUpdate(id: $id, input: $input) { analyticsAnnotation { ${analyticsFields.ANALYTICS_ANNOTATION_FIELDS} } userErrors { field message code } } }`,
+ variables: { id, input },
+ });
+ const annotation = data.analyticsAnnotationUpdate?.analyticsAnnotation;
+ if (!annotation) {
+ throw new Error('Shopify did not return the updated analytics annotation.');
+ }
+ return {
+ ...analyticsMappers.mapAnalyticsAnnotation(annotation),
+ redacted_fields: redactedFields,
+ };
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/update-analytics-target.ts b/packages/pieces/community/shopify/src/lib/actions/ai/update-analytics-target.ts
new file mode 100644
index 00000000000..97ae13b2ead
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/update-analytics-target.ts
@@ -0,0 +1,107 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import { shopifyGraphqlClient, shopifyValues } from '../../common/graphql';
+import {
+ analyticsFields,
+ analyticsMappers,
+ analyticsValues,
+ GqlAnalyticsTarget,
+} from '../../common/analytics';
+import { analyticsTargetOutputSchema } from '../../output-schemas/analytics';
+
+export const shopifyAiUpdateAnalyticsTarget = createAction({
+ auth: shopifyAuth,
+ name: 'update_analytics_target',
+ classification: 'WRITE',
+ displayName: 'Update Analytics Target',
+ description: 'Change the name, metric, dates, goal value or filters of an analytics target.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Changes one analytics target and returns it; every field you leave empty keeps its value. Use it to raise or lower a goal (expected_value, greater than 0), rename it, move its period (start_date/end_date as YYYY-MM-DD) or change its metric or ShopifyQL filters (for example shipping_country = \'US\'). Set clear_filters to make it track the whole store again. Shopify keeps targets unique by metric + start_date + end_date + filters and answers TAKEN when the change would collide with another target. Get the target id from list_analytics_targets or create_analytics_target. Repeating the same update leaves the same state. Needs the write_reports access scope.',
+ idempotent: true,
+ },
+ props: {
+ target_id: Property.ShortText({
+ displayName: 'Analytics Target ID',
+ description: 'The target id, numeric or "gid://shopify/AnalyticsTarget/…". Find it with list_analytics_targets.',
+ required: true,
+ }),
+ name: Property.ShortText({
+ displayName: 'Name',
+ description: 'New label for the target. Leave empty to keep it.',
+ required: false,
+ }),
+ metric: Property.ShortText({
+ displayName: 'Metric',
+ description: 'New ShopifyQL metric identifier, for example total_sales or orders. Leave empty to keep it.',
+ required: false,
+ }),
+ start_date: Property.ShortText({
+ displayName: 'Start Date',
+ description: 'New first day of the period, YYYY-MM-DD. Leave empty to keep it.',
+ required: false,
+ }),
+ end_date: Property.ShortText({
+ displayName: 'End Date',
+ description: 'New last day of the period, YYYY-MM-DD. Leave empty to keep it.',
+ required: false,
+ }),
+ expected_value: Property.Number({
+ displayName: 'Expected Value',
+ description: 'New goal value, greater than 0. Leave empty to keep it.',
+ required: false,
+ }),
+ filters: Property.ShortText({
+ displayName: 'Filters',
+ description: 'New ShopifyQL filter expression, for example shipping_country = \'US\'. Leave empty to keep the current filters.',
+ required: false,
+ }),
+ clear_filters: Property.Checkbox({
+ displayName: 'Clear Filters',
+ description: 'Remove the filters so the target tracks the whole store. Do not combine with Filters.',
+ required: false,
+ defaultValue: false,
+ }),
+ },
+ outputSchema: analyticsTargetOutputSchema,
+ async run({ auth, propsValue }) {
+ const startDate = shopifyValues.readIsoDate(propsValue.start_date);
+ const endDate = shopifyValues.readIsoDate(propsValue.end_date);
+ analyticsValues.checkDateOrder({ start: startDate, end: endDate });
+ const input = shopifyValues.compact({
+ name: shopifyValues.nonEmpty(propsValue.name),
+ metric: analyticsValues.readMetric(propsValue.metric),
+ startDate,
+ endDate,
+ expectedValue: analyticsValues.readExpectedValue(propsValue.expected_value),
+ filters: shopifyValues.clearableValue({
+ value: shopifyValues.nonEmpty(propsValue.filters),
+ clear: propsValue.clear_filters,
+ valueName: 'filters',
+ clearName: 'clear_filters',
+ }),
+ });
+ if (Object.keys(input).length === 0) {
+ throw new Error(
+ 'Nothing to update: provide name, metric, start_date, end_date, expected_value, filters or clear_filters. Nothing was changed.'
+ );
+ }
+ const id = shopifyGraphqlClient.toGid({ type: 'AnalyticsTarget', id: propsValue.target_id });
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ analyticsTargetUpdate: { analyticsTarget: GqlAnalyticsTarget | null } | null;
+ }>({
+ auth,
+ query: `mutation UpdateAnalyticsTarget($id: ID!, $input: AnalyticsTargetUpdateInput!) { analyticsTargetUpdate(id: $id, input: $input) { analyticsTarget { ${analyticsFields.ANALYTICS_TARGET_FIELDS} } userErrors { field message code } } }`,
+ variables: { id, input },
+ });
+ const target = data.analyticsTargetUpdate?.analyticsTarget;
+ if (!target) {
+ throw new Error('Shopify did not return the updated analytics target.');
+ }
+ return {
+ ...analyticsMappers.mapAnalyticsTarget(target),
+ redacted_fields: redactedFields,
+ };
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/update-external-marketing-activity.ts b/packages/pieces/community/shopify/src/lib/actions/ai/update-external-marketing-activity.ts
new file mode 100644
index 00000000000..20f3e1a94a9
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/update-external-marketing-activity.ts
@@ -0,0 +1,210 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import {
+ GqlMarketingActivity,
+ shopifyFields,
+ shopifyGraphqlClient,
+ shopifyMappers,
+ shopifyProps,
+ shopifyValues,
+} from '../../common/graphql';
+import { marketingActivityOutputSchema } from '../../output-schemas/store';
+
+export const shopifyAiUpdateExternalMarketingActivity = createAction({
+ auth: shopifyAuth,
+ name: 'update_external_marketing_activity',
+ classification: 'WRITE',
+ displayName: 'Update External Marketing Activity',
+ description: 'Change some fields of an external marketing activity.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Changes only the fields you send on one external marketing activity and returns it; fields you leave empty keep their value (unlike upsert_external_marketing_activity, which replaces the whole activity). Identify the activity by exactly one of: marketing_activity_id, remote_id, or the three UTM values it was created with. UTM values, the URL parameter, the channel handle, the parent and the hierarchy level cannot be changed here. Repeating the same update leaves the same state. Needs the write_marketing_events access scope.',
+ idempotent: true,
+ },
+ props: {
+ marketing_activity_id: Property.ShortText({
+ displayName: 'Marketing Activity ID',
+ description: 'The activity id, numeric or "gid://shopify/MarketingActivity/…". Use this, the remote id, or the UTM values.',
+ required: false,
+ }),
+ remote_id: Property.ShortText({
+ displayName: 'Remote ID',
+ description: 'Your own id the activity was created with, for example "fb-campaign-2026-spring".',
+ required: false,
+ }),
+ utm_campaign: Property.ShortText({
+ displayName: 'UTM Campaign (to find the activity)',
+ description: 'utm_campaign the activity was created with. Set all three UTM values to identify the activity by them.',
+ required: false,
+ }),
+ utm_source: Property.ShortText({
+ displayName: 'UTM Source (to find the activity)',
+ description: 'utm_source the activity was created with.',
+ required: false,
+ }),
+ utm_medium: Property.ShortText({
+ displayName: 'UTM Medium (to find the activity)',
+ description: 'utm_medium the activity was created with.',
+ required: false,
+ }),
+ title: Property.ShortText({
+ displayName: 'Title',
+ description: 'New title.',
+ required: false,
+ }),
+ status: shopifyProps.staticChoice({
+ displayName: 'Status',
+ description: 'New state of the activity on the external platform.',
+ required: false,
+ values: shopifyFields.MARKETING_EXTERNAL_STATUSES,
+ }),
+ tactic: shopifyProps.staticChoice({
+ displayName: 'Tactic',
+ description: 'New tactic. An activity cannot be changed to or from STOREFRONT_APP.',
+ required: false,
+ values: shopifyFields.MARKETING_TACTICS,
+ }),
+ marketing_channel_type: shopifyProps.staticChoice({
+ displayName: 'Channel Type',
+ description: 'New channel type.',
+ required: false,
+ values: shopifyFields.MARKETING_CHANNELS,
+ }),
+ remote_url: Property.ShortText({
+ displayName: 'Remote URL',
+ description: 'New URL where the merchant manages the activity.',
+ required: false,
+ }),
+ remote_preview_image_url: Property.ShortText({
+ displayName: 'Preview Image URL',
+ description: 'New public preview image URL.',
+ required: false,
+ }),
+ referring_domain: Property.ShortText({
+ displayName: 'Referring Domain',
+ description: 'New referring domain, for example "facebook.com".',
+ required: false,
+ }),
+ budget_type: shopifyProps.staticChoice({
+ displayName: 'Budget Type',
+ description: 'DAILY or LIFETIME. Set together with the budget amount; the pair replaces the stored budget.',
+ required: false,
+ values: shopifyFields.MARKETING_BUDGET_TYPES,
+ }),
+ budget_amount: Property.Number({
+ displayName: 'Budget Amount',
+ description: 'New budget total, in the currency below.',
+ required: false,
+ }),
+ ad_spend_amount: Property.Number({
+ displayName: 'Ad Spend',
+ description: 'New total spent so far, in the currency below.',
+ required: false,
+ }),
+ currency: Property.ShortText({
+ displayName: 'Currency',
+ description: 'ISO currency code of the budget and ad spend, for example "USD". Needed when either is set.',
+ required: false,
+ }),
+ scheduled_start: Property.DateTime({
+ displayName: 'Scheduled Start',
+ description: 'New planned start time, ISO 8601.',
+ required: false,
+ }),
+ scheduled_end: Property.DateTime({
+ displayName: 'Scheduled End',
+ description: 'New planned end time, ISO 8601.',
+ required: false,
+ }),
+ start: Property.DateTime({
+ displayName: 'Actual Start',
+ description: 'When the activity really started, ISO 8601.',
+ required: false,
+ }),
+ end: Property.DateTime({
+ displayName: 'Actual End',
+ description: 'When the activity really ended, ISO 8601.',
+ required: false,
+ }),
+ },
+ outputSchema: marketingActivityOutputSchema,
+ async run({ auth, propsValue }) {
+ const budgetTotal = shopifyValues.buildMoneyInput({
+ amount: propsValue.budget_amount,
+ currency: propsValue.currency,
+ label: 'budget_amount',
+ });
+ if ((budgetTotal === undefined) !== (propsValue.budget_type === undefined || propsValue.budget_type === null)) {
+ throw new Error('Set budget_type and budget_amount together, or neither. Nothing was changed.');
+ }
+ const input = shopifyValues.compact({
+ title: shopifyValues.nonEmpty(propsValue.title),
+ status: propsValue.status ?? undefined,
+ tactic: propsValue.tactic ?? undefined,
+ marketingChannelType: propsValue.marketing_channel_type ?? undefined,
+ remoteUrl: shopifyValues.nonEmpty(propsValue.remote_url),
+ remotePreviewImageUrl: shopifyValues.nonEmpty(propsValue.remote_preview_image_url),
+ referringDomain: shopifyValues.nonEmpty(propsValue.referring_domain),
+ budget: budgetTotal ? { budgetType: propsValue.budget_type, total: budgetTotal } : undefined,
+ adSpend: shopifyValues.buildMoneyInput({
+ amount: propsValue.ad_spend_amount,
+ currency: propsValue.currency,
+ label: 'ad_spend_amount',
+ }),
+ scheduledStart: shopifyValues.nonEmpty(propsValue.scheduled_start),
+ scheduledEnd: shopifyValues.nonEmpty(propsValue.scheduled_end),
+ start: shopifyValues.nonEmpty(propsValue.start),
+ end: shopifyValues.nonEmpty(propsValue.end),
+ });
+ if (Object.keys(input).length === 0) {
+ throw new Error('Nothing to update: provide at least one field to change. Nothing was changed.');
+ }
+ const target = readTarget({
+ marketingActivityId: propsValue.marketing_activity_id,
+ remoteId: propsValue.remote_id,
+ utmCampaign: propsValue.utm_campaign,
+ utmSource: propsValue.utm_source,
+ utmMedium: propsValue.utm_medium,
+ });
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ marketingActivityUpdateExternal: { marketingActivity: GqlMarketingActivity | null } | null;
+ }>({
+ auth,
+ query: `mutation UpdateExternalMarketingActivity($input: MarketingActivityUpdateExternalInput!, $marketingActivityId: ID, $remoteId: String, $utm: UTMInput) { marketingActivityUpdateExternal(input: $input, marketingActivityId: $marketingActivityId, remoteId: $remoteId, utm: $utm) { marketingActivity { ${shopifyFields.MARKETING_ACTIVITY_FIELDS} } userErrors { field message code } } }`,
+ variables: { input, ...target },
+ });
+ const activity = data.marketingActivityUpdateExternal?.marketingActivity;
+ if (!activity) {
+ throw new Error('Shopify did not return the updated marketing activity.');
+ }
+ return {
+ ...shopifyMappers.mapMarketingActivity(activity),
+ redacted_fields: redactedFields,
+ };
+ },
+});
+
+function readTarget({
+ marketingActivityId,
+ remoteId,
+ utmCampaign,
+ utmSource,
+ utmMedium,
+}: {
+ marketingActivityId: string | undefined | null;
+ remoteId: string | undefined | null;
+ utmCampaign: string | undefined | null;
+ utmSource: string | undefined | null;
+ utmMedium: string | undefined | null;
+}): { marketingActivityId?: string; remoteId?: string; utm?: { campaign: string; source: string; medium: string } } {
+ const utm = shopifyValues.buildUtm({ campaign: utmCampaign, source: utmSource, medium: utmMedium });
+ const hasId = shopifyValues.nonEmpty(marketingActivityId) !== undefined || shopifyValues.nonEmpty(remoteId) !== undefined;
+ if (utm && hasId) {
+ throw new Error('Identify the activity by exactly one of marketing_activity_id, remote_id or the UTM values. Nothing was changed.');
+ }
+ if (utm) {
+ return { utm };
+ }
+ return shopifyValues.readMarketingActivityTarget({ marketingActivityId, remoteId });
+}
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/update-script-tag.ts b/packages/pieces/community/shopify/src/lib/actions/ai/update-script-tag.ts
new file mode 100644
index 00000000000..8a8924151bb
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/update-script-tag.ts
@@ -0,0 +1,71 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import {
+ GqlScriptTag,
+ shopifyFields,
+ shopifyGraphqlClient,
+ shopifyMappers,
+ shopifyProps,
+ shopifyValues,
+} from '../../common/graphql';
+import { scriptTagOutputSchema } from '../../output-schemas/store';
+
+export const shopifyAiUpdateScriptTag = createAction({
+ auth: shopifyAuth,
+ name: 'update_script_tag',
+ classification: 'WRITE',
+ displayName: 'Update Script Tag',
+ description: 'Change the script URL or cache flag of a script tag.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Changes the src URL and/or the cache flag of one script tag and returns it; what you leave empty keeps its value. A new src makes every storefront page load a different script, so only use a URL the merchant explicitly asked for and trusts. The display scope is not changed. Repeating the same update leaves the same state. Needs the write_script_tags access scope. Shopify no longer lets many apps create or update script tags: if it answers "This app can\'t create or update script tags", do not retry; a theme app extension is needed instead.',
+ idempotent: true,
+ },
+ props: {
+ script_tag_id: Property.ShortText({
+ displayName: 'Script Tag ID',
+ description: 'The script tag id, numeric or "gid://shopify/ScriptTag/…". Find it with list_script_tags.',
+ required: true,
+ }),
+ src: Property.ShortText({
+ displayName: 'Script URL',
+ description: 'New HTTPS URL of the JavaScript file.',
+ required: false,
+ }),
+ cache: shopifyProps.booleanChoice({
+ displayName: 'Cache',
+ description: 'Yes serves the script from Shopify\'s CDN cache, No loads it from the source each time. Leave empty to keep the current setting.',
+ }),
+ },
+ outputSchema: scriptTagOutputSchema,
+ async run({ auth, propsValue }) {
+ const src = shopifyValues.nonEmpty(propsValue.src);
+ if (src !== undefined && !/^https:\/\/\S+$/i.test(src)) {
+ throw new Error('src must be an https:// URL of a JavaScript file. Nothing was changed.');
+ }
+ const input = shopifyValues.compact({
+ src,
+ cache: shopifyValues.toBooleanChoice(propsValue.cache),
+ });
+ if (Object.keys(input).length === 0) {
+ throw new Error('Nothing to update: provide a new src or a cache choice. Nothing was changed.');
+ }
+ const id = shopifyGraphqlClient.toGid({ type: 'ScriptTag', id: propsValue.script_tag_id });
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ scriptTagUpdate: { scriptTag: GqlScriptTag | null } | null;
+ }>({
+ auth,
+ query: `mutation UpdateScriptTag($id: ID!, $input: ScriptTagInput!) { scriptTagUpdate(id: $id, input: $input) { scriptTag { ${shopifyFields.SCRIPT_TAG_FIELDS} } userErrors { field message } } }`,
+ variables: { id, input },
+ });
+ const tag = data.scriptTagUpdate?.scriptTag;
+ if (!tag) {
+ throw new Error('Shopify did not return the updated script tag.');
+ }
+ return {
+ ...shopifyMappers.mapScriptTag(tag),
+ redacted_fields: redactedFields,
+ };
+ },
+});
diff --git a/packages/pieces/community/shopify/src/lib/actions/ai/upsert-external-marketing-activity.ts b/packages/pieces/community/shopify/src/lib/actions/ai/upsert-external-marketing-activity.ts
new file mode 100644
index 00000000000..da9185cd7c9
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/actions/ai/upsert-external-marketing-activity.ts
@@ -0,0 +1,211 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { shopifyAuth } from '../../..';
+import {
+ GqlMarketingActivity,
+ shopifyFields,
+ shopifyGraphqlClient,
+ shopifyMappers,
+ shopifyProps,
+ shopifyValues,
+} from '../../common/graphql';
+import { marketingActivityOutputSchema } from '../../output-schemas/store';
+
+export const shopifyAiUpsertExternalMarketingActivity = createAction({
+ auth: shopifyAuth,
+ name: 'upsert_external_marketing_activity',
+ classification: 'WRITE',
+ displayName: 'Upsert External Marketing Activity',
+ description: 'Create or fully replace an external marketing activity, keyed by your remote id.',
+ audience: 'ai',
+ aiMetadata: {
+ description:
+ 'Creates an external marketing activity (a campaign, ad or email run outside Shopify) or, when one with the same remote_id already exists, REPLACES it, and returns the activity. Replace means every optional field you leave empty is REMOVED from the existing activity (UTM values, budget, ad spend, schedule, preview image and so on), so always send the complete desired activity; to change only a few fields of an existing activity use update_external_marketing_activity instead. An activity with no hierarchy level must carry either the three UTM values or a url_parameter_value; UTM values, the URL parameter, the channel handle, the parent and the hierarchy level cannot be changed after creation. Repeating the same call leaves the same state. Report engagement numbers afterwards with create_marketing_engagement. Needs the write_marketing_events access scope.',
+ idempotent: true,
+ },
+ props: {
+ remote_id: Property.ShortText({
+ displayName: 'Remote ID',
+ description: 'Your own unique id for this activity, for example "fb-campaign-2026-spring". The same remote id updates the same activity.',
+ required: true,
+ }),
+ title: Property.ShortText({
+ displayName: 'Title',
+ description: 'Name shown in the Shopify marketing section, for example "Spring sale Facebook ads".',
+ required: true,
+ }),
+ status: shopifyProps.staticChoice({
+ displayName: 'Status',
+ description: 'Current state of the activity on the external platform.',
+ required: true,
+ values: shopifyFields.MARKETING_EXTERNAL_STATUSES,
+ }),
+ remote_url: Property.ShortText({
+ displayName: 'Remote URL',
+ description: 'URL where the merchant manages this activity on the external platform, for example "https://ads.example.com/campaigns/42".',
+ required: true,
+ }),
+ tactic: shopifyProps.staticChoice({
+ displayName: 'Tactic',
+ description: 'The kind of marketing, for example AD, NEWSLETTER or POST.',
+ required: true,
+ values: shopifyFields.MARKETING_TACTICS,
+ }),
+ marketing_channel_type: shopifyProps.staticChoice({
+ displayName: 'Channel Type',
+ description: 'The channel the activity runs on.',
+ required: true,
+ values: shopifyFields.MARKETING_CHANNELS,
+ }),
+ utm_campaign: Property.ShortText({
+ displayName: 'UTM Campaign',
+ description: 'utm_campaign value of the activity links, for example "spring-sale". Set all three UTM values or none. Cannot be changed later.',
+ required: false,
+ }),
+ utm_source: Property.ShortText({
+ displayName: 'UTM Source',
+ description: 'utm_source value, for example "facebook".',
+ required: false,
+ }),
+ utm_medium: Property.ShortText({
+ displayName: 'UTM Medium',
+ description: 'utm_medium value, for example "cpc".',
+ required: false,
+ }),
+ url_parameter_value: Property.ShortText({
+ displayName: 'URL Parameter Value',
+ description: 'Value of the tracking URL parameter used instead of UTM values. Cannot be changed later.',
+ required: false,
+ }),
+ hierarchy_level: shopifyProps.staticChoice({
+ displayName: 'Hierarchy Level',
+ description: 'Optional level when the activity is part of a campaign tree (CAMPAIGN, AD_GROUP or AD). Cannot be changed later.',
+ required: false,
+ values: shopifyFields.MARKETING_HIERARCHY_LEVELS,
+ }),
+ parent_remote_id: Property.ShortText({
+ displayName: 'Parent Remote ID',
+ description: 'Remote id of the parent activity in the campaign tree. Cannot be changed later.',
+ required: false,
+ }),
+ channel_handle: Property.ShortText({
+ displayName: 'Channel Handle',
+ description: 'Handle of the sales channel the activity belongs to, if your partner manager gave you one. Cannot be changed later.',
+ required: false,
+ }),
+ referring_domain: Property.ShortText({
+ displayName: 'Referring Domain',
+ description: 'Domain visitors arrive from, for example "facebook.com".',
+ required: false,
+ }),
+ remote_preview_image_url: Property.ShortText({
+ displayName: 'Preview Image URL',
+ description: 'Public URL of a preview image of the ad or email.',
+ required: false,
+ }),
+ budget_type: shopifyProps.staticChoice({
+ displayName: 'Budget Type',
+ description: 'DAILY or LIFETIME. Set together with the budget amount.',
+ required: false,
+ values: shopifyFields.MARKETING_BUDGET_TYPES,
+ }),
+ budget_amount: Property.Number({
+ displayName: 'Budget Amount',
+ description: 'Budget total, for example 500 for 500.00, in the currency below.',
+ required: false,
+ }),
+ ad_spend_amount: Property.Number({
+ displayName: 'Ad Spend',
+ description: 'Amount spent so far, in the currency below.',
+ required: false,
+ }),
+ currency: Property.ShortText({
+ displayName: 'Currency',
+ description: 'ISO currency code of the budget and ad spend, for example "USD". Needed when either is set.',
+ required: false,
+ }),
+ scheduled_start: Property.DateTime({
+ displayName: 'Scheduled Start',
+ description: 'Planned start time, ISO 8601.',
+ required: false,
+ }),
+ scheduled_end: Property.DateTime({
+ displayName: 'Scheduled End',
+ description: 'Planned end time, ISO 8601.',
+ required: false,
+ }),
+ start: Property.DateTime({
+ displayName: 'Actual Start',
+ description: 'When the activity really started, ISO 8601.',
+ required: false,
+ }),
+ end: Property.DateTime({
+ displayName: 'Actual End',
+ description: 'When the activity really ended, ISO 8601.',
+ required: false,
+ }),
+ },
+ outputSchema: marketingActivityOutputSchema,
+ async run({ auth, propsValue }) {
+ const utm = shopifyValues.buildUtm({
+ campaign: propsValue.utm_campaign,
+ source: propsValue.utm_source,
+ medium: propsValue.utm_medium,
+ });
+ const budgetTotal = shopifyValues.buildMoneyInput({
+ amount: propsValue.budget_amount,
+ currency: propsValue.currency,
+ label: 'budget_amount',
+ });
+ if ((budgetTotal === undefined) !== (propsValue.budget_type === undefined || propsValue.budget_type === null)) {
+ throw new Error('Set budget_type and budget_amount together, or neither. Nothing was changed.');
+ }
+ const input = shopifyValues.compact({
+ remoteId: requireText({ value: propsValue.remote_id, name: 'remote_id' }),
+ title: requireText({ value: propsValue.title, name: 'title' }),
+ status: propsValue.status,
+ remoteUrl: requireText({ value: propsValue.remote_url, name: 'remote_url' }),
+ tactic: propsValue.tactic,
+ marketingChannelType: propsValue.marketing_channel_type,
+ utm,
+ urlParameterValue: shopifyValues.nonEmpty(propsValue.url_parameter_value),
+ hierarchyLevel: propsValue.hierarchy_level ?? undefined,
+ parentRemoteId: shopifyValues.nonEmpty(propsValue.parent_remote_id),
+ channelHandle: shopifyValues.nonEmpty(propsValue.channel_handle),
+ referringDomain: shopifyValues.nonEmpty(propsValue.referring_domain),
+ remotePreviewImageUrl: shopifyValues.nonEmpty(propsValue.remote_preview_image_url),
+ budget: budgetTotal ? { budgetType: propsValue.budget_type, total: budgetTotal } : undefined,
+ adSpend: shopifyValues.buildMoneyInput({
+ amount: propsValue.ad_spend_amount,
+ currency: propsValue.currency,
+ label: 'ad_spend_amount',
+ }),
+ scheduledStart: shopifyValues.nonEmpty(propsValue.scheduled_start),
+ scheduledEnd: shopifyValues.nonEmpty(propsValue.scheduled_end),
+ start: shopifyValues.nonEmpty(propsValue.start),
+ end: shopifyValues.nonEmpty(propsValue.end),
+ });
+ const { data, redactedFields } = await shopifyGraphqlClient.request<{
+ marketingActivityUpsertExternal: { marketingActivity: GqlMarketingActivity | null } | null;
+ }>({
+ auth,
+ query: `mutation UpsertExternalMarketingActivity($input: MarketingActivityUpsertExternalInput!) { marketingActivityUpsertExternal(input: $input) { marketingActivity { ${shopifyFields.MARKETING_ACTIVITY_FIELDS} } userErrors { field message code } } }`,
+ variables: { input },
+ });
+ const activity = data.marketingActivityUpsertExternal?.marketingActivity;
+ if (!activity) {
+ throw new Error('Shopify did not return the marketing activity.');
+ }
+ return {
+ ...shopifyMappers.mapMarketingActivity(activity),
+ redacted_fields: redactedFields,
+ };
+ },
+});
+
+function requireText({ value, name }: { value: string | undefined | null; name: string }): string {
+ const text = shopifyValues.nonEmpty(value);
+ if (!text) {
+ throw new Error(`${name} is required. Nothing was changed.`);
+ }
+ return text;
+}
diff --git a/packages/pieces/community/shopify/src/lib/common/analytics.ts b/packages/pieces/community/shopify/src/lib/common/analytics.ts
new file mode 100644
index 00000000000..fd409cd6b9c
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/common/analytics.ts
@@ -0,0 +1,241 @@
+const ANALYTICS_TARGET_FIELDS =
+ 'id name metric startDate endDate expectedValue currencyCode filters shopifyqlQuery createdAt updatedAt';
+
+const ANALYTICS_ANNOTATION_FIELDS =
+ 'id type title description startedAt endedAt source createdAt updatedAt';
+
+const ANNOTATION_TITLE_MAX = 75;
+
+const ANNOTATION_DESCRIPTION_MAX = 150;
+
+const ANALYTICS_TARGET_SORT_KEYS = [
+ 'START_DATE',
+ 'END_DATE',
+ 'NAME',
+ 'METRIC',
+ 'EXPECTED_VALUE',
+ 'CREATED_AT',
+ 'ID',
+];
+
+const ANALYTICS_ANNOTATION_TYPES = [
+ 'product_launch',
+ 'product_discontinuation',
+ 'collection_launch',
+ 'bundle_launch',
+ 'preorder_launch',
+ 'in_person_event',
+ 'campaign',
+ 'brand_change',
+ 'influencer_collaboration',
+ 'brand_collaboration',
+ 'channel_launch',
+ 'ad_spend_change',
+ 'media_mention',
+ 'attribution_change',
+ 'checkout_offer',
+ 'amount_off_products_discount',
+ 'free_shipping_discount',
+ 'buy_x_get_y_discount',
+ 'amount_off_order_discount',
+ 'seasonal_promotion',
+ 'shipping_promotion',
+ 'loyalty_program_offer',
+ 'reward_program_offer',
+ 'subscription_program_offer',
+ 'shop_cash_offer',
+ 'pricing_experiment',
+ 'supplier_change',
+ 'warehouse_change',
+ 'fulfillment_service_change',
+ 'landing_page_launch',
+ 'store_redesign',
+ 'payment_method_change',
+ 'retail_store_change',
+ 'popup_store',
+ 'revenue_milestone',
+ 'order_milestone',
+ 'customer_milestone',
+ 'capital_funding',
+ 'expansion_milestone',
+ 'award_recognition',
+ 'anniversary',
+ 'market_change',
+ 'tax_change',
+ 'loyalty_program_change',
+ 'reward_program_change',
+ 'subscription_program_change',
+ 'retention_program_change',
+ 'return_program_change',
+ 'external_event',
+ 'team_change',
+ 'other',
+];
+
+function mapAnalyticsTarget(target: GqlAnalyticsTarget) {
+ return {
+ id: target.id,
+ name: target.name ?? null,
+ metric: target.metric ?? null,
+ start_date: target.startDate ?? null,
+ end_date: target.endDate ?? null,
+ expected_value: target.expectedValue === null || target.expectedValue === undefined ? null : String(target.expectedValue),
+ currency_code: target.currencyCode ?? null,
+ filters: target.filters ?? null,
+ shopifyql_query: target.shopifyqlQuery ?? null,
+ created_at: target.createdAt ?? null,
+ updated_at: target.updatedAt ?? null,
+ };
+}
+
+function mapAnalyticsAnnotation(annotation: GqlAnalyticsAnnotation) {
+ return {
+ id: annotation.id,
+ type: annotation.type ?? null,
+ title: annotation.title ?? null,
+ description: annotation.description ?? null,
+ started_at: annotation.startedAt ?? null,
+ ended_at: annotation.endedAt ?? null,
+ source: annotation.source ?? null,
+ created_at: annotation.createdAt ?? null,
+ updated_at: annotation.updatedAt ?? null,
+ };
+}
+
+function readMetric(value: string | undefined | null): string | undefined {
+ const text = (value ?? '').trim();
+ if (text.length === 0) {
+ return undefined;
+ }
+ if (!/^[a-z][a-z0-9_]*$/.test(text)) {
+ throw new Error(
+ `"${text}" is not a metric identifier. Use a lower-case ShopifyQL metric name such as total_sales or orders. Nothing was changed.`
+ );
+ }
+ return text;
+}
+
+function readExpectedValue(value: unknown): string | undefined {
+ if (value === undefined || value === null || value === '') {
+ return undefined;
+ }
+ const text = String(value).trim();
+ if (!/^\d+(\.\d+)?$/.test(text) || Number(text) <= 0) {
+ throw new Error(`expected_value must be a number greater than 0, got "${text}". Nothing was changed.`);
+ }
+ return text;
+}
+
+function checkDateOrder({ start, end }: { start: string | undefined; end: string | undefined }): void {
+ if (start !== undefined && end !== undefined && start > end) {
+ throw new Error(`start_date ${start} is after end_date ${end}. Nothing was changed.`);
+ }
+}
+
+function isRealCalendarDate(text: string): boolean {
+ const [year, month, day] = text.split('-').map(Number);
+ const date = new Date(Date.UTC(year, month - 1, day));
+ return date.getUTCFullYear() === year && date.getUTCMonth() === month - 1 && date.getUTCDate() === day;
+}
+
+function readDateTime({ value, label }: { value: string | undefined | null; label: string }): string | undefined {
+ const text = (value ?? '').trim();
+ if (text.length === 0) {
+ return undefined;
+ }
+ const isoPattern = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:\d{2})$/;
+ if (!isoPattern.test(text) || !Number.isFinite(Date.parse(text)) || !isRealCalendarDate(text.slice(0, 10))) {
+ throw new Error(
+ `${label} "${text}" is not an ISO 8601 date-time with a time zone, for example 2026-11-28T00:00:00Z. Nothing was changed.`
+ );
+ }
+ return text;
+}
+
+function checkDateTimeOrder({ startedAt, endedAt }: { startedAt: string | undefined; endedAt: string | undefined }): void {
+ if (startedAt !== undefined && endedAt !== undefined && Date.parse(endedAt) < Date.parse(startedAt)) {
+ throw new Error(`ended_at ${endedAt} is before started_at ${startedAt}. Nothing was changed.`);
+ }
+}
+
+function readAnnotationType(value: string | undefined | null): string | undefined {
+ const text = (value ?? '').trim();
+ if (text.length === 0) {
+ return undefined;
+ }
+ if (!ANALYTICS_ANNOTATION_TYPES.includes(text)) {
+ throw new Error(
+ `"${text}" is not an annotation type apps can set. Use one of: ${ANALYTICS_ANNOTATION_TYPES.join(', ')}. Nothing was changed.`
+ );
+ }
+ return text;
+}
+
+function readBoundedText({
+ value,
+ label,
+ max,
+}: {
+ value: string | undefined | null;
+ label: string;
+ max: number;
+}): string | undefined {
+ const text = (value ?? '').trim();
+ if (text.length === 0) {
+ return undefined;
+ }
+ if ([...text].length > max) {
+ throw new Error(`${label} is ${[...text].length} characters; Shopify allows at most ${max}. Nothing was changed.`);
+ }
+ return text;
+}
+
+export const analyticsFields = {
+ ANALYTICS_TARGET_FIELDS,
+ ANALYTICS_ANNOTATION_FIELDS,
+ ANALYTICS_TARGET_SORT_KEYS,
+ ANALYTICS_ANNOTATION_TYPES,
+ ANNOTATION_TITLE_MAX,
+ ANNOTATION_DESCRIPTION_MAX,
+};
+
+export const analyticsMappers = {
+ mapAnalyticsTarget,
+ mapAnalyticsAnnotation,
+};
+
+export const analyticsValues = {
+ readMetric,
+ readExpectedValue,
+ checkDateOrder,
+ readDateTime,
+ checkDateTimeOrder,
+ readAnnotationType,
+ readBoundedText,
+};
+
+export type GqlAnalyticsTarget = {
+ id: string;
+ name?: string | null;
+ metric?: string | null;
+ startDate?: string | null;
+ endDate?: string | null;
+ expectedValue?: string | number | null;
+ currencyCode?: string | null;
+ filters?: string | null;
+ shopifyqlQuery?: string | null;
+ createdAt?: string | null;
+ updatedAt?: string | null;
+};
+
+export type GqlAnalyticsAnnotation = {
+ id: string;
+ type?: string | null;
+ title?: string | null;
+ description?: string | null;
+ startedAt?: string | null;
+ endedAt?: string | null;
+ source?: string | null;
+ createdAt?: string | null;
+ updatedAt?: string | null;
+};
diff --git a/packages/pieces/community/shopify/src/lib/common/auth.ts b/packages/pieces/community/shopify/src/lib/common/auth.ts
index abdcd00b793..00b593f66ac 100644
--- a/packages/pieces/community/shopify/src/lib/common/auth.ts
+++ b/packages/pieces/community/shopify/src/lib/common/auth.ts
@@ -23,7 +23,7 @@ You can find your shop name in the URL. For example, if the URL is \`https://exa
1. Log in to your Shopify admin.
2. Go to **Settings** -> **Apps and sales channels** -> **Develop apps**.
3. Open your existing custom app.
-4. Under **Configuration**, check that the Admin API scopes include: \`read_orders\`, \`write_orders\`, \`read_customers\`, \`write_customers\`, \`read_products\`, \`write_products\`, \`read_draft_orders\`, \`write_draft_orders\`, \`read_locations\`, \`read_inventory\`, \`write_inventory\`, \`read_themes\`, \`write_fulfillments\`, \`read_publications\`, \`write_publications\`, \`write_files\`, \`read_merchant_managed_fulfillment_orders\`, \`write_merchant_managed_fulfillment_orders\`, \`read_fulfillments\`, \`read_shipping\`, \`read_discounts\`, \`write_discounts\`, \`read_gift_cards\`, \`write_gift_cards\`, \`write_themes\`, \`read_content\`, \`write_content\`, \`read_online_store_navigation\`, \`write_online_store_navigation\`, \`read_metaobjects\`, \`write_metaobjects\`, \`read_metaobject_definitions\`, \`write_metaobject_definitions\`.
+4. Under **Configuration**, check that the Admin API scopes include: \`read_orders\`, \`write_orders\`, \`read_customers\`, \`write_customers\`, \`read_products\`, \`write_products\`, \`read_draft_orders\`, \`write_draft_orders\`, \`read_locations\`, \`read_inventory\`, \`write_inventory\`, \`read_themes\`, \`write_fulfillments\`, \`read_publications\`, \`write_publications\`, \`write_files\`, \`read_merchant_managed_fulfillment_orders\`, \`write_merchant_managed_fulfillment_orders\`, \`read_fulfillments\`, \`read_shipping\`, \`read_discounts\`, \`write_discounts\`, \`read_gift_cards\`, \`write_gift_cards\`, \`write_themes\`, \`read_content\`, \`write_content\`, \`read_online_store_navigation\`, \`write_online_store_navigation\`, \`read_metaobjects\`, \`write_metaobjects\`, \`read_metaobject_definitions\`, \`write_metaobject_definitions\`, \`read_marketing_events\`, \`write_marketing_events\`, \`read_script_tags\`, \`write_script_tags\`, \`read_legal_policies\`, \`read_privacy_settings\`, \`read_markets\`, \`write_markets\`, \`read_payment_terms\`, \`read_shopify_payments_disputes\`, \`read_reports\`, \`write_reports\`, \`write_analytics_annotations\`.
5. Under **API credentials**, copy the **Admin API access token**.
`;
@@ -33,7 +33,7 @@ Use this option for apps created in the Shopify **Dev Dashboard** (all new apps
**Important:** the app and the store must belong to the **same Shopify organization**, otherwise Shopify rejects the connection.
1. Go to the [Shopify Dev Dashboard](https://dev.shopify.com/dashboard) and click **Create app**. Give it a name.
-2. Create a version of the app and, under **Access** -> **Scopes**, select these Admin API scopes: \`read_orders\`, \`write_orders\`, \`read_customers\`, \`write_customers\`, \`read_products\`, \`write_products\`, \`read_draft_orders\`, \`write_draft_orders\`, \`read_locations\`, \`read_inventory\`, \`write_inventory\`, \`read_themes\`, \`write_fulfillments\`, \`read_publications\`, \`write_publications\`, \`write_files\`, \`read_merchant_managed_fulfillment_orders\`, \`write_merchant_managed_fulfillment_orders\`, \`read_fulfillments\`, \`read_shipping\`, \`read_discounts\`, \`write_discounts\`, \`read_gift_cards\`, \`write_gift_cards\`, \`write_themes\`, \`read_content\`, \`write_content\`, \`read_online_store_navigation\`, \`write_online_store_navigation\`, \`read_metaobjects\`, \`write_metaobjects\`, \`read_metaobject_definitions\`, \`write_metaobject_definitions\`.
+2. Create a version of the app and, under **Access** -> **Scopes**, select these Admin API scopes: \`read_orders\`, \`write_orders\`, \`read_customers\`, \`write_customers\`, \`read_products\`, \`write_products\`, \`read_draft_orders\`, \`write_draft_orders\`, \`read_locations\`, \`read_inventory\`, \`write_inventory\`, \`read_themes\`, \`write_fulfillments\`, \`read_publications\`, \`write_publications\`, \`write_files\`, \`read_merchant_managed_fulfillment_orders\`, \`write_merchant_managed_fulfillment_orders\`, \`read_fulfillments\`, \`read_shipping\`, \`read_discounts\`, \`write_discounts\`, \`read_gift_cards\`, \`write_gift_cards\`, \`write_themes\`, \`read_content\`, \`write_content\`, \`read_online_store_navigation\`, \`write_online_store_navigation\`, \`read_metaobjects\`, \`write_metaobjects\`, \`read_metaobject_definitions\`, \`write_metaobject_definitions\`, \`read_marketing_events\`, \`write_marketing_events\`, \`read_script_tags\`, \`write_script_tags\`, \`read_legal_policies\`, \`read_privacy_settings\`, \`read_markets\`, \`write_markets\`, \`read_payment_terms\`, \`read_shopify_payments_disputes\`, \`read_reports\`, \`write_reports\`, \`write_analytics_annotations\`.
3. Release a version with these scopes and install/approve it on the store: from the app's **Home** page, click **Install app** and install it on your store (reinstall it if it was installed before the scopes were added). The store must be in the same organization as the app.
4. Open the app's **Settings** page and copy the **Client ID** and **Client secret**.
5. Enter your shop name below (for \`https://example.myshopify.com\`, enter **example**), then paste the client ID and client secret.
diff --git a/packages/pieces/community/shopify/src/lib/common/graphql.ts b/packages/pieces/community/shopify/src/lib/common/graphql.ts
index 17e83fc2fc6..1ab1a269ab0 100644
--- a/packages/pieces/community/shopify/src/lib/common/graphql.ts
+++ b/packages/pieces/community/shopify/src/lib/common/graphql.ts
@@ -3080,6 +3080,412 @@ function metafieldOwnerTypeProp({
});
}
+function mapMarketingEvent(event: GqlMarketingEvent) {
+ return {
+ id: event.id,
+ legacy_resource_id: event.legacyResourceId ?? null,
+ type: event.type ?? null,
+ remote_id: event.remoteId ?? null,
+ description: event.description ?? null,
+ marketing_channel_type: event.marketingChannelType ?? null,
+ source_and_medium: event.sourceAndMedium ?? null,
+ channel_handle: event.channelHandle ?? null,
+ started_at: event.startedAt ?? null,
+ ended_at: event.endedAt ?? null,
+ scheduled_to_end_at: event.scheduledToEndAt ?? null,
+ manage_url: event.manageUrl ?? null,
+ preview_url: event.previewUrl ?? null,
+ utm_campaign: event.utmCampaign ?? null,
+ utm_medium: event.utmMedium ?? null,
+ utm_source: event.utmSource ?? null,
+ app_id: event.app?.id ?? null,
+ app_title: event.app?.title ?? null,
+ };
+}
+
+function mapMarketingActivity(activity: GqlMarketingActivity) {
+ return {
+ id: activity.id,
+ title: activity.title ?? null,
+ status: activity.status ?? null,
+ status_label: activity.statusLabel ?? null,
+ tactic: activity.tactic ?? null,
+ marketing_channel_type: activity.marketingChannelType ?? null,
+ source_and_medium: activity.sourceAndMedium ?? null,
+ is_external: activity.isExternal ?? null,
+ hierarchy_level: activity.hierarchyLevel ?? null,
+ parent_remote_id: activity.parentRemoteId ?? null,
+ parent_activity_id: activity.parentActivityId ?? null,
+ url_parameter_value: activity.urlParameterValue ?? null,
+ activity_list_url: activity.activityListUrl ?? null,
+ utm_campaign: activity.utmParameters?.campaign ?? activity.marketingEvent?.utmCampaign ?? null,
+ utm_source: activity.utmParameters?.source ?? activity.marketingEvent?.utmSource ?? null,
+ utm_medium: activity.utmParameters?.medium ?? activity.marketingEvent?.utmMedium ?? null,
+ budget_type: activity.budget?.budgetType ?? null,
+ budget_amount: activity.budget?.total?.amount ?? null,
+ budget_currency_code: activity.budget?.total?.currencyCode ?? null,
+ ad_spend_amount: activity.adSpend?.amount ?? null,
+ ad_spend_currency_code: activity.adSpend?.currencyCode ?? null,
+ marketing_event_id: activity.marketingEvent?.id ?? null,
+ remote_id: activity.marketingEvent?.remoteId ?? null,
+ manage_url: activity.marketingEvent?.manageUrl ?? null,
+ preview_url: activity.marketingEvent?.previewUrl ?? null,
+ started_at: activity.marketingEvent?.startedAt ?? null,
+ ended_at: activity.marketingEvent?.endedAt ?? null,
+ scheduled_to_end_at: activity.marketingEvent?.scheduledToEndAt ?? null,
+ status_transitioned_at: activity.statusTransitionedAt ?? null,
+ created_at: activity.createdAt ?? null,
+ updated_at: activity.updatedAt ?? null,
+ };
+}
+
+function mapMarketingEngagement(engagement: GqlMarketingEngagement) {
+ return {
+ occurred_on: engagement.occurredOn ?? null,
+ utc_offset: engagement.utcOffset ?? null,
+ channel_handle: engagement.channelHandle ?? null,
+ marketing_activity_id: engagement.marketingActivity?.id ?? null,
+ marketing_activity_title: engagement.marketingActivity?.title ?? null,
+ impressions_count: engagement.impressionsCount ?? null,
+ views_count: engagement.viewsCount ?? null,
+ clicks_count: engagement.clicksCount ?? null,
+ shares_count: engagement.sharesCount ?? null,
+ favorites_count: engagement.favoritesCount ?? null,
+ comments_count: engagement.commentsCount ?? null,
+ unsubscribes_count: engagement.unsubscribesCount ?? null,
+ complaints_count: engagement.complaintsCount ?? null,
+ fails_count: engagement.failsCount ?? null,
+ sends_count: engagement.sendsCount ?? null,
+ unique_views_count: engagement.uniqueViewsCount ?? null,
+ unique_clicks_count: engagement.uniqueClicksCount ?? null,
+ sessions_count: engagement.sessionsCount ?? null,
+ orders: engagement.orders ?? null,
+ first_time_customers: engagement.firstTimeCustomers ?? null,
+ returning_customers: engagement.returningCustomers ?? null,
+ primary_conversions: engagement.primaryConversions ?? null,
+ all_conversions: engagement.allConversions ?? null,
+ ad_spend_amount: engagement.adSpend?.amount ?? null,
+ ad_spend_currency_code: engagement.adSpend?.currencyCode ?? null,
+ sales_amount: engagement.sales?.amount ?? null,
+ sales_currency_code: engagement.sales?.currencyCode ?? null,
+ };
+}
+
+function mapScriptTag(tag: GqlScriptTag) {
+ return {
+ id: tag.id,
+ legacy_resource_id: tag.legacyResourceId ?? null,
+ src: tag.src ?? null,
+ display_scope: tag.displayScope ?? null,
+ cache: tag.cache ?? null,
+ created_at: tag.createdAt ?? null,
+ updated_at: tag.updatedAt ?? null,
+ };
+}
+
+function mapEvent(event: GqlEvent) {
+ return {
+ id: event.id,
+ event_type: event.__typename ?? null,
+ action: event.action ?? null,
+ message: event.message ?? null,
+ secondary_message: event.secondaryMessage ?? null,
+ raw_message: event.rawMessage ?? null,
+ subject_id: event.subjectId ?? null,
+ subject_type: event.subjectType ?? null,
+ author: event.author ?? null,
+ app_title: event.appTitle ?? null,
+ attribute_to_app: event.attributeToApp ?? null,
+ attribute_to_user: event.attributeToUser ?? null,
+ critical_alert: event.criticalAlert ?? null,
+ edited: event.edited ?? null,
+ created_at: event.createdAt ?? null,
+ };
+}
+
+function mapBulkOperation(operation: GqlBulkOperation) {
+ return {
+ id: operation.id,
+ status: operation.status ?? null,
+ type: operation.type ?? null,
+ error_code: operation.errorCode ?? null,
+ created_at: operation.createdAt ?? null,
+ completed_at: operation.completedAt ?? null,
+ object_count: operation.objectCount ?? null,
+ root_object_count: operation.rootObjectCount ?? null,
+ file_size: operation.fileSize ?? null,
+ url: operation.url ?? null,
+ partial_data_url: operation.partialDataUrl ?? null,
+ query: operation.query ?? null,
+ };
+}
+
+function mapCurrencySetting(setting: GqlCurrencySetting) {
+ return {
+ currency_code: setting.currencyCode ?? null,
+ currency_name: setting.currencyName ?? null,
+ enabled: setting.enabled ?? null,
+ manual_rate: setting.manualRate ?? null,
+ rate_updated_at: setting.rateUpdatedAt ?? null,
+ };
+}
+
+function mapShopPolicy(policy: GqlShopPolicy) {
+ return {
+ id: policy.id,
+ type: policy.type ?? null,
+ title: policy.title ?? null,
+ url: policy.url ?? null,
+ body: policy.body ?? null,
+ created_at: policy.createdAt ?? null,
+ updated_at: policy.updatedAt ?? null,
+ };
+}
+
+function mapLocale(locale: GqlLocale) {
+ return {
+ iso_code: locale.isoCode ?? null,
+ name: locale.name ?? null,
+ };
+}
+
+function mapDomain(domain: GqlDomain) {
+ return {
+ id: domain.id,
+ host: domain.host ?? null,
+ url: domain.url ?? null,
+ ssl_enabled: domain.sslEnabled ?? null,
+ default_locale: domain.localization?.defaultLocale ?? null,
+ alternate_locales: domain.localization?.alternateLocales ?? [],
+ country: domain.localization?.country ?? null,
+ web_presence_id: domain.marketWebPresence?.id ?? null,
+ web_presence_subfolder_suffix: domain.marketWebPresence?.subfolderSuffix ?? null,
+ web_presence_root_urls: (domain.marketWebPresence?.rootUrls ?? []).map((root) => ({
+ locale: root.locale ?? null,
+ url: root.url ?? null,
+ })),
+ };
+}
+
+function mapCustomerAccountPage(page: GqlCustomerAccountPage) {
+ return {
+ id: page.id,
+ page_kind: page.__typename ?? null,
+ handle: page.handle ?? null,
+ title: page.title ?? null,
+ default_cursor: page.defaultCursor ?? null,
+ page_type: page.pageType ?? null,
+ app_extension_uuid: page.appExtensionUuid ?? null,
+ };
+}
+
+function mapConsentPolicy(policy: GqlConsentPolicy) {
+ return {
+ id: policy.id,
+ country_code: policy.countryCode ?? null,
+ region_code: policy.regionCode ?? null,
+ consent_required: policy.consentRequired ?? null,
+ data_sale_opt_out_required: policy.dataSaleOptOutRequired ?? null,
+ shop_id: policy.shopId ?? null,
+ };
+}
+
+function mapConsentPolicyRegion(region: GqlConsentPolicyRegion) {
+ return {
+ country_code: region.countryCode ?? null,
+ region_code: region.regionCode ?? null,
+ };
+}
+
+function mapCatalog(catalog: GqlCatalog) {
+ return {
+ id: catalog.id,
+ catalog_type: catalog.__typename ?? null,
+ title: catalog.title ?? null,
+ status: catalog.status ?? null,
+ price_list_id: catalog.priceList?.id ?? null,
+ price_list_name: catalog.priceList?.name ?? null,
+ price_list_currency: catalog.priceList?.currency ?? null,
+ publication_id: catalog.publication?.id ?? null,
+ markets_count: catalog.marketsCount?.count ?? null,
+ company_locations_count: catalog.companyLocationsCount?.count ?? null,
+ };
+}
+
+function mapBusinessEntity(entity: GqlBusinessEntity) {
+ return {
+ id: entity.id,
+ display_name: entity.displayName ?? null,
+ company_name: entity.companyName ?? null,
+ primary: entity.primary ?? null,
+ archived: entity.archived ?? null,
+ legal_entity_id: entity.legalEntityId ?? null,
+ address1: entity.address?.address1 ?? null,
+ address2: entity.address?.address2 ?? null,
+ city: entity.address?.city ?? null,
+ province: entity.address?.province ?? null,
+ zip: entity.address?.zip ?? null,
+ country_code: entity.address?.countryCode ?? null,
+ };
+}
+
+function mapPaymentTermsTemplate(template: GqlPaymentTermsTemplate) {
+ return {
+ id: template.id,
+ name: template.name ?? null,
+ translated_name: template.translatedName ?? null,
+ description: template.description ?? null,
+ due_in_days: template.dueInDays ?? null,
+ payment_terms_type: template.paymentTermsType ?? null,
+ };
+}
+
+function mapDispute(dispute: GqlDispute) {
+ return {
+ id: dispute.id,
+ legacy_resource_id: dispute.legacyResourceId ?? null,
+ status: dispute.status ?? null,
+ type: dispute.type ?? null,
+ reason: dispute.reasonDetails?.reason ?? null,
+ network_reason_code: dispute.reasonDetails?.networkReasonCode ?? null,
+ amount: dispute.amount?.amount ?? null,
+ currency_code: dispute.amount?.currencyCode ?? null,
+ initiated_at: dispute.initiatedAt ?? null,
+ evidence_due_by: dispute.evidenceDueBy ?? null,
+ evidence_sent_on: dispute.evidenceSentOn ?? null,
+ finalized_on: dispute.finalizedOn ?? null,
+ order_id: dispute.order?.id ?? null,
+ order_name: dispute.order?.name ?? null,
+ };
+}
+
+function mapShopPayReceipt(receipt: GqlShopPayReceipt) {
+ return {
+ token: receipt.token ?? null,
+ source_identifier: receipt.sourceIdentifier ?? null,
+ created_at: receipt.createdAt ?? null,
+ processing_state: receipt.processingStatus?.state ?? null,
+ processing_message: receipt.processingStatus?.message ?? null,
+ processing_error_code: receipt.processingStatus?.errorCode ?? null,
+ order_id: receipt.order?.id ?? null,
+ order_name: receipt.order?.name ?? null,
+ presentment_currency: receipt.paymentRequest?.presentmentCurrency ?? null,
+ total: receipt.paymentRequest?.total?.amount ?? null,
+ subtotal: receipt.paymentRequest?.subtotal?.amount ?? null,
+ total_tax: receipt.paymentRequest?.totalTax?.amount ?? null,
+ };
+}
+
+function mapWebPresence(presence: GqlWebPresence) {
+ return {
+ id: presence.id,
+ kind: presence.domain ? 'domain' : 'subfolder',
+ subfolder_suffix: presence.subfolderSuffix ?? null,
+ domain_id: presence.domain?.id ?? null,
+ domain_host: presence.domain?.host ?? null,
+ domain_url: presence.domain?.url ?? null,
+ default_locale: presence.defaultLocale?.locale ?? null,
+ root_urls: (presence.rootUrls ?? []).map((root) => ({
+ locale: root.locale ?? null,
+ url: root.url ?? null,
+ })),
+ };
+}
+
+function mapSavedSearch(search: GqlSavedSearch) {
+ return {
+ id: search.id,
+ name: search.name ?? null,
+ query: search.query ?? null,
+ search_terms: search.searchTerms ?? null,
+ resource_type: search.resourceType ?? null,
+ };
+}
+
+function buildMoneyInput({
+ amount,
+ currency,
+ label,
+}: {
+ amount: number | undefined | null;
+ currency: string | undefined | null;
+ label: string;
+}): { amount: string; currencyCode: string } | undefined {
+ if (amount === undefined || amount === null) {
+ return undefined;
+ }
+ if (!Number.isFinite(amount) || amount < 0) {
+ throw new Error(`${label} must be 0 or more. Nothing was changed.`);
+ }
+ const code = nonEmpty(currency)?.toUpperCase();
+ if (!code || !/^[A-Z]{3}$/.test(code)) {
+ throw new Error(`${label} needs currency set to a 3-letter ISO code such as "USD". Nothing was changed.`);
+ }
+ return { amount: String(amount), currencyCode: code };
+}
+
+function buildUtm({
+ campaign,
+ source,
+ medium,
+}: {
+ campaign: string | undefined | null;
+ source: string | undefined | null;
+ medium: string | undefined | null;
+}): { campaign: string; source: string; medium: string } | undefined {
+ const values = { campaign: nonEmpty(campaign), source: nonEmpty(source), medium: nonEmpty(medium) };
+ const given = Object.values(values).filter((value) => value !== undefined).length;
+ if (given === 0) {
+ return undefined;
+ }
+ if (values.campaign === undefined || values.source === undefined || values.medium === undefined) {
+ throw new Error('UTM parameters go together: set utm_campaign, utm_source and utm_medium, or none of them. Nothing was changed.');
+ }
+ return { campaign: values.campaign, source: values.source, medium: values.medium };
+}
+
+function readMarketingActivityTarget({
+ marketingActivityId,
+ remoteId,
+}: {
+ marketingActivityId: string | undefined | null;
+ remoteId: string | undefined | null;
+}): { marketingActivityId?: string; remoteId?: string } {
+ const id = nonEmpty(marketingActivityId);
+ const remote = nonEmpty(remoteId);
+ if (id && remote) {
+ throw new Error('Pass either marketing_activity_id or remote_id, not both. Nothing was changed.');
+ }
+ if (id) {
+ return { marketingActivityId: toGid({ type: 'MarketingActivity', id }) };
+ }
+ if (remote) {
+ return { remoteId: remote };
+ }
+ throw new Error('Pass marketing_activity_id or remote_id to say which marketing activity to use. Nothing was changed.');
+}
+
+function staticChoiceProp({
+ displayName,
+ description,
+ required,
+ values,
+}: {
+ displayName: string;
+ description: string;
+ required: boolean;
+ values: string[];
+}) {
+ return Property.StaticDropdown({
+ displayName,
+ description,
+ required,
+ options: {
+ options: values.map((value) => ({ label: value, value })),
+ },
+ });
+}
+
const MONEY_FIELDS = 'shopMoney { amount currencyCode }';
const MONEY_WITH_PRESENTMENT_FIELDS =
@@ -3362,6 +3768,81 @@ const MAX_METAFIELDS_PER_CALL = 25;
const MAX_THEME_FILES_PER_CALL = 50;
+const MARKETING_EVENT_FIELDS =
+ 'id legacyResourceId type remoteId description marketingChannelType sourceAndMedium channelHandle startedAt endedAt scheduledToEndAt manageUrl previewUrl utmCampaign utmMedium utmSource app { id title }';
+
+const MARKETING_ACTIVITY_FIELDS = `id title status statusLabel tactic marketingChannelType sourceAndMedium isExternal hierarchyLevel parentRemoteId parentActivityId urlParameterValue activityListUrl statusTransitionedAt createdAt updatedAt utmParameters { campaign source medium } budget { budgetType total { amount currencyCode } } adSpend { amount currencyCode } marketingEvent { id remoteId manageUrl previewUrl startedAt endedAt scheduledToEndAt utmCampaign utmSource utmMedium }`;
+
+const MARKETING_ENGAGEMENT_FIELDS =
+ 'occurredOn utcOffset channelHandle impressionsCount viewsCount clicksCount sharesCount favoritesCount commentsCount unsubscribesCount complaintsCount failsCount sendsCount uniqueViewsCount uniqueClicksCount sessionsCount orders firstTimeCustomers returningCustomers primaryConversions allConversions adSpend { amount currencyCode } sales { amount currencyCode } marketingActivity { id title }';
+
+const SCRIPT_TAG_FIELDS = 'id legacyResourceId src displayScope cache createdAt updatedAt';
+
+const EVENT_FIELDS =
+ '__typename id action message createdAt appTitle attributeToApp attributeToUser criticalAlert ... on BasicEvent { subjectId subjectType author secondaryMessage } ... on CommentEvent { rawMessage edited }';
+
+const BULK_OPERATION_FIELDS =
+ 'id status type errorCode createdAt completedAt objectCount rootObjectCount fileSize url partialDataUrl query';
+
+const CURRENCY_SETTING_FIELDS = 'currencyCode currencyName enabled manualRate rateUpdatedAt';
+
+const SHOP_POLICY_FIELDS = 'id type title url body createdAt updatedAt';
+
+const LOCALE_FIELDS = 'isoCode name';
+
+const DOMAIN_FIELDS =
+ 'id host url sslEnabled localization { defaultLocale alternateLocales country } marketWebPresence { id subfolderSuffix rootUrls { locale url } }';
+
+const CUSTOMER_ACCOUNT_PAGE_FIELDS =
+ '__typename id handle title defaultCursor ... on CustomerAccountNativePage { pageType } ... on CustomerAccountAppExtensionPage { appExtensionUuid }';
+
+const CONSENT_POLICY_FIELDS = 'id countryCode regionCode consentRequired dataSaleOptOutRequired shopId';
+
+const CONSENT_POLICY_REGION_FIELDS = 'countryCode regionCode';
+
+const CATALOG_FIELDS =
+ '__typename id title status priceList { id name currency } publication { id } ... on MarketCatalog { marketsCount { count } } ... on CompanyLocationCatalog { companyLocationsCount { count } }';
+
+const BUSINESS_ENTITY_FIELDS =
+ 'id displayName companyName primary archived legalEntityId address { address1 address2 city province zip countryCode }';
+
+const PAYMENT_TERMS_TEMPLATE_FIELDS = 'id name translatedName description dueInDays paymentTermsType';
+
+const DISPUTE_FIELDS =
+ 'id legacyResourceId status type initiatedAt evidenceDueBy evidenceSentOn finalizedOn amount { amount currencyCode } reasonDetails { reason networkReasonCode } order { id name }';
+
+const SHOP_PAY_RECEIPT_FIELDS =
+ 'token sourceIdentifier createdAt processingStatus { state message errorCode } order { id name } paymentRequest { presentmentCurrency total { amount currencyCode } subtotal { amount currencyCode } totalTax { amount currencyCode } }';
+
+const WEB_PRESENCE_FIELDS =
+ 'id subfolderSuffix domain { id host url } defaultLocale { locale } rootUrls { locale url }';
+
+const SAVED_SEARCH_FIELDS = 'id name query searchTerms resourceType';
+
+const MARKETING_TACTICS = [
+ 'ABANDONED_CART',
+ 'AD',
+ 'AFFILIATE',
+ 'LINK',
+ 'LOYALTY',
+ 'MESSAGE',
+ 'NEWSLETTER',
+ 'NOTIFICATION',
+ 'POST',
+ 'RETARGETING',
+ 'TRANSACTIONAL',
+ 'STOREFRONT_APP',
+ 'SEO',
+];
+
+const MARKETING_CHANNELS = ['SEARCH', 'DISPLAY', 'SOCIAL', 'EMAIL', 'REFERRAL'];
+
+const MARKETING_EXTERNAL_STATUSES = ['ACTIVE', 'INACTIVE', 'PAUSED', 'SCHEDULED', 'DELETED_EXTERNALLY', 'UNDEFINED'];
+
+const MARKETING_HIERARCHY_LEVELS = ['CAMPAIGN', 'AD_GROUP', 'AD'];
+
+const MARKETING_BUDGET_TYPES = ['DAILY', 'LIFETIME'];
+
export const shopifyFields = {
MONEY_FIELDS,
@@ -3431,6 +3912,31 @@ export const shopifyFields = {
METAFIELD_OWNER_TYPES,
MAX_METAFIELDS_PER_CALL,
MAX_THEME_FILES_PER_CALL,
+ MARKETING_EVENT_FIELDS,
+ MARKETING_ACTIVITY_FIELDS,
+ MARKETING_ENGAGEMENT_FIELDS,
+ SCRIPT_TAG_FIELDS,
+ EVENT_FIELDS,
+ BULK_OPERATION_FIELDS,
+ CURRENCY_SETTING_FIELDS,
+ SHOP_POLICY_FIELDS,
+ LOCALE_FIELDS,
+ DOMAIN_FIELDS,
+ CUSTOMER_ACCOUNT_PAGE_FIELDS,
+ CONSENT_POLICY_FIELDS,
+ CONSENT_POLICY_REGION_FIELDS,
+ CATALOG_FIELDS,
+ BUSINESS_ENTITY_FIELDS,
+ PAYMENT_TERMS_TEMPLATE_FIELDS,
+ DISPUTE_FIELDS,
+ SHOP_PAY_RECEIPT_FIELDS,
+ WEB_PRESENCE_FIELDS,
+ SAVED_SEARCH_FIELDS,
+ MARKETING_TACTICS,
+ MARKETING_CHANNELS,
+ MARKETING_EXTERNAL_STATUSES,
+ MARKETING_HIERARCHY_LEVELS,
+ MARKETING_BUDGET_TYPES,
};
export const shopifyGraphqlClient = {
@@ -3487,6 +3993,9 @@ export const shopifyValues = {
requireGid,
legacyIdFilter,
joinSearch,
+ buildMoneyInput,
+ buildUtm,
+ readMarketingActivityTarget,
};
export const shopifyMappers = {
@@ -3547,6 +4056,26 @@ export const shopifyMappers = {
mapStandardMetafieldTemplate,
mapMetaobject,
mapMetaobjectDefinition,
+ mapMarketingEvent,
+ mapMarketingActivity,
+ mapMarketingEngagement,
+ mapScriptTag,
+ mapEvent,
+ mapBulkOperation,
+ mapCurrencySetting,
+ mapShopPolicy,
+ mapLocale,
+ mapDomain,
+ mapCustomerAccountPage,
+ mapConsentPolicy,
+ mapConsentPolicyRegion,
+ mapCatalog,
+ mapBusinessEntity,
+ mapPaymentTermsTemplate,
+ mapDispute,
+ mapShopPayReceipt,
+ mapWebPresence,
+ mapSavedSearch,
};
export const shopifyProps = {
@@ -3567,6 +4096,7 @@ export const shopifyProps = {
fulfillmentOrderLineItems: fulfillmentOrderLineItemsProp,
idList: idListProp,
metafieldOwnerType: metafieldOwnerTypeProp,
+ staticChoice: staticChoiceProp,
};
export type ShopifyGraphqlParams = {
@@ -4660,3 +5190,278 @@ export type GqlMetaobjectDefinition = {
type?: { name?: string | null } | null;
}[] | null;
};
+
+export type GqlMarketingEvent = {
+ id: string;
+ legacyResourceId?: string | null;
+ type?: string | null;
+ remoteId?: string | null;
+ description?: string | null;
+ marketingChannelType?: string | null;
+ sourceAndMedium?: string | null;
+ channelHandle?: string | null;
+ startedAt?: string | null;
+ endedAt?: string | null;
+ scheduledToEndAt?: string | null;
+ manageUrl?: string | null;
+ previewUrl?: string | null;
+ utmCampaign?: string | null;
+ utmMedium?: string | null;
+ utmSource?: string | null;
+ app?: { id?: string | null; title?: string | null } | null;
+};
+
+export type GqlMarketingActivity = {
+ id: string;
+ title?: string | null;
+ status?: string | null;
+ statusLabel?: string | null;
+ tactic?: string | null;
+ marketingChannelType?: string | null;
+ sourceAndMedium?: string | null;
+ isExternal?: boolean | null;
+ hierarchyLevel?: string | null;
+ parentRemoteId?: string | null;
+ parentActivityId?: string | null;
+ urlParameterValue?: string | null;
+ activityListUrl?: string | null;
+ statusTransitionedAt?: string | null;
+ createdAt?: string | null;
+ updatedAt?: string | null;
+ utmParameters?: { campaign?: string | null; source?: string | null; medium?: string | null } | null;
+ budget?: { budgetType?: string | null; total?: GqlMoneyV2 | null } | null;
+ adSpend?: GqlMoneyV2 | null;
+ marketingEvent?: {
+ id?: string | null;
+ remoteId?: string | null;
+ manageUrl?: string | null;
+ previewUrl?: string | null;
+ startedAt?: string | null;
+ endedAt?: string | null;
+ scheduledToEndAt?: string | null;
+ utmCampaign?: string | null;
+ utmSource?: string | null;
+ utmMedium?: string | null;
+ } | null;
+};
+
+export type GqlMarketingEngagement = {
+ occurredOn?: string | null;
+ utcOffset?: string | null;
+ channelHandle?: string | null;
+ impressionsCount?: number | null;
+ viewsCount?: number | null;
+ clicksCount?: number | null;
+ sharesCount?: number | null;
+ favoritesCount?: number | null;
+ commentsCount?: number | null;
+ unsubscribesCount?: number | null;
+ complaintsCount?: number | null;
+ failsCount?: number | null;
+ sendsCount?: number | null;
+ uniqueViewsCount?: number | null;
+ uniqueClicksCount?: number | null;
+ sessionsCount?: number | null;
+ orders?: string | null;
+ firstTimeCustomers?: string | null;
+ returningCustomers?: string | null;
+ primaryConversions?: string | null;
+ allConversions?: string | null;
+ adSpend?: GqlMoneyV2 | null;
+ sales?: GqlMoneyV2 | null;
+ marketingActivity?: { id?: string | null; title?: string | null } | null;
+};
+
+export type GqlScriptTag = {
+ id: string;
+ legacyResourceId?: string | null;
+ src?: string | null;
+ displayScope?: string | null;
+ cache?: boolean | null;
+ createdAt?: string | null;
+ updatedAt?: string | null;
+};
+
+export type GqlEvent = {
+ __typename?: string | null;
+ id: string;
+ action?: string | null;
+ message?: string | null;
+ secondaryMessage?: string | null;
+ rawMessage?: string | null;
+ subjectId?: string | null;
+ subjectType?: string | null;
+ author?: string | null;
+ appTitle?: string | null;
+ attributeToApp?: boolean | null;
+ attributeToUser?: boolean | null;
+ criticalAlert?: boolean | null;
+ edited?: boolean | null;
+ createdAt?: string | null;
+};
+
+export type GqlBulkOperation = {
+ id: string;
+ status?: string | null;
+ type?: string | null;
+ errorCode?: string | null;
+ createdAt?: string | null;
+ completedAt?: string | null;
+ objectCount?: string | null;
+ rootObjectCount?: string | null;
+ fileSize?: string | null;
+ url?: string | null;
+ partialDataUrl?: string | null;
+ query?: string | null;
+};
+
+export type GqlCurrencySetting = {
+ currencyCode?: string | null;
+ currencyName?: string | null;
+ enabled?: boolean | null;
+ manualRate?: string | null;
+ rateUpdatedAt?: string | null;
+};
+
+export type GqlShopPolicy = {
+ id: string;
+ type?: string | null;
+ title?: string | null;
+ url?: string | null;
+ body?: string | null;
+ createdAt?: string | null;
+ updatedAt?: string | null;
+};
+
+export type GqlLocale = {
+ isoCode?: string | null;
+ name?: string | null;
+};
+
+export type GqlDomain = {
+ id: string;
+ host?: string | null;
+ url?: string | null;
+ sslEnabled?: boolean | null;
+ localization?: {
+ defaultLocale?: string | null;
+ alternateLocales?: string[] | null;
+ country?: string | null;
+ } | null;
+ marketWebPresence?: {
+ id?: string | null;
+ subfolderSuffix?: string | null;
+ rootUrls?: { locale?: string | null; url?: string | null }[] | null;
+ } | null;
+};
+
+export type GqlCustomerAccountPage = {
+ __typename?: string | null;
+ id: string;
+ handle?: string | null;
+ title?: string | null;
+ defaultCursor?: string | null;
+ pageType?: string | null;
+ appExtensionUuid?: string | null;
+};
+
+export type GqlConsentPolicy = {
+ id: string;
+ countryCode?: string | null;
+ regionCode?: string | null;
+ consentRequired?: boolean | null;
+ dataSaleOptOutRequired?: boolean | null;
+ shopId?: string | null;
+};
+
+export type GqlConsentPolicyRegion = {
+ countryCode?: string | null;
+ regionCode?: string | null;
+};
+
+export type GqlCatalog = {
+ __typename?: string | null;
+ id: string;
+ title?: string | null;
+ status?: string | null;
+ priceList?: { id?: string | null; name?: string | null; currency?: string | null } | null;
+ publication?: { id?: string | null } | null;
+ marketsCount?: GqlCount | null;
+ companyLocationsCount?: GqlCount | null;
+};
+
+export type GqlBusinessEntity = {
+ id: string;
+ displayName?: string | null;
+ companyName?: string | null;
+ primary?: boolean | null;
+ archived?: boolean | null;
+ legalEntityId?: string | null;
+ address?: {
+ address1?: string | null;
+ address2?: string | null;
+ city?: string | null;
+ province?: string | null;
+ zip?: string | null;
+ countryCode?: string | null;
+ } | null;
+};
+
+export type GqlPaymentTermsTemplate = {
+ id: string;
+ name?: string | null;
+ translatedName?: string | null;
+ description?: string | null;
+ dueInDays?: number | null;
+ paymentTermsType?: string | null;
+};
+
+export type GqlDispute = {
+ id: string;
+ legacyResourceId?: string | null;
+ status?: string | null;
+ type?: string | null;
+ initiatedAt?: string | null;
+ evidenceDueBy?: string | null;
+ evidenceSentOn?: string | null;
+ finalizedOn?: string | null;
+ amount?: GqlMoneyV2 | null;
+ reasonDetails?: { reason?: string | null; networkReasonCode?: string | null } | null;
+ order?: { id?: string | null; name?: string | null } | null;
+};
+
+export type GqlShopPayReceipt = {
+ token?: string | null;
+ sourceIdentifier?: string | null;
+ createdAt?: string | null;
+ processingStatus?: { state?: string | null; message?: string | null; errorCode?: string | null } | null;
+ order?: { id?: string | null; name?: string | null } | null;
+ paymentRequest?: {
+ presentmentCurrency?: string | null;
+ total?: GqlMoneyV2 | null;
+ subtotal?: GqlMoneyV2 | null;
+ totalTax?: GqlMoneyV2 | null;
+ } | null;
+};
+
+export type GqlWebPresence = {
+ id: string;
+ subfolderSuffix?: string | null;
+ domain?: { id?: string | null; host?: string | null; url?: string | null } | null;
+ defaultLocale?: { locale?: string | null } | null;
+ rootUrls?: { locale?: string | null; url?: string | null }[] | null;
+};
+
+export type GqlSavedSearch = {
+ id: string;
+ name?: string | null;
+ query?: string | null;
+ searchTerms?: string | null;
+ resourceType?: string | null;
+};
+
+export type GqlStagedTarget = {
+ url?: string | null;
+ resourceUrl?: string | null;
+ parameters?: { name: string; value: string }[] | null;
+};
diff --git a/packages/pieces/community/shopify/src/lib/common/markets.ts b/packages/pieces/community/shopify/src/lib/common/markets.ts
new file mode 100644
index 00000000000..ce7d1ec0ed8
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/common/markets.ts
@@ -0,0 +1,314 @@
+import { GqlConnection, GqlCount } from './graphql';
+
+const MARKET_LIST_NESTED_LIMIT = 10;
+const MARKET_LIST_WEB_PRESENCE_LIMIT = 5;
+const MARKET_DETAIL_RELATIVES_LIMIT = 50;
+const MARKET_DETAIL_REGIONS_LIMIT = 100;
+const MARKET_DETAIL_CONDITION_LIMIT = 50;
+const MARKET_DETAIL_CATALOGS_LIMIT = 10;
+const MARKET_DETAIL_WEB_PRESENCE_LIMIT = 10;
+
+const MARKET_REGION_NODE_FIELDS =
+ 'id name ... on MarketRegionCountry { countryCode: code } ... on MarketRegionSubdivision { subdivisionCode: code }';
+
+const RETURN_POLICY_RULES_FIELDS =
+ 'returnRules { canAcceptReturns returnWindowDays returnWindowStartingFrom extendWindowToBusinessDay } editRules { canAcceptEdits editWindowMinutes }';
+
+const RETURN_POLICY_PROFILE_FIELDS = `id name default updatedAt ${RETURN_POLICY_RULES_FIELDS} markets { id name handle }`;
+
+const MARKET_RETURN_POLICY_PROFILE_FIELDS = `id name default updatedAt ${RETURN_POLICY_RULES_FIELDS}`;
+
+const MARKET_SUMMARY_FIELDS = `id name handle status type parentMarkets(first: ${MARKET_LIST_NESTED_LIMIT}) { nodes { id name } pageInfo { hasNextPage } } childMarkets(first: ${MARKET_LIST_NESTED_LIMIT}) { nodes { id name } pageInfo { hasNextPage } } returnPolicyProfile { id name default } conditions { conditionTypes regionsCondition { applicationLevel regions(first: ${MARKET_LIST_NESTED_LIMIT}) { nodes { ${MARKET_REGION_NODE_FIELDS} } pageInfo { hasNextPage } } } } currencySettings { baseCurrency { currencyCode } localCurrencies } webPresences(first: ${MARKET_LIST_WEB_PRESENCE_LIMIT}) { nodes { id subfolderSuffix domain { host } } pageInfo { hasNextPage } }`;
+
+const MARKET_DETAIL_FIELDS = `id name handle status type parentMarketsCount { count } childMarketsCount { count } parentMarkets(first: ${MARKET_DETAIL_RELATIVES_LIMIT}) { nodes { id name handle } pageInfo { hasNextPage } } childMarkets(first: ${MARKET_DETAIL_RELATIVES_LIMIT}) { nodes { id name handle } pageInfo { hasNextPage } } returnPolicyProfile { ${MARKET_RETURN_POLICY_PROFILE_FIELDS} } conditions { conditionTypes regionsCondition { applicationLevel regions(first: ${MARKET_DETAIL_REGIONS_LIMIT}) { nodes { ${MARKET_REGION_NODE_FIELDS} } pageInfo { hasNextPage } } } locationsCondition { applicationLevel locations(first: ${MARKET_DETAIL_CONDITION_LIMIT}) { nodes { id name } pageInfo { hasNextPage } } } companyLocationsCondition { applicationLevel companyLocations(first: ${MARKET_DETAIL_CONDITION_LIMIT}) { nodes { id name } pageInfo { hasNextPage } } } channelsCondition { applicationLevel channels(first: ${MARKET_DETAIL_CONDITION_LIMIT}) { nodes { id name } pageInfo { hasNextPage } } } } currencySettings { baseCurrency { currencyCode currencyName } localCurrencies roundingEnabled } priceInclusions { inclusiveTaxPricingStrategy inclusiveDutiesPricingStrategy } catalogsCount { count } catalogs(first: ${MARKET_DETAIL_CATALOGS_LIMIT}) { nodes { id title status priceList { id name currency } } pageInfo { hasNextPage } } webPresences(first: ${MARKET_DETAIL_WEB_PRESENCE_LIMIT}) { nodes { id subfolderSuffix domain { host } defaultLocale { locale } rootUrls { locale url } } pageInfo { hasNextPage } }`;
+
+const MARKET_RELATIONSHIP_FIELDS = 'id parentMarket { id name handle } childMarket { id name handle }';
+
+function nodesOf<TNode>(connection: GqlConnection<TNode> | null | undefined): TNode[] {
+ return connection?.nodes ?? [];
+}
+
+function isTruncated(connection: GqlConnection<unknown> | null | undefined): boolean {
+ return connection?.pageInfo?.hasNextPage ?? false;
+}
+
+function mapNamedRefs(connection: GqlConnection<GqlNamedRef> | null | undefined) {
+ return nodesOf(connection).map((node) => ({
+ id: node.id,
+ name: node.name ?? null,
+ }));
+}
+
+function mapMarketRefs(connection: GqlConnection<GqlNamedRef> | null | undefined) {
+ return nodesOf(connection).map((node) => ({
+ id: node.id,
+ name: node.name ?? null,
+ handle: node.handle ?? null,
+ }));
+}
+
+function mapRegions(connection: GqlConnection<GqlMarketRegion> | null | undefined) {
+ return nodesOf(connection).map((region) => ({
+ id: region.id,
+ name: region.name ?? null,
+ code: region.countryCode ?? region.subdivisionCode ?? null,
+ }));
+}
+
+function mapReturnPolicyRules(profile: GqlReturnPolicyProfile) {
+ const returnRules = profile.returnRules ?? null;
+ const editRules = profile.editRules ?? null;
+ return {
+ return_rules_enabled: returnRules !== null,
+ can_accept_returns: returnRules?.canAcceptReturns ?? null,
+ return_window_days: returnRules?.returnWindowDays ?? null,
+ return_window_starting_from: returnRules?.returnWindowStartingFrom ?? null,
+ extend_window_to_business_day: returnRules?.extendWindowToBusinessDay ?? null,
+ edit_rules_enabled: editRules !== null,
+ can_accept_edits: editRules?.canAcceptEdits ?? null,
+ edit_window_minutes: editRules?.editWindowMinutes ?? null,
+ };
+}
+
+function mapReturnPolicyProfile(profile: GqlReturnPolicyProfile) {
+ return {
+ id: profile.id,
+ name: profile.name ?? null,
+ is_default: profile.default ?? null,
+ updated_at: profile.updatedAt ?? null,
+ ...mapReturnPolicyRules(profile),
+ markets: (profile.markets ?? []).map((market) => ({
+ id: market.id,
+ name: market.name ?? null,
+ handle: market.handle ?? null,
+ })),
+ };
+}
+
+function mapMarketSummary(market: GqlMarket) {
+ const regions = market.conditions?.regionsCondition?.regions;
+ return {
+ id: market.id,
+ name: market.name ?? null,
+ handle: market.handle ?? null,
+ status: market.status ?? null,
+ type: market.type ?? null,
+ condition_types: market.conditions?.conditionTypes ?? [],
+ region_application_level: market.conditions?.regionsCondition?.applicationLevel ?? null,
+ regions: mapRegions(regions),
+ regions_truncated: isTruncated(regions),
+ parent_markets: mapNamedRefs(market.parentMarkets),
+ parent_markets_truncated: isTruncated(market.parentMarkets),
+ child_markets: mapNamedRefs(market.childMarkets),
+ child_markets_truncated: isTruncated(market.childMarkets),
+ return_policy_profile_id: market.returnPolicyProfile?.id ?? null,
+ return_policy_profile_name: market.returnPolicyProfile?.name ?? null,
+ return_policy_profile_is_default: market.returnPolicyProfile?.default ?? null,
+ base_currency_code: market.currencySettings?.baseCurrency?.currencyCode ?? null,
+ local_currencies: market.currencySettings?.localCurrencies ?? null,
+ web_presences: nodesOf(market.webPresences).map((presence) => ({
+ id: presence.id,
+ subfolder_suffix: presence.subfolderSuffix ?? null,
+ domain_host: presence.domain?.host ?? null,
+ })),
+ web_presences_truncated: isTruncated(market.webPresences),
+ };
+}
+
+function mapMarketDetail(market: GqlMarket) {
+ const conditions = market.conditions;
+ const regions = conditions?.regionsCondition?.regions;
+ const locations = conditions?.locationsCondition?.locations;
+ const companyLocations = conditions?.companyLocationsCondition?.companyLocations;
+ const channels = conditions?.channelsCondition?.channels;
+ const profile = market.returnPolicyProfile;
+ return {
+ id: market.id,
+ name: market.name ?? null,
+ handle: market.handle ?? null,
+ status: market.status ?? null,
+ type: market.type ?? null,
+ condition_types: conditions?.conditionTypes ?? [],
+ region_application_level: conditions?.regionsCondition?.applicationLevel ?? null,
+ regions: mapRegions(regions),
+ regions_truncated: isTruncated(regions),
+ location_application_level: conditions?.locationsCondition?.applicationLevel ?? null,
+ locations: mapNamedRefs(locations),
+ locations_truncated: isTruncated(locations),
+ company_location_application_level: conditions?.companyLocationsCondition?.applicationLevel ?? null,
+ company_locations: mapNamedRefs(companyLocations),
+ company_locations_truncated: isTruncated(companyLocations),
+ channel_application_level: conditions?.channelsCondition?.applicationLevel ?? null,
+ channels: mapNamedRefs(channels),
+ channels_truncated: isTruncated(channels),
+ parent_markets_count: market.parentMarketsCount?.count ?? null,
+ parent_markets: mapMarketRefs(market.parentMarkets),
+ parent_markets_truncated: isTruncated(market.parentMarkets),
+ child_markets_count: market.childMarketsCount?.count ?? null,
+ child_markets: mapMarketRefs(market.childMarkets),
+ child_markets_truncated: isTruncated(market.childMarkets),
+ base_currency_code: market.currencySettings?.baseCurrency?.currencyCode ?? null,
+ base_currency_name: market.currencySettings?.baseCurrency?.currencyName ?? null,
+ local_currencies: market.currencySettings?.localCurrencies ?? null,
+ rounding_enabled: market.currencySettings?.roundingEnabled ?? null,
+ inclusive_tax_pricing_strategy: market.priceInclusions?.inclusiveTaxPricingStrategy ?? null,
+ inclusive_duties_pricing_strategy: market.priceInclusions?.inclusiveDutiesPricingStrategy ?? null,
+ catalogs_count: market.catalogsCount?.count ?? null,
+ catalogs: nodesOf(market.catalogs).map((catalog) => ({
+ id: catalog.id,
+ title: catalog.title ?? null,
+ status: catalog.status ?? null,
+ price_list_id: catalog.priceList?.id ?? null,
+ price_list_name: catalog.priceList?.name ?? null,
+ price_list_currency: catalog.priceList?.currency ?? null,
+ })),
+ catalogs_truncated: isTruncated(market.catalogs),
+ web_presences: nodesOf(market.webPresences).map((presence) => ({
+ id: presence.id,
+ subfolder_suffix: presence.subfolderSuffix ?? null,
+ domain_host: presence.domain?.host ?? null,
+ default_locale: presence.defaultLocale?.locale ?? null,
+ root_urls: (presence.rootUrls ?? []).map((root) => ({
+ locale: root.locale ?? null,
+ url: root.url ?? null,
+ })),
+ })),
+ web_presences_truncated: isTruncated(market.webPresences),
+ return_policy_profile_id: profile?.id ?? null,
+ return_policy_profile_name: profile?.name ?? null,
+ return_policy_profile_is_default: profile?.default ?? null,
+ return_policy: profile ? mapReturnPolicyRules(profile) : null,
+ };
+}
+
+function mapMarketRelationship(relationship: GqlMarketRelationship) {
+ return {
+ id: relationship.id,
+ parent_market_id: relationship.parentMarket?.id ?? null,
+ parent_market_name: relationship.parentMarket?.name ?? null,
+ parent_market_handle: relationship.parentMarket?.handle ?? null,
+ child_market_id: relationship.childMarket?.id ?? null,
+ child_market_name: relationship.childMarket?.name ?? null,
+ child_market_handle: relationship.childMarket?.handle ?? null,
+ };
+}
+
+const MARKET_TYPES = ['REGION', 'LOCATION', 'COMPANY_LOCATION', 'CHANNEL', 'NONE'];
+
+const MARKET_SORT_KEYS = [
+ 'NAME',
+ 'CREATED_AT',
+ 'UPDATED_AT',
+ 'STATUS',
+ 'MARKET_TYPE',
+ 'MARKET_CONDITION_TYPES',
+ 'ID',
+];
+
+export const marketsFields = {
+ MARKET_SUMMARY_FIELDS,
+ MARKET_DETAIL_FIELDS,
+ MARKET_RELATIONSHIP_FIELDS,
+ RETURN_POLICY_PROFILE_FIELDS,
+ MARKET_TYPES,
+ MARKET_SORT_KEYS,
+};
+
+export const marketsMappers = {
+ mapMarketSummary,
+ mapMarketDetail,
+ mapMarketRelationship,
+ mapReturnPolicyProfile,
+};
+
+type GqlNamedRef = {
+ id: string;
+ name?: string | null;
+ handle?: string | null;
+};
+
+type GqlMarketRegion = {
+ id: string;
+ name?: string | null;
+ countryCode?: string | null;
+ subdivisionCode?: string | null;
+};
+
+export type GqlReturnPolicyProfile = {
+ id: string;
+ name?: string | null;
+ default?: boolean | null;
+ updatedAt?: string | null;
+ returnRules?: {
+ canAcceptReturns?: boolean | null;
+ returnWindowDays?: number | null;
+ returnWindowStartingFrom?: string | null;
+ extendWindowToBusinessDay?: boolean | null;
+ } | null;
+ editRules?: {
+ canAcceptEdits?: boolean | null;
+ editWindowMinutes?: number | null;
+ } | null;
+ markets?: GqlNamedRef[] | null;
+};
+
+export type GqlMarket = {
+ id: string;
+ name?: string | null;
+ handle?: string | null;
+ status?: string | null;
+ type?: string | null;
+ parentMarketsCount?: GqlCount | null;
+ childMarketsCount?: GqlCount | null;
+ parentMarkets?: GqlConnection<GqlNamedRef> | null;
+ childMarkets?: GqlConnection<GqlNamedRef> | null;
+ returnPolicyProfile?: GqlReturnPolicyProfile | null;
+ conditions?: {
+ conditionTypes?: string[] | null;
+ regionsCondition?: {
+ applicationLevel?: string | null;
+ regions?: GqlConnection<GqlMarketRegion> | null;
+ } | null;
+ locationsCondition?: {
+ applicationLevel?: string | null;
+ locations?: GqlConnection<GqlNamedRef> | null;
+ } | null;
+ companyLocationsCondition?: {
+ applicationLevel?: string | null;
+ companyLocations?: GqlConnection<GqlNamedRef> | null;
+ } | null;
+ channelsCondition?: {
+ applicationLevel?: string | null;
+ channels?: GqlConnection<GqlNamedRef> | null;
+ } | null;
+ } | null;
+ currencySettings?: {
+ baseCurrency?: { currencyCode?: string | null; currencyName?: string | null } | null;
+ localCurrencies?: boolean | null;
+ roundingEnabled?: boolean | null;
+ } | null;
+ priceInclusions?: {
+ inclusiveTaxPricingStrategy?: string | null;
+ inclusiveDutiesPricingStrategy?: string | null;
+ } | null;
+ catalogsCount?: GqlCount | null;
+ catalogs?: GqlConnection<{
+ id: string;
+ title?: string | null;
+ status?: string | null;
+ priceList?: { id: string; name?: string | null; currency?: string | null } | null;
+ }> | null;
+ webPresences?: GqlConnection<{
+ id: string;
+ subfolderSuffix?: string | null;
+ domain?: { host?: string | null } | null;
+ defaultLocale?: { locale?: string | null } | null;
+ rootUrls?: { locale?: string | null; url?: string | null }[] | null;
+ }> | null;
+};
+
+export type GqlMarketRelationship = {
+ id: string;
+ parentMarket?: GqlNamedRef | null;
+ childMarket?: GqlNamedRef | null;
+};
diff --git a/packages/pieces/community/shopify/src/lib/output-schemas/analytics.ts b/packages/pieces/community/shopify/src/lib/output-schemas/analytics.ts
new file mode 100644
index 00000000000..19eee76b6c2
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/output-schemas/analytics.ts
@@ -0,0 +1,107 @@
+import { OutputSchema, OutputSchemaField } from '@activepieces/pieces-framework';
+
+const redactedFieldsField: OutputSchemaField = {
+ key: 'redacted_fields',
+ label: 'Redacted Fields',
+ description: 'Response paths Shopify withheld.',
+};
+
+const pagingFields: OutputSchema['fields'] = [
+ { key: 'count', label: 'Count', format: 'number' },
+ { key: 'has_next_page', label: 'Has Next Page', format: 'boolean' },
+ {
+ key: 'end_cursor',
+ label: 'End Cursor',
+ description: 'Pass back as the cursor to read the next page.',
+ },
+ redactedFieldsField,
+];
+
+const analyticsTargetFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'Analytics Target ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'metric', label: 'Metric', description: 'ShopifyQL metric identifier, for example total_sales.' },
+ { key: 'start_date', label: 'Start Date', format: 'date' },
+ { key: 'end_date', label: 'End Date', format: 'date' },
+ {
+ key: 'expected_value',
+ label: 'Expected Value',
+ description: 'The goal as an exact decimal string.',
+ },
+ { key: 'currency_code', label: 'Currency' },
+ { key: 'filters', label: 'Filters', description: "ShopifyQL filter expression, for example shipping_country = 'US'." },
+ {
+ key: 'shopifyql_query',
+ label: 'ShopifyQL Query',
+ description: 'Generated query that returns the current value of the metric for this target.',
+ },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+];
+
+const analyticsAnnotationFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'Analytics Annotation ID' },
+ { key: 'type', label: 'Type' },
+ { key: 'title', label: 'Title' },
+ { key: 'description', label: 'Description' },
+ { key: 'started_at', label: 'Started At', format: 'datetime' },
+ {
+ key: 'ended_at',
+ label: 'Ended At',
+ format: 'datetime',
+ description: 'Empty for a point-in-time or open-ended annotation.',
+ },
+ { key: 'source', label: 'Source', description: 'APP for annotations created by this connection.' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+];
+
+export const analyticsTargetOutputSchema: OutputSchema = {
+ fields: [...analyticsTargetFields, redactedFieldsField],
+};
+
+export const createAnalyticsTargetOutputSchema: OutputSchema = {
+ fields: [
+ ...analyticsTargetFields,
+ {
+ key: 'already_existed',
+ label: 'Already Existed',
+ format: 'boolean',
+ description:
+ 'True when a target with the same metric, dates and filters already existed; it is returned unchanged.',
+ },
+ redactedFieldsField,
+ ],
+};
+
+export const listAnalyticsTargetsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'items', label: 'Analytics Targets', labelKey: 'name', listItems: analyticsTargetFields },
+ ...pagingFields,
+ ],
+};
+
+export const deleteAnalyticsTargetsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'deleted_ids', label: 'Deleted Target IDs' },
+ { key: 'deleted_count', label: 'Deleted Count', format: 'number' },
+ {
+ key: 'not_deleted_ids',
+ label: 'Not Deleted Target IDs',
+ description: 'Requested ids Shopify did not delete, usually because they were not found.',
+ },
+ { key: 'errors', label: 'Errors', description: 'Shopify messages for the ids that were not deleted.' },
+ redactedFieldsField,
+ ],
+};
+
+export const analyticsAnnotationOutputSchema: OutputSchema = {
+ fields: [...analyticsAnnotationFields, redactedFieldsField],
+};
+
+export const deleteAnalyticsAnnotationOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'deleted_annotation_id', label: 'Deleted Annotation ID' },
+ redactedFieldsField,
+ ],
+};
diff --git a/packages/pieces/community/shopify/src/lib/output-schemas/markets.ts b/packages/pieces/community/shopify/src/lib/output-schemas/markets.ts
new file mode 100644
index 00000000000..c3e96346c9c
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/output-schemas/markets.ts
@@ -0,0 +1,240 @@
+import { OutputSchema, OutputSchemaField } from '@activepieces/pieces-framework';
+
+const redactedFieldsField: OutputSchemaField = {
+ key: 'redacted_fields',
+ label: 'Redacted Fields',
+ description:
+ 'Response paths Shopify withheld, for example the return policy fields when the token lacks read_legal_policies.',
+};
+
+const pagingFields: OutputSchema['fields'] = [
+ { key: 'count', label: 'Count', format: 'number' },
+ { key: 'has_next_page', label: 'Has Next Page', format: 'boolean' },
+ {
+ key: 'end_cursor',
+ label: 'End Cursor',
+ description: 'Pass back as the cursor to read the next page.',
+ },
+ redactedFieldsField,
+];
+
+const marketRefFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'Market ID' },
+ { key: 'name', label: 'Name' },
+];
+
+const marketRefWithHandleFields: OutputSchema['fields'] = [
+ ...marketRefFields,
+ { key: 'handle', label: 'Handle' },
+];
+
+const namedRefFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'ID' },
+ { key: 'name', label: 'Name' },
+];
+
+const regionFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'Region ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'code', label: 'Code', description: 'Country code (for example CA) or subdivision code.' },
+];
+
+const returnPolicyRuleFields: OutputSchema['fields'] = [
+ {
+ key: 'return_rules_enabled',
+ label: 'Return Rules Enabled',
+ format: 'boolean',
+ description: 'False means return rules are off and customers can return items without restrictions.',
+ },
+ { key: 'can_accept_returns', label: 'Accepts Returns', format: 'boolean' },
+ {
+ key: 'return_window_days',
+ label: 'Return Window (Days)',
+ format: 'number',
+ description: '-1 means an unlimited return window.',
+ },
+ {
+ key: 'return_window_starting_from',
+ label: 'Return Window Starts From',
+ description: 'ITEM_DELIVERY_DATE or LAST_ITEM_DELIVERY_DATE.',
+ },
+ { key: 'extend_window_to_business_day', label: 'Extend To Business Day', format: 'boolean' },
+ {
+ key: 'edit_rules_enabled',
+ label: 'Edit Rules Enabled',
+ format: 'boolean',
+ description: 'False means customers can request cancellations without restrictions.',
+ },
+ { key: 'can_accept_edits', label: 'Accepts Edits', format: 'boolean' },
+ {
+ key: 'edit_window_minutes',
+ label: 'Edit Window (Minutes)',
+ format: 'number',
+ description: '-1 means until fulfillment.',
+ },
+];
+
+const marketIdentityFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'Market ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'handle', label: 'Handle' },
+ { key: 'status', label: 'Status', description: 'ACTIVE or DRAFT.' },
+ { key: 'type', label: 'Type', description: 'REGION, LOCATION, COMPANY_LOCATION, CHANNEL or NONE.' },
+ { key: 'condition_types', label: 'Condition Types' },
+ { key: 'region_application_level', label: 'Region Application Level', description: 'SPECIFIED or ALL.' },
+ { key: 'regions', label: 'Regions', labelKey: 'name', listItems: regionFields },
+ { key: 'regions_truncated', label: 'Regions Truncated', format: 'boolean' },
+];
+
+const marketSummaryFields: OutputSchema['fields'] = [
+ ...marketIdentityFields,
+ { key: 'parent_markets', label: 'Parent Markets', labelKey: 'name', listItems: marketRefFields },
+ { key: 'parent_markets_truncated', label: 'Parent Markets Truncated', format: 'boolean' },
+ { key: 'child_markets', label: 'Child Markets', labelKey: 'name', listItems: marketRefFields },
+ { key: 'child_markets_truncated', label: 'Child Markets Truncated', format: 'boolean' },
+ { key: 'return_policy_profile_id', label: 'Return Policy Profile ID' },
+ { key: 'return_policy_profile_name', label: 'Return Policy Profile Name' },
+ { key: 'return_policy_profile_is_default', label: 'Uses Default Return Policy', format: 'boolean' },
+ { key: 'base_currency_code', label: 'Base Currency' },
+ { key: 'local_currencies', label: 'Local Currencies', format: 'boolean' },
+ {
+ key: 'web_presences',
+ label: 'Web Presences',
+ labelKey: 'domain_host',
+ listItems: [
+ { key: 'id', label: 'Web Presence ID' },
+ { key: 'subfolder_suffix', label: 'Subfolder Suffix' },
+ { key: 'domain_host', label: 'Domain Host' },
+ ],
+ },
+ { key: 'web_presences_truncated', label: 'Web Presences Truncated', format: 'boolean' },
+];
+
+const marketDetailFields: OutputSchema['fields'] = [
+ ...marketIdentityFields,
+ { key: 'location_application_level', label: 'Location Application Level' },
+ { key: 'locations', label: 'Locations', labelKey: 'name', listItems: namedRefFields },
+ { key: 'locations_truncated', label: 'Locations Truncated', format: 'boolean' },
+ { key: 'company_location_application_level', label: 'Company Location Application Level' },
+ { key: 'company_locations', label: 'Company Locations', labelKey: 'name', listItems: namedRefFields },
+ { key: 'company_locations_truncated', label: 'Company Locations Truncated', format: 'boolean' },
+ { key: 'channel_application_level', label: 'Channel Application Level' },
+ { key: 'channels', label: 'Channels', labelKey: 'name', listItems: namedRefFields },
+ { key: 'channels_truncated', label: 'Channels Truncated', format: 'boolean' },
+ { key: 'parent_markets_count', label: 'Parent Markets Count', format: 'number' },
+ { key: 'parent_markets', label: 'Parent Markets', labelKey: 'name', listItems: marketRefWithHandleFields },
+ { key: 'parent_markets_truncated', label: 'Parent Markets Truncated', format: 'boolean' },
+ { key: 'child_markets_count', label: 'Child Markets Count', format: 'number' },
+ { key: 'child_markets', label: 'Child Markets', labelKey: 'name', listItems: marketRefWithHandleFields },
+ { key: 'child_markets_truncated', label: 'Child Markets Truncated', format: 'boolean' },
+ { key: 'base_currency_code', label: 'Base Currency' },
+ { key: 'base_currency_name', label: 'Base Currency Name' },
+ { key: 'local_currencies', label: 'Local Currencies', format: 'boolean' },
+ { key: 'rounding_enabled', label: 'Rounding Enabled', format: 'boolean' },
+ { key: 'inclusive_tax_pricing_strategy', label: 'Tax-Inclusive Pricing' },
+ { key: 'inclusive_duties_pricing_strategy', label: 'Duties-Inclusive Pricing' },
+ { key: 'catalogs_count', label: 'Catalogs Count', format: 'number' },
+ {
+ key: 'catalogs',
+ label: 'Catalogs',
+ labelKey: 'title',
+ listItems: [
+ { key: 'id', label: 'Catalog ID' },
+ { key: 'title', label: 'Title' },
+ { key: 'status', label: 'Status' },
+ { key: 'price_list_id', label: 'Price List ID' },
+ { key: 'price_list_name', label: 'Price List Name' },
+ { key: 'price_list_currency', label: 'Price List Currency' },
+ ],
+ },
+ { key: 'catalogs_truncated', label: 'Catalogs Truncated', format: 'boolean' },
+ {
+ key: 'web_presences',
+ label: 'Web Presences',
+ labelKey: 'domain_host',
+ listItems: [
+ { key: 'id', label: 'Web Presence ID' },
+ { key: 'subfolder_suffix', label: 'Subfolder Suffix' },
+ { key: 'domain_host', label: 'Domain Host' },
+ { key: 'default_locale', label: 'Default Locale' },
+ {
+ key: 'root_urls',
+ label: 'Root URLs',
+ labelKey: 'locale',
+ listItems: [
+ { key: 'locale', label: 'Locale' },
+ { key: 'url', label: 'URL', format: 'url' },
+ ],
+ },
+ ],
+ },
+ { key: 'web_presences_truncated', label: 'Web Presences Truncated', format: 'boolean' },
+ { key: 'return_policy_profile_id', label: 'Return Policy Profile ID' },
+ { key: 'return_policy_profile_name', label: 'Return Policy Profile Name' },
+ { key: 'return_policy_profile_is_default', label: 'Uses Default Return Policy', format: 'boolean' },
+ { key: 'return_policy', label: 'Return Policy', children: returnPolicyRuleFields },
+];
+
+const marketRelationshipFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'Relationship ID' },
+ { key: 'parent_market_id', label: 'Parent Market ID' },
+ { key: 'parent_market_name', label: 'Parent Market Name' },
+ { key: 'parent_market_handle', label: 'Parent Market Handle' },
+ { key: 'child_market_id', label: 'Child Market ID' },
+ { key: 'child_market_name', label: 'Child Market Name' },
+ { key: 'child_market_handle', label: 'Child Market Handle' },
+];
+
+const returnPolicyProfileFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'Return Policy Profile ID' },
+ { key: 'name', label: 'Name', description: 'Empty for the default profile.' },
+ { key: 'is_default', label: 'Is Default', format: 'boolean' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ ...returnPolicyRuleFields,
+ { key: 'markets', label: 'Markets', labelKey: 'name', listItems: marketRefWithHandleFields },
+];
+
+export const listMarketsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'items', label: 'Markets', labelKey: 'name', listItems: marketSummaryFields },
+ ...pagingFields,
+ ],
+};
+
+export const marketOutputSchema: OutputSchema = {
+ fields: [...marketDetailFields, redactedFieldsField],
+};
+
+export const listMarketRelationshipsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'items',
+ label: 'Market Relationships',
+ labelKey: 'child_market_name',
+ listItems: marketRelationshipFields,
+ },
+ {
+ key: 'relationships_version',
+ label: 'Relationships Version',
+ description:
+ 'Opaque id of the relationship build that was read. It changes after Shopify finishes rebuilding the hierarchy.',
+ },
+ ...pagingFields,
+ ],
+};
+
+export const returnPolicyProfileOutputSchema: OutputSchema = {
+ fields: [...returnPolicyProfileFields, redactedFieldsField],
+};
+
+export const listReturnPolicyProfilesOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'items',
+ label: 'Return Policy Profiles',
+ labelKey: 'name',
+ listItems: returnPolicyProfileFields,
+ },
+ ...pagingFields,
+ ],
+};
diff --git a/packages/pieces/community/shopify/src/lib/output-schemas/store.ts b/packages/pieces/community/shopify/src/lib/output-schemas/store.ts
new file mode 100644
index 00000000000..6651b1415a0
--- /dev/null
+++ b/packages/pieces/community/shopify/src/lib/output-schemas/store.ts
@@ -0,0 +1,612 @@
+import { OutputSchema, OutputSchemaField } from '@activepieces/pieces-framework';
+
+const redactedFieldsField: OutputSchemaField = {
+ key: 'redacted_fields',
+ label: 'Redacted Fields',
+ description:
+ 'Response paths Shopify withheld, for example because the app is not approved for protected customer data.',
+};
+
+const pagingFields: OutputSchema['fields'] = [
+ { key: 'count', label: 'Count', format: 'number' },
+ { key: 'has_next_page', label: 'Has Next Page', format: 'boolean' },
+ {
+ key: 'end_cursor',
+ label: 'End Cursor',
+ description: 'Pass back as the cursor to read the next page.',
+ },
+ redactedFieldsField,
+];
+
+const countOnlyFields: OutputSchema['fields'] = [
+ { key: 'count', label: 'Count', format: 'number' },
+ redactedFieldsField,
+];
+
+const scriptTagFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'Script Tag ID' },
+ { key: 'legacy_resource_id', label: 'Legacy Resource ID' },
+ { key: 'src', label: 'Script URL', format: 'url' },
+ {
+ key: 'display_scope',
+ label: 'Display Scope',
+ description: 'ONLINE_STORE, ORDER_STATUS or ALL.',
+ },
+ { key: 'cache', label: 'Cached', format: 'boolean' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+];
+
+const marketingActivityFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'Marketing Activity ID' },
+ { key: 'title', label: 'Title' },
+ { key: 'status', label: 'Status' },
+ { key: 'status_label', label: 'Status Label' },
+ { key: 'tactic', label: 'Tactic' },
+ { key: 'marketing_channel_type', label: 'Channel Type' },
+ { key: 'source_and_medium', label: 'Source and Medium' },
+ { key: 'is_external', label: 'Is External', format: 'boolean' },
+ { key: 'hierarchy_level', label: 'Hierarchy Level' },
+ { key: 'parent_remote_id', label: 'Parent Remote ID' },
+ { key: 'parent_activity_id', label: 'Parent Activity ID' },
+ { key: 'url_parameter_value', label: 'URL Parameter Value' },
+ { key: 'activity_list_url', label: 'Activity List URL', format: 'url' },
+ { key: 'utm_campaign', label: 'UTM Campaign' },
+ { key: 'utm_source', label: 'UTM Source' },
+ { key: 'utm_medium', label: 'UTM Medium' },
+ { key: 'budget_type', label: 'Budget Type', description: 'DAILY or LIFETIME.' },
+ { key: 'budget_amount', label: 'Budget Amount', format: 'number' },
+ { key: 'budget_currency_code', label: 'Budget Currency' },
+ { key: 'ad_spend_amount', label: 'Ad Spend Amount', format: 'number' },
+ { key: 'ad_spend_currency_code', label: 'Ad Spend Currency' },
+ { key: 'marketing_event_id', label: 'Marketing Event ID' },
+ { key: 'remote_id', label: 'Remote ID' },
+ { key: 'manage_url', label: 'Manage URL', format: 'url' },
+ { key: 'preview_url', label: 'Preview URL', format: 'url' },
+ { key: 'started_at', label: 'Started At', format: 'datetime' },
+ { key: 'ended_at', label: 'Ended At', format: 'datetime' },
+ { key: 'scheduled_to_end_at', label: 'Scheduled To End At', format: 'datetime' },
+ { key: 'status_transitioned_at', label: 'Status Changed At', format: 'datetime' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+];
+
+const marketingEventFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'Marketing Event ID' },
+ { key: 'legacy_resource_id', label: 'Legacy Resource ID' },
+ { key: 'type', label: 'Type' },
+ { key: 'remote_id', label: 'Remote ID' },
+ { key: 'description', label: 'Description' },
+ { key: 'marketing_channel_type', label: 'Channel Type' },
+ { key: 'source_and_medium', label: 'Source and Medium' },
+ { key: 'channel_handle', label: 'Channel Handle' },
+ { key: 'started_at', label: 'Started At', format: 'datetime' },
+ { key: 'ended_at', label: 'Ended At', format: 'datetime' },
+ { key: 'scheduled_to_end_at', label: 'Scheduled To End At', format: 'datetime' },
+ { key: 'manage_url', label: 'Manage URL', format: 'url' },
+ { key: 'preview_url', label: 'Preview URL', format: 'url' },
+ { key: 'utm_campaign', label: 'UTM Campaign' },
+ { key: 'utm_medium', label: 'UTM Medium' },
+ { key: 'utm_source', label: 'UTM Source' },
+ { key: 'app_id', label: 'App ID' },
+ { key: 'app_title', label: 'App Title' },
+];
+
+const eventFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'Event ID' },
+ { key: 'event_type', label: 'Event Type', description: 'BasicEvent or CommentEvent.' },
+ { key: 'action', label: 'Action' },
+ { key: 'message', label: 'Message', format: 'html' },
+ { key: 'secondary_message', label: 'Secondary Message' },
+ { key: 'raw_message', label: 'Raw Message' },
+ { key: 'subject_id', label: 'Subject ID' },
+ { key: 'subject_type', label: 'Subject Type' },
+ { key: 'author', label: 'Author' },
+ { key: 'app_title', label: 'App Title' },
+ { key: 'attribute_to_app', label: 'Attributed To App', format: 'boolean' },
+ { key: 'attribute_to_user', label: 'Attributed To User', format: 'boolean' },
+ { key: 'critical_alert', label: 'Critical Alert', format: 'boolean' },
+ { key: 'edited', label: 'Edited', format: 'boolean' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+];
+
+const bulkOperationFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'Bulk Operation ID' },
+ {
+ key: 'status',
+ label: 'Status',
+ description: 'CREATED, RUNNING, COMPLETED, CANCELING, CANCELED, FAILED or EXPIRED.',
+ },
+ { key: 'type', label: 'Type', description: 'QUERY or MUTATION.' },
+ { key: 'error_code', label: 'Error Code' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'completed_at', label: 'Completed At', format: 'datetime' },
+ { key: 'object_count', label: 'Object Count', format: 'number' },
+ { key: 'root_object_count', label: 'Root Object Count', format: 'number' },
+ { key: 'file_size', label: 'File Size', format: 'filesize' },
+ {
+ key: 'url',
+ label: 'Result File URL',
+ format: 'url',
+ description: 'JSONL result file, set once the operation completes.',
+ },
+ { key: 'partial_data_url', label: 'Partial Data URL', format: 'url' },
+ { key: 'query', label: 'Query' },
+];
+
+const rootUrlFields: OutputSchema['fields'] = [
+ { key: 'locale', label: 'Locale' },
+ { key: 'url', label: 'URL', format: 'url' },
+];
+
+const businessEntityFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'Business Entity ID' },
+ { key: 'display_name', label: 'Display Name' },
+ { key: 'company_name', label: 'Company Name' },
+ { key: 'primary', label: 'Primary', format: 'boolean' },
+ { key: 'archived', label: 'Archived', format: 'boolean' },
+ { key: 'legal_entity_id', label: 'Legal Entity ID' },
+ { key: 'address1', label: 'Address Line 1' },
+ { key: 'address2', label: 'Address Line 2' },
+ { key: 'city', label: 'City' },
+ { key: 'province', label: 'Province' },
+ { key: 'zip', label: 'ZIP' },
+ { key: 'country_code', label: 'Country Code' },
+];
+
+const consentPolicyFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'Policy ID' },
+ { key: 'country_code', label: 'Country Code' },
+ {
+ key: 'region_code',
+ label: 'Region Code',
+ description: 'Full ISO 3166-2 code such as USCA, or null for a country-wide policy.',
+ },
+ { key: 'consent_required', label: 'Consent Required', format: 'boolean' },
+ {
+ key: 'data_sale_opt_out_required',
+ label: 'Data Sale Opt-Out Required',
+ format: 'boolean',
+ },
+ { key: 'shop_id', label: 'Shop ID' },
+];
+
+const catalogFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'Catalog ID' },
+ {
+ key: 'catalog_type',
+ label: 'Catalog Type',
+ description: 'AppCatalog, MarketCatalog or CompanyLocationCatalog.',
+ },
+ { key: 'title', label: 'Title' },
+ { key: 'status', label: 'Status' },
+ { key: 'price_list_id', label: 'Price List ID' },
+ { key: 'price_list_name', label: 'Price List Name' },
+ { key: 'price_list_currency', label: 'Price List Currency' },
+ { key: 'publication_id', label: 'Publication ID' },
+ { key: 'markets_count', label: 'Markets Count', format: 'number' },
+ { key: 'company_locations_count', label: 'Company Locations Count', format: 'number' },
+];
+
+const webPresenceFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'Web Presence ID' },
+ { key: 'kind', label: 'Kind', description: 'domain or subfolder.' },
+ { key: 'subfolder_suffix', label: 'Subfolder Suffix' },
+ { key: 'domain_id', label: 'Domain ID' },
+ { key: 'domain_host', label: 'Domain Host' },
+ { key: 'domain_url', label: 'Domain URL', format: 'url' },
+ { key: 'default_locale', label: 'Default Locale' },
+ { key: 'root_urls', label: 'Root URLs', labelKey: 'locale', listItems: rootUrlFields },
+];
+
+const customerAccountPageFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'Page ID' },
+ {
+ key: 'page_kind',
+ label: 'Page Kind',
+ description: 'CustomerAccountNativePage or CustomerAccountAppExtensionPage.',
+ },
+ { key: 'handle', label: 'Handle' },
+ { key: 'title', label: 'Title' },
+ { key: 'default_cursor', label: 'Default Cursor' },
+ { key: 'page_type', label: 'Page Type' },
+ { key: 'app_extension_uuid', label: 'App Extension UUID' },
+];
+
+const savedSearchFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'Saved Search ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'query', label: 'Query' },
+ { key: 'search_terms', label: 'Search Terms' },
+ { key: 'resource_type', label: 'Resource Type' },
+];
+
+const paymentTermsTemplateFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'Template ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'translated_name', label: 'Translated Name' },
+ { key: 'description', label: 'Description' },
+ { key: 'due_in_days', label: 'Due In Days', format: 'number' },
+ {
+ key: 'payment_terms_type',
+ label: 'Payment Terms Type',
+ description: 'RECEIPT, NET, FIXED or FULFILLMENT.',
+ },
+];
+
+const shopPolicyFields: OutputSchema['fields'] = [
+ { key: 'id', label: 'Policy ID' },
+ { key: 'type', label: 'Type' },
+ { key: 'title', label: 'Title' },
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'body', label: 'Body', format: 'html' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+];
+
+export const storeCountOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'count', label: 'Count', format: 'number' },
+ {
+ key: 'precision',
+ label: 'Precision',
+ description: 'EXACT, or AT_LEAST when Shopify capped the count.',
+ },
+ redactedFieldsField,
+ ],
+};
+
+export const scriptTagOutputSchema: OutputSchema = {
+ fields: [...scriptTagFields, redactedFieldsField],
+};
+
+export const listScriptTagsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'items', label: 'Script Tags', labelKey: 'src', listItems: scriptTagFields },
+ ...pagingFields,
+ ],
+};
+
+export const deleteScriptTagOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'deleted_script_tag_id', label: 'Deleted Script Tag ID' },
+ redactedFieldsField,
+ ],
+};
+
+export const marketingActivityOutputSchema: OutputSchema = {
+ fields: [...marketingActivityFields, redactedFieldsField],
+};
+
+export const deleteMarketingActivityOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'deleted_marketing_activity_id', label: 'Deleted Marketing Activity ID' },
+ { key: 'remote_id', label: 'Remote ID' },
+ {
+ key: 'deletion_queued',
+ label: 'Deletion Queued',
+ format: 'boolean',
+ description: 'True when Shopify finishes the deletion in the background.',
+ },
+ redactedFieldsField,
+ ],
+};
+
+export const marketingEngagementOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'occurred_on', label: 'Occurred On', format: 'date' },
+ { key: 'utc_offset', label: 'UTC Offset' },
+ { key: 'channel_handle', label: 'Channel Handle' },
+ { key: 'marketing_activity_id', label: 'Marketing Activity ID' },
+ { key: 'marketing_activity_title', label: 'Marketing Activity Title' },
+ { key: 'impressions_count', label: 'Impressions', format: 'number' },
+ { key: 'views_count', label: 'Views', format: 'number' },
+ { key: 'clicks_count', label: 'Clicks', format: 'number' },
+ { key: 'shares_count', label: 'Shares', format: 'number' },
+ { key: 'favorites_count', label: 'Favorites', format: 'number' },
+ { key: 'comments_count', label: 'Comments', format: 'number' },
+ { key: 'unsubscribes_count', label: 'Unsubscribes', format: 'number' },
+ { key: 'complaints_count', label: 'Complaints', format: 'number' },
+ { key: 'fails_count', label: 'Fails', format: 'number' },
+ { key: 'sends_count', label: 'Sends', format: 'number' },
+ { key: 'unique_views_count', label: 'Unique Views', format: 'number' },
+ { key: 'unique_clicks_count', label: 'Unique Clicks', format: 'number' },
+ { key: 'sessions_count', label: 'Sessions', format: 'number' },
+ { key: 'orders', label: 'Orders', format: 'number' },
+ { key: 'first_time_customers', label: 'First-Time Customers', format: 'number' },
+ { key: 'returning_customers', label: 'Returning Customers', format: 'number' },
+ { key: 'primary_conversions', label: 'Primary Conversions', format: 'number' },
+ { key: 'all_conversions', label: 'All Conversions', format: 'number' },
+ { key: 'ad_spend_amount', label: 'Ad Spend Amount', format: 'number' },
+ { key: 'ad_spend_currency_code', label: 'Ad Spend Currency' },
+ { key: 'sales_amount', label: 'Sales Amount', format: 'number' },
+ { key: 'sales_currency_code', label: 'Sales Currency' },
+ redactedFieldsField,
+ ],
+};
+
+export const marketingEventOutputSchema: OutputSchema = {
+ fields: [...marketingEventFields, redactedFieldsField],
+};
+
+export const listMarketingEventsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'items',
+ label: 'Marketing Events',
+ labelKey: 'description',
+ listItems: marketingEventFields,
+ },
+ ...pagingFields,
+ ],
+};
+
+export const eventOutputSchema: OutputSchema = {
+ fields: [...eventFields, redactedFieldsField],
+};
+
+export const listEventsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'items', label: 'Events', labelKey: 'message', listItems: eventFields },
+ ...pagingFields,
+ ],
+};
+
+export const bulkOperationOutputSchema: OutputSchema = {
+ fields: [...bulkOperationFields, redactedFieldsField],
+};
+
+export const startBulkQueryOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'bulk_operation_id', label: 'Bulk Operation ID' },
+ ...bulkOperationFields.filter((field) => field.key !== 'id'),
+ redactedFieldsField,
+ ],
+};
+
+export const startBulkMutationOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'bulk_operation_id', label: 'Bulk Operation ID' },
+ ...bulkOperationFields.filter((field) => field.key !== 'id'),
+ { key: 'line_count', label: 'Line Count', format: 'number' },
+ { key: 'staged_upload_path', label: 'Staged Upload Path' },
+ redactedFieldsField,
+ ],
+};
+
+export const listBulkOperationsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'items', label: 'Bulk Operations', labelKey: 'id', listItems: bulkOperationFields },
+ ...pagingFields,
+ ],
+};
+
+export const listShopPoliciesOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'items', label: 'Policies', labelKey: 'title', listItems: shopPolicyFields },
+ ...countOnlyFields,
+ ],
+};
+
+export const listAvailableLocalesOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'items',
+ label: 'Locales',
+ labelKey: 'name',
+ listItems: [
+ { key: 'iso_code', label: 'ISO Code' },
+ { key: 'name', label: 'Name' },
+ ],
+ },
+ ...countOnlyFields,
+ ],
+};
+
+export const domainOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'id', label: 'Domain ID' },
+ { key: 'host', label: 'Host' },
+ { key: 'url', label: 'URL', format: 'url' },
+ { key: 'ssl_enabled', label: 'SSL Enabled', format: 'boolean' },
+ { key: 'default_locale', label: 'Default Locale' },
+ { key: 'alternate_locales', label: 'Alternate Locales' },
+ { key: 'country', label: 'Country' },
+ { key: 'web_presence_id', label: 'Web Presence ID' },
+ { key: 'web_presence_subfolder_suffix', label: 'Web Presence Subfolder Suffix' },
+ {
+ key: 'web_presence_root_urls',
+ label: 'Web Presence Root URLs',
+ labelKey: 'locale',
+ listItems: rootUrlFields,
+ },
+ redactedFieldsField,
+ ],
+};
+
+export const shopBillingPreferencesOutputSchema: OutputSchema = {
+ fields: [{ key: 'billing_currency', label: 'Billing Currency' }, redactedFieldsField],
+};
+
+export const listCustomerAccountPagesOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'items',
+ label: 'Customer Account Pages',
+ labelKey: 'title',
+ listItems: customerAccountPageFields,
+ },
+ ...pagingFields,
+ ],
+};
+
+export const listSavedSearchesOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'items', label: 'Saved Searches', labelKey: 'name', listItems: savedSearchFields },
+ ...pagingFields,
+ ],
+};
+
+export const deleteSavedSearchOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'deleted_saved_search_id', label: 'Deleted Saved Search ID' },
+ redactedFieldsField,
+ ],
+};
+
+export const listConsentPoliciesOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'items',
+ label: 'Consent Policies',
+ labelKey: 'country_code',
+ listItems: consentPolicyFields,
+ },
+ ...countOnlyFields,
+ ],
+};
+
+export const listConsentPolicyRegionsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'items',
+ label: 'Regions',
+ labelKey: 'country_code',
+ listItems: [
+ { key: 'country_code', label: 'Country Code' },
+ { key: 'region_code', label: 'Region Code' },
+ ],
+ },
+ ...countOnlyFields,
+ ],
+};
+
+export const listCatalogsOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'items', label: 'Catalogs', labelKey: 'title', listItems: catalogFields },
+ ...pagingFields,
+ ],
+};
+
+export const businessEntityOutputSchema: OutputSchema = {
+ fields: [...businessEntityFields, redactedFieldsField],
+};
+
+export const listBusinessEntitiesOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'items',
+ label: 'Business Entities',
+ labelKey: 'display_name',
+ listItems: businessEntityFields,
+ },
+ ...countOnlyFields,
+ ],
+};
+
+export const listWebPresencesOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'items', label: 'Web Presences', labelKey: 'kind', listItems: webPresenceFields },
+ ...pagingFields,
+ ],
+};
+
+export const deleteWebPresenceOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'deleted_web_presence_id', label: 'Deleted Web Presence ID' },
+ redactedFieldsField,
+ ],
+};
+
+export const listPaymentTermsTemplatesOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'items',
+ label: 'Payment Terms Templates',
+ labelKey: 'name',
+ listItems: paymentTermsTemplateFields,
+ },
+ ...countOnlyFields,
+ ],
+};
+
+export const listEnabledCurrenciesOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'shop_currency_code', label: 'Shop Currency' },
+ {
+ key: 'enabled_presentment_currencies',
+ label: 'Currencies Customers Can Pay In',
+ },
+ {
+ key: 'items',
+ label: 'Currency Settings',
+ labelKey: 'currency_code',
+ description: 'Can be empty on a store without multi-currency settings.',
+ listItems: [
+ { key: 'currency_code', label: 'Currency Code' },
+ { key: 'currency_name', label: 'Currency Name' },
+ { key: 'enabled', label: 'Enabled', format: 'boolean' },
+ {
+ key: 'manual_rate',
+ label: 'Manual Rate',
+ format: 'number',
+ description: 'Null when Shopify converts automatically.',
+ },
+ { key: 'rate_updated_at', label: 'Rate Updated At', format: 'datetime' },
+ ],
+ },
+ ...pagingFields,
+ ],
+};
+
+export const listPaymentDisputesOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'items',
+ label: 'Disputes',
+ labelKey: 'id',
+ listItems: [
+ { key: 'id', label: 'Dispute ID' },
+ { key: 'legacy_resource_id', label: 'Numeric ID' },
+ { key: 'status', label: 'Status', description: 'For example NEEDS_RESPONSE, UNDER_REVIEW, WON or LOST.' },
+ { key: 'type', label: 'Type', description: 'CHARGEBACK or INQUIRY.' },
+ { key: 'reason', label: 'Reason' },
+ { key: 'network_reason_code', label: 'Network Reason Code' },
+ { key: 'amount', label: 'Amount', format: 'number' },
+ { key: 'currency_code', label: 'Currency' },
+ { key: 'initiated_at', label: 'Initiated At', format: 'datetime' },
+ { key: 'evidence_due_by', label: 'Evidence Due By', format: 'datetime' },
+ { key: 'evidence_sent_on', label: 'Evidence Sent On', format: 'datetime' },
+ { key: 'finalized_on', label: 'Finalized On', format: 'datetime' },
+ { key: 'order_id', label: 'Order ID' },
+ { key: 'order_name', label: 'Order Name' },
+ ],
+ },
+ ...pagingFields,
+ ],
+};
+
+export const listShopPayPaymentRequestReceiptsOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'items',
+ label: 'Receipts',
+ labelKey: 'token',
+ listItems: [
+ { key: 'token', label: 'Receipt Token' },
+ { key: 'source_identifier', label: 'Source Identifier' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'processing_state', label: 'Processing State' },
+ { key: 'processing_message', label: 'Processing Message' },
+ { key: 'processing_error_code', label: 'Processing Error Code' },
+ { key: 'order_id', label: 'Order ID' },
+ { key: 'order_name', label: 'Order Name' },
+ { key: 'presentment_currency', label: 'Currency' },
+ { key: 'total', label: 'Total', format: 'number' },
+ { key: 'subtotal', label: 'Subtotal', format: 'number' },
+ { key: 'total_tax', label: 'Total Tax', format: 'number' },
+ ],
+ },
+ ...pagingFields,
+ ],
+};
diff --git a/packages/pieces/community/shopify/test/w5-store.test.ts b/packages/pieces/community/shopify/test/w5-store.test.ts
new file mode 100644
index 00000000000..982bddb746a
--- /dev/null
+++ b/packages/pieces/community/shopify/test/w5-store.test.ts
@@ -0,0 +1,117 @@
+import { afterEach, describe, expect, it, vi } from 'vitest';
+import '../src';
+import { shopifyAiCreateAnalyticsAnnotation } from '../src/lib/actions/ai/create-analytics-annotation';
+import { shopifyAiCreateAnalyticsTarget } from '../src/lib/actions/ai/create-analytics-target';
+import { GraphqlBody, mockShopify, runAction } from './helpers';
+
+const TARGET_PROPS = {
+ name: 'Q4 sales',
+ metric: 'total_sales',
+ start_date: '2026-10-01',
+ end_date: '2026-12-31',
+ expected_value: 50000,
+};
+
+const TARGET = {
+ id: 'gid://shopify/AnalyticsTarget/9',
+ name: 'Q4 sales',
+ metric: 'total_sales',
+ startDate: '2026-10-01',
+ endDate: '2026-12-31',
+ expectedValue: '50000',
+ filters: null,
+};
+
+const TAKEN = { field: ['input'], message: 'A target with these attributes already exists', code: 'TAKEN' };
+
+const LOOKUP_QUERY = 'metric:total_sales start_date:2026-10-01 end_date:2026-12-31';
+
+afterEach(() => {
+ vi.restoreAllMocks();
+});
+
+describe('create_analytics_target', () => {
+ it('sends the exact target input', async () => {
+ const sent = mockShopify({ replies: [{ data: { analyticsTargetCreate: { analyticsTarget: TARGET, userErrors: [] } } }] });
+
+ const result = await runAction({ action: shopifyAiCreateAnalyticsTarget, propsValue: TARGET_PROPS });
+
+ expect(sent[0].variables).toEqual({
+ input: { name: 'Q4 sales', metric: 'total_sales', startDate: '2026-10-01', endDate: '2026-12-31', expectedValue: '50000' },
+ });
+ expect(result).toMatchObject({ id: TARGET.id, already_existed: false });
+ });
+
+ it('reports already_existed when Shopify returns TAKEN together with the target', async () => {
+ const sent = mockShopify({ replies: [{ data: { analyticsTargetCreate: { analyticsTarget: TARGET, userErrors: [TAKEN] } } }] });
+
+ const result = await runAction({ action: shopifyAiCreateAnalyticsTarget, propsValue: TARGET_PROPS });
+
+ expect(sent).toHaveLength(1);
+ expect(result).toMatchObject({ id: TARGET.id, already_existed: true });
+ });
+
+ it('pages through many lookup pages until it finds the existing target', async () => {
+ const other = { ...TARGET, id: 'gid://shopify/AnalyticsTarget/1', filters: 'sales_channel=online' };
+ const lookupPages: GraphqlBody[] = Array.from({ length: 12 }, (_, index) => ({
+ data: {
+ analyticsTargets: {
+ nodes: index === 11 ? [other, TARGET] : [other],
+ pageInfo: { hasNextPage: index < 11, endCursor: `cursor-${index + 1}` },
+ },
+ },
+ }));
+ const sent = mockShopify({
+ replies: [{ data: { analyticsTargetCreate: { analyticsTarget: null, userErrors: [TAKEN] } } }, ...lookupPages],
+ });
+
+ const result = await runAction({ action: shopifyAiCreateAnalyticsTarget, propsValue: TARGET_PROPS });
+
+ expect(sent).toHaveLength(13);
+ expect(sent[1].variables).toEqual({ first: 50, query: LOOKUP_QUERY });
+ expect(sent[12].variables).toEqual({ first: 50, after: 'cursor-11', query: LOOKUP_QUERY });
+ expect(result).toMatchObject({ id: TARGET.id, already_existed: true });
+ });
+
+ it('stops looking up when the cursor stops advancing', async () => {
+ const stuckPage: GraphqlBody = {
+ data: { analyticsTargets: { nodes: [], pageInfo: { hasNextPage: true, endCursor: 'cursor-1' } } },
+ };
+ const sent = mockShopify({
+ replies: [{ data: { analyticsTargetCreate: { analyticsTarget: null, userErrors: [TAKEN] } } }, stuckPage, stuckPage, stuckPage],
+ });
+
+ await expect(runAction({ action: shopifyAiCreateAnalyticsTarget, propsValue: TARGET_PROPS })).rejects.toThrow(
+ 'No target with this metric, dates and filters was found'
+ );
+ expect(sent).toHaveLength(3);
+ expect(sent[2].variables).toEqual({ first: 50, after: 'cursor-1', query: LOOKUP_QUERY });
+ });
+});
+
+describe('create_analytics_annotation', () => {
+ it('refuses an impossible started_at date before calling Shopify', async () => {
+ const sent = mockShopify({ replies: [] });
+
+ await expect(
+ runAction({
+ action: shopifyAiCreateAnalyticsAnnotation,
+ propsValue: { type: 'campaign', title: 'Launch', started_at: '2026-02-31T00:00:00Z' },
+ })
+ ).rejects.toThrow('started_at "2026-02-31T00:00:00Z" is not an ISO 8601 date-time');
+ expect(sent).toHaveLength(0);
+ });
+
+ it('sends the exact annotation input', async () => {
+ const sent = mockShopify({
+ replies: [{ data: { analyticsAnnotationCreate: { analyticsAnnotation: { id: 'gid://shopify/AnalyticsAnnotation/3' }, userErrors: [] } } }],
+ });
+
+ await runAction({
+ action: shopifyAiCreateAnalyticsAnnotation,
+ propsValue: { type: 'campaign', title: 'Launch', started_at: '2026-11-28T00:00:00Z' },
+ });
+
+ expect(sent[0].variables).toEqual({ input: { type: 'campaign', title: 'Launch', startedAt: '2026-11-28T00:00:00Z' } });
+ });
+});