WebsitesCommerceApi
Defined in: packages/sdk/src/resources/WebsitesApi.ts:173
Commerce surface — cached Amazon sales analytics (served via Shopify Marketplace Connect attribution, not the SP-API), Shopify OAuth connect/disconnect, and the Shopify-native sales channel registry (TikTok, Meta, Pinterest, Google, Marketplace Connect).
Extends
Section titled “Extends”Resource
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new WebsitesCommerceApi(
opts):WebsitesCommerceApi
Defined in: packages/sdk/src/request.ts:93
Parameters
Section titled “Parameters”Returns
Section titled “Returns”WebsitesCommerceApi
Inherited from
Section titled “Inherited from”Resource.constructor
Methods
Section titled “Methods”addShopifyChannel()
Section titled “addShopifyChannel()”addShopifyChannel(
websiteId,kind):Promise<{installUrl:string;kind:ShopifyChannelKind;label:string;shop:string; }>
Defined in: packages/sdk/src/resources/WebsitesApi.ts:438
Add a Shopify-native sales channel (TikTok, Meta/Facebook,
Pinterest, Google, Marketplace Connect). Upserts a pending
WebsiteService row and returns the App Store install URL the
merchant opens in their Shopify admin to complete the install.
Requires Shopify to be connected first — the API rejects with 400 otherwise.
Parameters
Section titled “Parameters”websiteId
Section titled “websiteId”string
ShopifyChannelKind
Returns
Section titled “Returns”Promise<{ installUrl: string; kind: ShopifyChannelKind; label: string; shop: string; }>
amazonAnalytics()
Section titled “amazonAnalytics()”amazonAnalytics(
websiteId):Promise<AmazonCommerceState>
Defined in: packages/sdk/src/resources/WebsitesApi.ts:181
Cached Amazon sales analytics for a website. Amazon is served via
Shopify’s Marketplace Connect, and these metrics are computed from
the Amazon-attributed orders MC imports into Shopify — no Amazon
SP-API access (or its developer fee) involved. Call
refreshAmazonAnalytics to recompute from Shopify.
Parameters
Section titled “Parameters”websiteId
Section titled “websiteId”string
Returns
Section titled “Returns”Promise<AmazonCommerceState>
amazonSetupLink()
Section titled “amazonSetupLink()”amazonSetupLink(
websiteId):Promise<string|null>
Defined in: packages/sdk/src/resources/WebsitesApi.ts:213
Convenience: the deep-link into the merchant’s Marketplace Connect Amazon setup (inside their Shopify admin), or null if Amazon isn’t set up on this website yet.
Parameters
Section titled “Parameters”websiteId
Section titled “websiteId”string
Returns
Section titled “Returns”Promise<string | null>
auditShopifyAmazonProduct()
Section titled “auditShopifyAmazonProduct()”auditShopifyAmazonProduct(
websiteId,productId):Promise<AmazonEligibilityReport>
Defined in: packages/sdk/src/resources/WebsitesApi.ts:659
Audit a single product for Amazon listing eligibility. Reads
Shopify-native fields + variants + resourceFeedback. Returns a
per-variant report of missing required attributes plus a top-level
eligible flag. Note: eligible=true does NOT guarantee Amazon
will list — Marketplace Connect requires its own category/config
inside MC’s app that isn’t queryable from outside.
Parameters
Section titled “Parameters”websiteId
Section titled “websiteId”string
productId
Section titled “productId”string
Returns
Section titled “Returns”Promise<AmazonEligibilityReport>
bulkShopifyPublishing()
Section titled “bulkShopifyPublishing()”bulkShopifyPublishing(
websiteId,input):Promise<ShopifyBulkPublishResponse>
Defined in: packages/sdk/src/resources/WebsitesApi.ts:595
Bulk publish or unpublish up to 25 products against N publications. Sequential server-side; the response carries per-product outcomes. v1 hard-caps at 25 — larger batches will need the v2 SQS-backed job endpoint.
Parameters
Section titled “Parameters”websiteId
Section titled “websiteId”string
action
Section titled “action”"publish" | "unpublish"
productIds
Section titled “productIds”string[]
publicationIds
Section titled “publicationIds”string[]
Returns
Section titled “Returns”Promise<ShopifyBulkPublishResponse>
bulkShopifyPublishingAsync()
Section titled “bulkShopifyPublishingAsync()”bulkShopifyPublishingAsync(
websiteId,input):Promise<BulkPublishAsyncEnqueueResponse>
Defined in: packages/sdk/src/resources/WebsitesApi.ts:619
Async bulk publish/unpublish — same shape as the sync endpoint
but the request returns immediately with a jobId after enqueuing
one SQS message per product. The worker processes them in
parallel-limited batches; poll shopifyBulkPublishingJob(jobId)
to render progress. Capped at 500 products per job server-side.
Use this for batches larger than the sync endpoint’s 25-product
cap.
Parameters
Section titled “Parameters”websiteId
Section titled “websiteId”string
action
Section titled “action”"publish" | "unpublish"
productIds
Section titled “productIds”string[]
publicationIds
Section titled “publicationIds”string[]
Returns
Section titled “Returns”Promise<BulkPublishAsyncEnqueueResponse>
connectShopify()
Section titled “connectShopify()”connectShopify(
websiteId,shop):Promise<{authUrl:string;redirectUri:string;shop:string; }>
Defined in: packages/sdk/src/resources/WebsitesApi.ts:394
Begin a Shopify OAuth connect flow for a website. Pass the
merchant’s shop slug (e.g. “atelier-linden”); the API normalizes
to <slug>.myshopify.com, signs a state token, and returns the
Shopify authorize URL. Open it in a new tab/popup — the merchant
approves in their Shopify admin and Shopify 302s back to
/oauth/shopify/callback to complete the connect (OAuth token
persistence, webhook subscriptions, Vercel env vars + redeploy).
After opening authUrl, poll get(websiteId) until
features.shopify === true to detect completion.
Parameters
Section titled “Parameters”websiteId
Section titled “websiteId”string
string
Returns
Section titled “Returns”Promise<{ authUrl: string; redirectUri: string; shop: string; }>
disconnectShopify()
Section titled “disconnectShopify()”disconnectShopify(
websiteId):Promise<{teardown: {errors:object[];feature:"shopify";removed: {envVars:string[];externalId?:string;oauthRows?:number;serviceRows:number;webhookSubs?:number; }; };website:Website; }>
Defined in: packages/sdk/src/resources/WebsitesApi.ts:413
Disconnect a Shopify store from a website. Synchronously runs the
teardown: unsubscribes Vantage’s webhooks on the merchant’s store,
drops the Vercel SHOPIFY_* env vars, deletes the OAuth token +
WebsiteService rows, flips features.shopify off, triggers a
redeploy. Best-effort — partial failures are surfaced via the
teardown report.
Does NOT uninstall the Vantage Manager app from the merchant’s store admin; the merchant must uninstall there to fully revoke.
Parameters
Section titled “Parameters”websiteId
Section titled “websiteId”string
Returns
Section titled “Returns”Promise<{ teardown: { errors: object[]; feature: "shopify"; removed: { envVars: string[]; externalId?: string; oauthRows?: number; serviceRows: number; webhookSubs?: number; }; }; website: Website; }>
listShopifyChannels()
Section titled “listShopifyChannels()”listShopifyChannels(
websiteId):Promise<ShopifyChannelsResponse>
Defined in: packages/sdk/src/resources/WebsitesApi.ts:506
List installed Shopify Publications (sales-channel apps) on the connected store, classified into the channel handles Vantage supports. Unknown publications are filtered out. Honest empty list when Shopify isn’t connected.
Parameters
Section titled “Parameters”websiteId
Section titled “websiteId”string
Returns
Section titled “Returns”Promise<ShopifyChannelsResponse>
listShopifyProducts()
Section titled “listShopifyProducts()”listShopifyProducts(
websiteId,opts?):Promise<ShopifyCatalogPage>
Defined in: packages/sdk/src/resources/WebsitesApi.ts:536
Paginated product catalog with per-channel publication state.
Cursor-paginated; pass the previous response’s pageInfo.endCursor
as cursor to advance. Page size defaults to 25, capped at 50.
Optional q is forwarded to Shopify’s product search.
Parameters
Section titled “Parameters”websiteId
Section titled “websiteId”string
cursor?
Section titled “cursor?”string
first?
Section titled “first?”number
string
Returns
Section titled “Returns”Promise<ShopifyCatalogPage>
publishShopifyProduct()
Section titled “publishShopifyProduct()”publishShopifyProduct(
websiteId,productId,publicationIds):Promise<ShopifyPublishResult>
Defined in: packages/sdk/src/resources/WebsitesApi.ts:557
Publish a product to one or more Shopify publications. Returns
the freshly-read publication state plus any Shopify-reported
userErrors. Throws (4xx/5xx) only on transport/auth failures;
channel-level validation errors come back in userErrors.
Parameters
Section titled “Parameters”websiteId
Section titled “websiteId”string
productId
Section titled “productId”string
publicationIds
Section titled “publicationIds”string[]
Returns
Section titled “Returns”Promise<ShopifyPublishResult>
refreshAmazonAnalytics()
Section titled “refreshAmazonAnalytics()”refreshAmazonAnalytics(
websiteId,opts?):Promise<AmazonCommerceState>
Defined in: packages/sdk/src/resources/WebsitesApi.ts:194
Recompute Amazon analytics from the connected Shopify store over a trailing window (default 30 days), cache it, and return the fresh state. No-ops (returns current state) if Shopify isn’t connected or there’s no Marketplace Connect channel.
Parameters
Section titled “Parameters”websiteId
Section titled “websiteId”string
window?
Section titled “window?”number
Returns
Section titled “Returns”Promise<AmazonCommerceState>
refreshShopifyAnalytics()
Section titled “refreshShopifyAnalytics()”refreshShopifyAnalytics(
websiteId,opts?):Promise<ShopifyCommerceState>
Defined in: packages/sdk/src/resources/WebsitesApi.ts:242
Force-recompute Shopify-wide commerce analytics over a trailing window (default 30 days, max 60), cache it on the commerce row, and return the fresh state. No-ops (returns the current state) when Shopify isn’t connected.
Parameters
Section titled “Parameters”websiteId
Section titled “websiteId”string
window?
Section titled “window?”number
Returns
Section titled “Returns”Promise<ShopifyCommerceState>
refreshShopifyChannels()
Section titled “refreshShopifyChannels()”refreshShopifyChannels(
websiteId):Promise<{changed:object[];checkedAt:string;websiteId:string; }>
Defined in: packages/sdk/src/resources/WebsitesApi.ts:482
Refresh install status for every channel row on a website by querying Shopify’s publications API. The merchant installs channel apps in their own Shopify admin; this re-checks reality and flips channel rows from “pending” to “installed” once we observe the underlying app is in fact published.
Returns the set of channels whose isInstalled state changed in
this pass — useful for “TikTok just connected!” toasts.
Parameters
Section titled “Parameters”websiteId
Section titled “websiteId”string
Returns
Section titled “Returns”Promise<{ changed: object[]; checkedAt: string; websiteId: string; }>
refreshShopifyInventoryAlerts()
Section titled “refreshShopifyInventoryAlerts()”refreshShopifyInventoryAlerts(
websiteId,opts?):Promise<ShopifyInventoryAlertsState>
Defined in: packages/sdk/src/resources/WebsitesApi.ts:312
Force-recompute Shopify inventory alerts regardless of cache age. Throws when Shopify is disconnected.
Parameters
Section titled “Parameters”websiteId
Section titled “websiteId”string
threshold?
Section titled “threshold?”number
Returns
Section titled “Returns”Promise<ShopifyInventoryAlertsState>
refreshShopifyRecentOrders()
Section titled “refreshShopifyRecentOrders()”refreshShopifyRecentOrders(
websiteId):Promise<ShopifyRecentOrdersState>
Defined in: packages/sdk/src/resources/WebsitesApi.ts:277
Force-recompute the Shopify recent-orders feed regardless of cache age. Throws when Shopify is disconnected.
Parameters
Section titled “Parameters”websiteId
Section titled “websiteId”string
Returns
Section titled “Returns”Promise<ShopifyRecentOrdersState>
removeShopifyChannel()
Section titled “removeShopifyChannel()”removeShopifyChannel(
websiteId,kind):Promise<{kind:ShopifyChannelKind;label:string;note:string;removed:true; }>
Defined in: packages/sdk/src/resources/WebsitesApi.ts:458
Remove Vantage’s record of a Shopify channel. Does NOT uninstall the Shopify app on the merchant’s store — merchant must uninstall from their Shopify admin to fully revoke. Idempotent: DELETE on a missing row is a no-op.
Parameters
Section titled “Parameters”websiteId
Section titled “websiteId”string
ShopifyChannelKind
Returns
Section titled “Returns”Promise<{ kind: ShopifyChannelKind; label: string; note: string; removed: true; }>
shopifyAnalytics()
Section titled “shopifyAnalytics()”shopifyAnalytics(
websiteId):Promise<ShopifyCommerceState>
Defined in: packages/sdk/src/resources/WebsitesApi.ts:229
Shopify-wide commerce analytics for a website — all orders across
the trailing window (no marketplace attribution filter). The
commerce node’s own snapshot, sister to amazonAnalytics which
is the Marketplace Connect / Amazon view.
Returns the cached snapshot off the commerce row; if older than
1 hour the API recomputes from Shopify before responding. Call
refreshShopifyAnalytics to force a recompute regardless of cache
age.
Parameters
Section titled “Parameters”websiteId
Section titled “websiteId”string
Returns
Section titled “Returns”Promise<ShopifyCommerceState>
shopifyBulkPublishingJob()
Section titled “shopifyBulkPublishingJob()”shopifyBulkPublishingJob(
websiteId,jobId):Promise<BulkPublishJobStatusResponse>
Defined in: packages/sdk/src/resources/WebsitesApi.ts:639
Status of an async bulk publish job. Returns the current state
plus every per-product outcome recorded so far. Portal polls
this until state === "done".
Parameters
Section titled “Parameters”websiteId
Section titled “websiteId”string
string
Returns
Section titled “Returns”Promise<BulkPublishJobStatusResponse>
shopifyChannelSummary()
Section titled “shopifyChannelSummary()”shopifyChannelSummary(
websiteId):Promise<ChannelSummariesResponse>
Defined in: packages/sdk/src/resources/WebsitesApi.ts:521
Per-channel publication summary — total / published / pending / action_required product counts for each installed channel. Approximate when the catalog exceeds the server-side cap (500 products); exact for smaller catalogs.
Parameters
Section titled “Parameters”websiteId
Section titled “websiteId”string
Returns
Section titled “Returns”Promise<ChannelSummariesResponse>
shopifyInventoryAlerts()
Section titled “shopifyInventoryAlerts()”shopifyInventoryAlerts(
websiteId,opts?):Promise<ShopifyInventoryAlertsState>
Defined in: packages/sdk/src/resources/WebsitesApi.ts:294
Low-stock inventory alerts for the connected Shopify store. Returns variants whose tracked inventory is at or below the threshold (default 5, range 1–100). Cached server-side; recomputes lazily on a 1-hour TTL or whenever an INVENTORY_LEVELS_UPDATE webhook invalidates the cache. Returns an honest empty alert set when Shopify isn’t connected.
Parameters
Section titled “Parameters”websiteId
Section titled “websiteId”string
threshold?
Section titled “threshold?”number
Returns
Section titled “Returns”Promise<ShopifyInventoryAlertsState>
shopifyPublishingActivity()
Section titled “shopifyPublishingActivity()”shopifyPublishingActivity(
websiteId):Promise<PublishingActivityResponse>
Defined in: packages/sdk/src/resources/WebsitesApi.ts:677
Recent publishing activity (last ≤50 events, newest first). Mixes operator-triggered actions (matrix toggles, bulk operations) and webhook-observed channel events. The portal filters per-channel client-side for the summary card feeds.
Parameters
Section titled “Parameters”websiteId
Section titled “websiteId”string
Returns
Section titled “Returns”Promise<PublishingActivityResponse>
shopifyRecentOrders()
Section titled “shopifyRecentOrders()”shopifyRecentOrders(
websiteId):Promise<ShopifyRecentOrdersState>
Defined in: packages/sdk/src/resources/WebsitesApi.ts:264
Recent orders feed for the connected Shopify store. Returns up to the last 20 orders, newest first, with display fields suitable for an operator glance (“what just happened in the store?”). Cached server-side; recomputes lazily on a 5-minute TTL or whenever a webhook invalidates the cache. Returns an honest empty feed when Shopify isn’t connected — never an error.
Parameters
Section titled “Parameters”websiteId
Section titled “websiteId”string
Returns
Section titled “Returns”Promise<ShopifyRecentOrdersState>
shopifyWebhookHealth()
Section titled “shopifyWebhookHealth()”shopifyWebhookHealth(
websiteId):Promise<ShopifyWebhookHealth>
Defined in: packages/sdk/src/resources/WebsitesApi.ts:333
Live Shopify webhook subscription health for a website. Diffs the topics Vantage expects to be subscribed (SHOPIFY_WEBHOOK_TOPICS) against what the connected store actually has registered, and reports last-received webhook signal from the commerce row’s metadata. Returns a nulls-only state when Shopify isn’t connected.
Parameters
Section titled “Parameters”websiteId
Section titled “websiteId”string
Returns
Section titled “Returns”Promise<ShopifyWebhookHealth>
subscribeShopifyWebhookHealth()
Section titled “subscribeShopifyWebhookHealth()”subscribeShopifyWebhookHealth(
websiteId,opts?):Promise<ShopifyWebhookHealth>
Defined in: packages/sdk/src/resources/WebsitesApi.ts:351
Subscribe webhook topics on the connected Shopify store. With no
topics argument, subscribes every admin-API topic that’s
currently missing (the “Subscribe N missing topics” bulk button).
With an explicit topics array, subscribes only those (used by
per-row Subscribe buttons in the health panel). GDPR / unknown
topics in the array are rejected with 400 — only members of
adminApiTopics are accepted. Idempotent — already-subscribed
topics are no-ops. Returns the freshly-diffed
ShopifyWebhookHealth so callers update their UI in place.
Parameters
Section titled “Parameters”websiteId
Section titled “websiteId”string
topics?
Section titled “topics?”string[]
Returns
Section titled “Returns”Promise<ShopifyWebhookHealth>
unpublishShopifyProduct()
Section titled “unpublishShopifyProduct()”unpublishShopifyProduct(
websiteId,productId,publicationIds):Promise<ShopifyPublishResult>
Defined in: packages/sdk/src/resources/WebsitesApi.ts:575
Unpublish a product from one or more Shopify publications. Same
response contract as publishShopifyProduct.
Parameters
Section titled “Parameters”websiteId
Section titled “websiteId”string
productId
Section titled “productId”string
publicationIds
Section titled “publicationIds”string[]
Returns
Section titled “Returns”Promise<ShopifyPublishResult>
unsubscribeShopifyWebhookTopic()
Section titled “unsubscribeShopifyWebhookTopic()”unsubscribeShopifyWebhookTopic(
websiteId,topic):Promise<ShopifyWebhookHealth>
Defined in: packages/sdk/src/resources/WebsitesApi.ts:372
Unsubscribe a single webhook topic from the connected Shopify
store — the per-row Unsubscribe button. Scoped to subscriptions
whose callback URL matches the Vantage webhook handler (won’t
touch a merchant’s own subscriptions). Idempotent (no-op when
the topic isn’t currently subscribed). GDPR topics return 400.
Returns the freshly-diffed ShopifyWebhookHealth.
Parameters
Section titled “Parameters”websiteId
Section titled “websiteId”string
string
Returns
Section titled “Returns”Promise<ShopifyWebhookHealth>