From 42472865ab01d07f2a0fe0dfc3e41eaf4eacc601 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Thu, 23 Jul 2026 12:01:26 -0700 Subject: [PATCH 1/2] improvement(shopify): pin Admin API to supported 2025-10 via shared constant MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every Shopify tool and the credential validator hardcoded the retired 2024-10 Admin API version. Retired versions still work (Shopify forward-falls to the oldest supported version) but the served version drifts silently and emits deprecation signals. - Add apps/sim/tools/shopify/constants.ts exporting SHOPIFY_API_VERSION as the single source of truth; bump to the supported 2025-10. - Wire all 21 Shopify tools, the token-service-account validator, and the OAuth store route to the shared constant (no more per-file inline version). - Derive the validator test's expected URL from the constant so it can't drift. Our operations already use modern 2024-10+ shapes (ProductCreateInput / ProductUpdateInput new product model, orderCancel new signature, CustomerInput, InventoryAdjustQuantitiesInput, fulfillmentCreate), none of the removed inline ProductInput.variants pattern — so the bump is a small, explicit step forward from the version Shopify already forward-serves. --- .../app/api/auth/oauth2/shopify/store/route.ts | 16 ++++++++++------ .../validators/shopify.test.ts | 3 ++- .../token-service-accounts/validators/shopify.ts | 9 +-------- apps/sim/tools/shopify/adjust_inventory.ts | 3 ++- apps/sim/tools/shopify/cancel_order.ts | 3 ++- apps/sim/tools/shopify/constants.ts | 14 ++++++++++++++ apps/sim/tools/shopify/create_customer.ts | 3 ++- apps/sim/tools/shopify/create_fulfillment.ts | 3 ++- apps/sim/tools/shopify/create_product.ts | 3 ++- apps/sim/tools/shopify/delete_customer.ts | 3 ++- apps/sim/tools/shopify/delete_product.ts | 3 ++- apps/sim/tools/shopify/get_collection.ts | 3 ++- apps/sim/tools/shopify/get_customer.ts | 3 ++- apps/sim/tools/shopify/get_inventory_level.ts | 3 ++- apps/sim/tools/shopify/get_order.ts | 3 ++- apps/sim/tools/shopify/get_product.ts | 3 ++- apps/sim/tools/shopify/list_collections.ts | 3 ++- apps/sim/tools/shopify/list_customers.ts | 3 ++- apps/sim/tools/shopify/list_inventory_items.ts | 3 ++- apps/sim/tools/shopify/list_locations.ts | 3 ++- apps/sim/tools/shopify/list_orders.ts | 3 ++- apps/sim/tools/shopify/list_products.ts | 3 ++- apps/sim/tools/shopify/update_customer.ts | 3 ++- apps/sim/tools/shopify/update_order.ts | 3 ++- apps/sim/tools/shopify/update_product.ts | 3 ++- 25 files changed, 69 insertions(+), 36 deletions(-) create mode 100644 apps/sim/tools/shopify/constants.ts diff --git a/apps/sim/app/api/auth/oauth2/shopify/store/route.ts b/apps/sim/app/api/auth/oauth2/shopify/store/route.ts index c4a26459ecb..4d26c178f5b 100644 --- a/apps/sim/app/api/auth/oauth2/shopify/store/route.ts +++ b/apps/sim/app/api/auth/oauth2/shopify/store/route.ts @@ -13,6 +13,7 @@ import { isSameOrigin } from '@/lib/core/utils/validation' import { withRouteHandler } from '@/lib/core/utils/with-route-handler' import { processCredentialDraft } from '@/lib/credentials/draft-processor' import { safeAccountInsert } from '@/app/api/auth/oauth/utils' +import { SHOPIFY_API_VERSION } from '@/tools/shopify/constants' const logger = createLogger('ShopifyStore') @@ -46,12 +47,15 @@ export const GET = withRouteHandler(async (request: NextRequest) => { return NextResponse.redirect(`${baseUrl}/workspace?error=shopify_invalid_domain`) } - const shopResponse = await fetch(`https://${shopDomain}/admin/api/2024-10/shop.json`, { - headers: { - 'X-Shopify-Access-Token': accessToken, - 'Content-Type': 'application/json', - }, - }) + const shopResponse = await fetch( + `https://${shopDomain}/admin/api/${SHOPIFY_API_VERSION}/shop.json`, + { + headers: { + 'X-Shopify-Access-Token': accessToken, + 'Content-Type': 'application/json', + }, + } + ) if (!shopResponse.ok) { const errorText = await shopResponse.text() diff --git a/apps/sim/lib/credentials/token-service-accounts/validators/shopify.test.ts b/apps/sim/lib/credentials/token-service-accounts/validators/shopify.test.ts index f8784e9bb5d..b53fc10cff3 100644 --- a/apps/sim/lib/credentials/token-service-accounts/validators/shopify.test.ts +++ b/apps/sim/lib/credentials/token-service-accounts/validators/shopify.test.ts @@ -4,6 +4,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { TokenServiceAccountValidationError } from '@/lib/credentials/token-service-accounts/errors' import { validateShopifyServiceAccount } from '@/lib/credentials/token-service-accounts/validators/shopify' +import { SHOPIFY_API_VERSION } from '@/tools/shopify/constants' const mockFetch = vi.fn() @@ -48,7 +49,7 @@ describe('validateShopifyServiceAccount', () => { normalizedDomain: 'acme-store.myshopify.com', }) expect(mockFetch).toHaveBeenCalledWith( - 'https://acme-store.myshopify.com/admin/api/2024-10/graphql.json', + `https://acme-store.myshopify.com/admin/api/${SHOPIFY_API_VERSION}/graphql.json`, { method: 'POST', headers: { diff --git a/apps/sim/lib/credentials/token-service-accounts/validators/shopify.ts b/apps/sim/lib/credentials/token-service-accounts/validators/shopify.ts index 4f71977b37a..e0a2f9a605d 100644 --- a/apps/sim/lib/credentials/token-service-accounts/validators/shopify.ts +++ b/apps/sim/lib/credentials/token-service-accounts/validators/shopify.ts @@ -9,14 +9,7 @@ import type { TokenServiceAccountFields, TokenServiceAccountValidationResult, } from '@/lib/credentials/token-service-accounts/server' - -/** - * Pinned to match the Admin API version hardcoded in every Sim Shopify tool - * (`apps/sim/tools/shopify/*`) — bump both together. Note 2024-10 is retired; - * Shopify silently serves the oldest supported version for retired versions, - * so validation and tool runtime still hit the same effective API. - */ -const SHOPIFY_API_VERSION = '2024-10' +import { SHOPIFY_API_VERSION } from '@/tools/shopify/constants' /** * SSRF guard: the Admin API must target the permanent `*.myshopify.com` diff --git a/apps/sim/tools/shopify/adjust_inventory.ts b/apps/sim/tools/shopify/adjust_inventory.ts index 950ca816452..78ce7bc0cc5 100644 --- a/apps/sim/tools/shopify/adjust_inventory.ts +++ b/apps/sim/tools/shopify/adjust_inventory.ts @@ -1,3 +1,4 @@ +import { SHOPIFY_API_VERSION } from '@/tools/shopify/constants' import type { ShopifyAdjustInventoryParams, ShopifyInventoryAdjustmentResponse, @@ -48,7 +49,7 @@ export const shopifyAdjustInventoryTool: ToolConfig< request: { url: (params) => - `https://${params.domain || params.shopDomain || params.idToken}/admin/api/2024-10/graphql.json`, + `https://${params.domain || params.shopDomain || params.idToken}/admin/api/${SHOPIFY_API_VERSION}/graphql.json`, method: 'POST', headers: (params) => { if (!params.accessToken) { diff --git a/apps/sim/tools/shopify/cancel_order.ts b/apps/sim/tools/shopify/cancel_order.ts index 3a7ee6d7af9..30d586422b9 100644 --- a/apps/sim/tools/shopify/cancel_order.ts +++ b/apps/sim/tools/shopify/cancel_order.ts @@ -1,3 +1,4 @@ +import { SHOPIFY_API_VERSION } from '@/tools/shopify/constants' import type { ShopifyCancelOrderParams, ShopifyCancelOrderResponse } from '@/tools/shopify/types' import { CANCEL_ORDER_OUTPUT_PROPERTIES } from '@/tools/shopify/types' import type { ToolConfig } from '@/tools/types' @@ -64,7 +65,7 @@ export const shopifyCancelOrderTool: ToolConfig< request: { url: (params) => - `https://${params.domain || params.shopDomain || params.idToken}/admin/api/2024-10/graphql.json`, + `https://${params.domain || params.shopDomain || params.idToken}/admin/api/${SHOPIFY_API_VERSION}/graphql.json`, method: 'POST', headers: (params) => { if (!params.accessToken) { diff --git a/apps/sim/tools/shopify/constants.ts b/apps/sim/tools/shopify/constants.ts new file mode 100644 index 00000000000..92fb5cb5867 --- /dev/null +++ b/apps/sim/tools/shopify/constants.ts @@ -0,0 +1,14 @@ +/** + * The Shopify Admin API version every Sim Shopify tool targets, plus the + * credential validator in + * `@/lib/credentials/token-service-accounts/validators/shopify`. Keep this the + * single source of truth — bump it here and every caller moves in lockstep. + * + * Shopify supports each stable version for at least 12 months and forward-falls + * to the oldest supported version for retired ones, so a request never breaks + * the day a version retires — but the served version drifts silently, so pin an + * explicitly supported version and bump on the quarterly cadence. + * + * @see https://shopify.dev/docs/api/usage/versioning + */ +export const SHOPIFY_API_VERSION = '2025-10' diff --git a/apps/sim/tools/shopify/create_customer.ts b/apps/sim/tools/shopify/create_customer.ts index e56d1f2c48d..56460768ec4 100644 --- a/apps/sim/tools/shopify/create_customer.ts +++ b/apps/sim/tools/shopify/create_customer.ts @@ -1,3 +1,4 @@ +import { SHOPIFY_API_VERSION } from '@/tools/shopify/constants' import type { ShopifyCreateCustomerParams, ShopifyCustomerResponse } from '@/tools/shopify/types' import { CUSTOMER_OUTPUT_PROPERTIES } from '@/tools/shopify/types' import type { ToolConfig } from '@/tools/types' @@ -69,7 +70,7 @@ export const shopifyCreateCustomerTool: ToolConfig< request: { url: (params) => - `https://${params.domain || params.shopDomain || params.idToken}/admin/api/2024-10/graphql.json`, + `https://${params.domain || params.shopDomain || params.idToken}/admin/api/${SHOPIFY_API_VERSION}/graphql.json`, method: 'POST', headers: (params) => { if (!params.accessToken) { diff --git a/apps/sim/tools/shopify/create_fulfillment.ts b/apps/sim/tools/shopify/create_fulfillment.ts index 05435306d17..76ca156c5dd 100644 --- a/apps/sim/tools/shopify/create_fulfillment.ts +++ b/apps/sim/tools/shopify/create_fulfillment.ts @@ -1,3 +1,4 @@ +import { SHOPIFY_API_VERSION } from '@/tools/shopify/constants' import type { ShopifyCreateFulfillmentParams, ShopifyFulfillmentResponse, @@ -61,7 +62,7 @@ export const shopifyCreateFulfillmentTool: ToolConfig< request: { url: (params) => - `https://${params.domain || params.shopDomain || params.idToken}/admin/api/2024-10/graphql.json`, + `https://${params.domain || params.shopDomain || params.idToken}/admin/api/${SHOPIFY_API_VERSION}/graphql.json`, method: 'POST', headers: (params) => { if (!params.accessToken) { diff --git a/apps/sim/tools/shopify/create_product.ts b/apps/sim/tools/shopify/create_product.ts index dd1fb16c8d3..3060658be9c 100644 --- a/apps/sim/tools/shopify/create_product.ts +++ b/apps/sim/tools/shopify/create_product.ts @@ -1,3 +1,4 @@ +import { SHOPIFY_API_VERSION } from '@/tools/shopify/constants' import type { ShopifyCreateProductParams, ShopifyProductResponse } from '@/tools/shopify/types' import { PRODUCT_OUTPUT_PROPERTIES } from '@/tools/shopify/types' import type { ToolConfig } from '@/tools/types' @@ -63,7 +64,7 @@ export const shopifyCreateProductTool: ToolConfig< request: { url: (params) => - `https://${params.domain || params.shopDomain || params.idToken}/admin/api/2024-10/graphql.json`, + `https://${params.domain || params.shopDomain || params.idToken}/admin/api/${SHOPIFY_API_VERSION}/graphql.json`, method: 'POST', headers: (params) => { if (!params.accessToken) { diff --git a/apps/sim/tools/shopify/delete_customer.ts b/apps/sim/tools/shopify/delete_customer.ts index 010cf109c83..7b3611872fb 100644 --- a/apps/sim/tools/shopify/delete_customer.ts +++ b/apps/sim/tools/shopify/delete_customer.ts @@ -1,3 +1,4 @@ +import { SHOPIFY_API_VERSION } from '@/tools/shopify/constants' import type { ShopifyDeleteCustomerParams, ShopifyDeleteResponse } from '@/tools/shopify/types' import type { ToolConfig } from '@/tools/types' @@ -32,7 +33,7 @@ export const shopifyDeleteCustomerTool: ToolConfig< request: { url: (params) => - `https://${params.domain || params.shopDomain || params.idToken}/admin/api/2024-10/graphql.json`, + `https://${params.domain || params.shopDomain || params.idToken}/admin/api/${SHOPIFY_API_VERSION}/graphql.json`, method: 'POST', headers: (params) => { if (!params.accessToken) { diff --git a/apps/sim/tools/shopify/delete_product.ts b/apps/sim/tools/shopify/delete_product.ts index 42b3aa843fa..40a7e2dd300 100644 --- a/apps/sim/tools/shopify/delete_product.ts +++ b/apps/sim/tools/shopify/delete_product.ts @@ -1,3 +1,4 @@ +import { SHOPIFY_API_VERSION } from '@/tools/shopify/constants' import type { ShopifyDeleteProductParams, ShopifyDeleteResponse } from '@/tools/shopify/types' import type { ToolConfig } from '@/tools/types' @@ -32,7 +33,7 @@ export const shopifyDeleteProductTool: ToolConfig< request: { url: (params) => - `https://${params.domain || params.shopDomain || params.idToken}/admin/api/2024-10/graphql.json`, + `https://${params.domain || params.shopDomain || params.idToken}/admin/api/${SHOPIFY_API_VERSION}/graphql.json`, method: 'POST', headers: (params) => { if (!params.accessToken) { diff --git a/apps/sim/tools/shopify/get_collection.ts b/apps/sim/tools/shopify/get_collection.ts index 6cf7afa8dd6..d137b12c08a 100644 --- a/apps/sim/tools/shopify/get_collection.ts +++ b/apps/sim/tools/shopify/get_collection.ts @@ -1,3 +1,4 @@ +import { SHOPIFY_API_VERSION } from '@/tools/shopify/constants' import type { ShopifyCollectionResponse, ShopifyGetCollectionParams } from '@/tools/shopify/types' import { COLLECTION_WITH_PRODUCTS_OUTPUT_PROPERTIES } from '@/tools/shopify/types' import type { ToolConfig } from '@/tools/types' @@ -40,7 +41,7 @@ export const shopifyGetCollectionTool: ToolConfig< request: { url: (params) => - `https://${params.domain || params.shopDomain || params.idToken}/admin/api/2024-10/graphql.json`, + `https://${params.domain || params.shopDomain || params.idToken}/admin/api/${SHOPIFY_API_VERSION}/graphql.json`, method: 'POST', headers: (params) => { if (!params.accessToken) { diff --git a/apps/sim/tools/shopify/get_customer.ts b/apps/sim/tools/shopify/get_customer.ts index e7657df42c7..9763831091d 100644 --- a/apps/sim/tools/shopify/get_customer.ts +++ b/apps/sim/tools/shopify/get_customer.ts @@ -1,3 +1,4 @@ +import { SHOPIFY_API_VERSION } from '@/tools/shopify/constants' import type { ShopifyCustomerResponse, ShopifyGetCustomerParams } from '@/tools/shopify/types' import { CUSTOMER_OUTPUT_PROPERTIES } from '@/tools/shopify/types' import type { ToolConfig } from '@/tools/types' @@ -31,7 +32,7 @@ export const shopifyGetCustomerTool: ToolConfig - `https://${params.domain || params.shopDomain || params.idToken}/admin/api/2024-10/graphql.json`, + `https://${params.domain || params.shopDomain || params.idToken}/admin/api/${SHOPIFY_API_VERSION}/graphql.json`, method: 'POST', headers: (params) => { if (!params.accessToken) { diff --git a/apps/sim/tools/shopify/get_inventory_level.ts b/apps/sim/tools/shopify/get_inventory_level.ts index 215bd731a36..394796f8e72 100644 --- a/apps/sim/tools/shopify/get_inventory_level.ts +++ b/apps/sim/tools/shopify/get_inventory_level.ts @@ -1,3 +1,4 @@ +import { SHOPIFY_API_VERSION } from '@/tools/shopify/constants' import type { ShopifyGetInventoryLevelParams, ShopifyInventoryResponse, @@ -42,7 +43,7 @@ export const shopifyGetInventoryLevelTool: ToolConfig< request: { url: (params) => - `https://${params.domain || params.shopDomain || params.idToken}/admin/api/2024-10/graphql.json`, + `https://${params.domain || params.shopDomain || params.idToken}/admin/api/${SHOPIFY_API_VERSION}/graphql.json`, method: 'POST', headers: (params) => { if (!params.accessToken) { diff --git a/apps/sim/tools/shopify/get_order.ts b/apps/sim/tools/shopify/get_order.ts index 65f69ddaa02..be9fbadf279 100644 --- a/apps/sim/tools/shopify/get_order.ts +++ b/apps/sim/tools/shopify/get_order.ts @@ -1,3 +1,4 @@ +import { SHOPIFY_API_VERSION } from '@/tools/shopify/constants' import type { ShopifyGetOrderParams, ShopifyOrderResponse } from '@/tools/shopify/types' import { ORDER_OUTPUT_PROPERTIES } from '@/tools/shopify/types' import type { ToolConfig } from '@/tools/types' @@ -30,7 +31,7 @@ export const shopifyGetOrderTool: ToolConfig - `https://${params.domain || params.shopDomain || params.idToken}/admin/api/2024-10/graphql.json`, + `https://${params.domain || params.shopDomain || params.idToken}/admin/api/${SHOPIFY_API_VERSION}/graphql.json`, method: 'POST', headers: (params) => { if (!params.accessToken) { diff --git a/apps/sim/tools/shopify/get_product.ts b/apps/sim/tools/shopify/get_product.ts index e99c3b1140f..e024ff6d877 100644 --- a/apps/sim/tools/shopify/get_product.ts +++ b/apps/sim/tools/shopify/get_product.ts @@ -1,3 +1,4 @@ +import { SHOPIFY_API_VERSION } from '@/tools/shopify/constants' import type { ShopifyGetProductParams, ShopifyProductResponse } from '@/tools/shopify/types' import { PRODUCT_OUTPUT_PROPERTIES } from '@/tools/shopify/types' import type { ToolConfig } from '@/tools/types' @@ -30,7 +31,7 @@ export const shopifyGetProductTool: ToolConfig - `https://${params.domain || params.shopDomain || params.idToken}/admin/api/2024-10/graphql.json`, + `https://${params.domain || params.shopDomain || params.idToken}/admin/api/${SHOPIFY_API_VERSION}/graphql.json`, method: 'POST', headers: (params) => { if (!params.accessToken) { diff --git a/apps/sim/tools/shopify/list_collections.ts b/apps/sim/tools/shopify/list_collections.ts index bc7bd3e2f0e..af8a8c26fbf 100644 --- a/apps/sim/tools/shopify/list_collections.ts +++ b/apps/sim/tools/shopify/list_collections.ts @@ -1,3 +1,4 @@ +import { SHOPIFY_API_VERSION } from '@/tools/shopify/constants' import type { ShopifyCollectionsResponse, ShopifyListCollectionsParams, @@ -44,7 +45,7 @@ export const shopifyListCollectionsTool: ToolConfig< request: { url: (params) => - `https://${params.domain || params.shopDomain || params.idToken}/admin/api/2024-10/graphql.json`, + `https://${params.domain || params.shopDomain || params.idToken}/admin/api/${SHOPIFY_API_VERSION}/graphql.json`, method: 'POST', headers: (params) => { if (!params.accessToken) { diff --git a/apps/sim/tools/shopify/list_customers.ts b/apps/sim/tools/shopify/list_customers.ts index 0ecc1ab31e5..ed68a448359 100644 --- a/apps/sim/tools/shopify/list_customers.ts +++ b/apps/sim/tools/shopify/list_customers.ts @@ -1,3 +1,4 @@ +import { SHOPIFY_API_VERSION } from '@/tools/shopify/constants' import type { ShopifyCustomersResponse, ShopifyListCustomersParams } from '@/tools/shopify/types' import { CUSTOMER_OUTPUT_PROPERTIES, PAGE_INFO_OUTPUT_PROPERTIES } from '@/tools/shopify/types' import type { ToolConfig } from '@/tools/types' @@ -40,7 +41,7 @@ export const shopifyListCustomersTool: ToolConfig< request: { url: (params) => - `https://${params.domain || params.shopDomain || params.idToken}/admin/api/2024-10/graphql.json`, + `https://${params.domain || params.shopDomain || params.idToken}/admin/api/${SHOPIFY_API_VERSION}/graphql.json`, method: 'POST', headers: (params) => { if (!params.accessToken) { diff --git a/apps/sim/tools/shopify/list_inventory_items.ts b/apps/sim/tools/shopify/list_inventory_items.ts index 57de928cd96..9f74f969f80 100644 --- a/apps/sim/tools/shopify/list_inventory_items.ts +++ b/apps/sim/tools/shopify/list_inventory_items.ts @@ -1,3 +1,4 @@ +import { SHOPIFY_API_VERSION } from '@/tools/shopify/constants' import { INVENTORY_ITEM_OUTPUT_PROPERTIES, PAGE_INFO_OUTPUT_PROPERTIES, @@ -44,7 +45,7 @@ export const shopifyListInventoryItemsTool: ToolConfig< request: { url: (params) => - `https://${params.domain || params.shopDomain || params.idToken}/admin/api/2024-10/graphql.json`, + `https://${params.domain || params.shopDomain || params.idToken}/admin/api/${SHOPIFY_API_VERSION}/graphql.json`, method: 'POST', headers: (params) => { if (!params.accessToken) { diff --git a/apps/sim/tools/shopify/list_locations.ts b/apps/sim/tools/shopify/list_locations.ts index f51817b23a3..0aba9f82e3a 100644 --- a/apps/sim/tools/shopify/list_locations.ts +++ b/apps/sim/tools/shopify/list_locations.ts @@ -1,3 +1,4 @@ +import { SHOPIFY_API_VERSION } from '@/tools/shopify/constants' import type { ShopifyListLocationsParams, ShopifyLocationsResponse } from '@/tools/shopify/types' import { LOCATION_OUTPUT_PROPERTIES, PAGE_INFO_OUTPUT_PROPERTIES } from '@/tools/shopify/types' import type { ToolConfig } from '@/tools/types' @@ -40,7 +41,7 @@ export const shopifyListLocationsTool: ToolConfig< request: { url: (params) => - `https://${params.domain || params.shopDomain || params.idToken}/admin/api/2024-10/graphql.json`, + `https://${params.domain || params.shopDomain || params.idToken}/admin/api/${SHOPIFY_API_VERSION}/graphql.json`, method: 'POST', headers: (params) => { if (!params.accessToken) { diff --git a/apps/sim/tools/shopify/list_orders.ts b/apps/sim/tools/shopify/list_orders.ts index 4d818bde393..0d69519c6d6 100644 --- a/apps/sim/tools/shopify/list_orders.ts +++ b/apps/sim/tools/shopify/list_orders.ts @@ -1,3 +1,4 @@ +import { SHOPIFY_API_VERSION } from '@/tools/shopify/constants' import type { ShopifyListOrdersParams, ShopifyOrdersResponse } from '@/tools/shopify/types' import { ORDER_OUTPUT_PROPERTIES, PAGE_INFO_OUTPUT_PROPERTIES } from '@/tools/shopify/types' import type { ToolConfig } from '@/tools/types' @@ -43,7 +44,7 @@ export const shopifyListOrdersTool: ToolConfig - `https://${params.domain || params.shopDomain || params.idToken}/admin/api/2024-10/graphql.json`, + `https://${params.domain || params.shopDomain || params.idToken}/admin/api/${SHOPIFY_API_VERSION}/graphql.json`, method: 'POST', headers: (params) => { if (!params.accessToken) { diff --git a/apps/sim/tools/shopify/list_products.ts b/apps/sim/tools/shopify/list_products.ts index ceb6cae7d23..e8c15fca72c 100644 --- a/apps/sim/tools/shopify/list_products.ts +++ b/apps/sim/tools/shopify/list_products.ts @@ -1,3 +1,4 @@ +import { SHOPIFY_API_VERSION } from '@/tools/shopify/constants' import type { ShopifyListProductsParams, ShopifyProductsResponse } from '@/tools/shopify/types' import { PAGE_INFO_OUTPUT_PROPERTIES, PRODUCT_OUTPUT_PROPERTIES } from '@/tools/shopify/types' import type { ToolConfig } from '@/tools/types' @@ -40,7 +41,7 @@ export const shopifyListProductsTool: ToolConfig< request: { url: (params) => - `https://${params.domain || params.shopDomain || params.idToken}/admin/api/2024-10/graphql.json`, + `https://${params.domain || params.shopDomain || params.idToken}/admin/api/${SHOPIFY_API_VERSION}/graphql.json`, method: 'POST', headers: (params) => { if (!params.accessToken) { diff --git a/apps/sim/tools/shopify/update_customer.ts b/apps/sim/tools/shopify/update_customer.ts index af3ee478cbd..4a85667ad90 100644 --- a/apps/sim/tools/shopify/update_customer.ts +++ b/apps/sim/tools/shopify/update_customer.ts @@ -1,3 +1,4 @@ +import { SHOPIFY_API_VERSION } from '@/tools/shopify/constants' import type { ShopifyCustomerResponse, ShopifyUpdateCustomerParams } from '@/tools/shopify/types' import { CUSTOMER_OUTPUT_PROPERTIES } from '@/tools/shopify/types' import type { ToolConfig } from '@/tools/types' @@ -69,7 +70,7 @@ export const shopifyUpdateCustomerTool: ToolConfig< request: { url: (params) => - `https://${params.domain || params.shopDomain || params.idToken}/admin/api/2024-10/graphql.json`, + `https://${params.domain || params.shopDomain || params.idToken}/admin/api/${SHOPIFY_API_VERSION}/graphql.json`, method: 'POST', headers: (params) => { if (!params.accessToken) { diff --git a/apps/sim/tools/shopify/update_order.ts b/apps/sim/tools/shopify/update_order.ts index 9e34c3476aa..d03934a16a4 100644 --- a/apps/sim/tools/shopify/update_order.ts +++ b/apps/sim/tools/shopify/update_order.ts @@ -1,3 +1,4 @@ +import { SHOPIFY_API_VERSION } from '@/tools/shopify/constants' import type { ShopifyOrderResponse, ShopifyUpdateOrderParams } from '@/tools/shopify/types' import { ORDER_OUTPUT_PROPERTIES } from '@/tools/shopify/types' import type { ToolConfig } from '@/tools/types' @@ -48,7 +49,7 @@ export const shopifyUpdateOrderTool: ToolConfig - `https://${params.domain || params.shopDomain || params.idToken}/admin/api/2024-10/graphql.json`, + `https://${params.domain || params.shopDomain || params.idToken}/admin/api/${SHOPIFY_API_VERSION}/graphql.json`, method: 'POST', headers: (params) => { if (!params.accessToken) { diff --git a/apps/sim/tools/shopify/update_product.ts b/apps/sim/tools/shopify/update_product.ts index 771dca61343..9ae243b4757 100644 --- a/apps/sim/tools/shopify/update_product.ts +++ b/apps/sim/tools/shopify/update_product.ts @@ -1,3 +1,4 @@ +import { SHOPIFY_API_VERSION } from '@/tools/shopify/constants' import type { ShopifyProductResponse, ShopifyUpdateProductParams } from '@/tools/shopify/types' import { PRODUCT_OUTPUT_PROPERTIES } from '@/tools/shopify/types' import type { ToolConfig } from '@/tools/types' @@ -69,7 +70,7 @@ export const shopifyUpdateProductTool: ToolConfig< request: { url: (params) => - `https://${params.domain || params.shopDomain || params.idToken}/admin/api/2024-10/graphql.json`, + `https://${params.domain || params.shopDomain || params.idToken}/admin/api/${SHOPIFY_API_VERSION}/graphql.json`, method: 'POST', headers: (params) => { if (!params.accessToken) { From 57cb264627e3f4444cb6825cfd5d1245b0679019 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Thu, 23 Jul 2026 12:09:20 -0700 Subject: [PATCH 2/2] chore(shopify): remove dead ShopifySetInventoryParams type Surfaced by /validate-integration: unexported, unused (no set_inventory tool). --- apps/sim/tools/shopify/types.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/apps/sim/tools/shopify/types.ts b/apps/sim/tools/shopify/types.ts index d010c0b0cb9..f735931218c 100644 --- a/apps/sim/tools/shopify/types.ts +++ b/apps/sim/tools/shopify/types.ts @@ -847,12 +847,6 @@ export interface ShopifyAdjustInventoryParams extends ShopifyBaseParams { delta: number } -interface ShopifySetInventoryParams extends ShopifyBaseParams { - inventoryItemId: string - locationId: string - quantity: number -} - // Fulfillment Tool Params export interface ShopifyCreateFulfillmentParams extends ShopifyBaseParams { fulfillmentOrderId: string