Skip to content

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).

  • Resource

new WebsitesCommerceApi(opts): WebsitesCommerceApi

Defined in: packages/sdk/src/request.ts:93

VantageClientOptions

WebsitesCommerceApi

Resource.constructor

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.

string

ShopifyChannelKind

Promise<{ installUrl: string; kind: ShopifyChannelKind; label: string; shop: string; }>


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.

string

Promise<AmazonCommerceState>


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.

string

Promise<string | null>


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.

string

string

Promise<AmazonEligibilityReport>


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.

string

"publish" | "unpublish"

string[]

string[]

Promise<ShopifyBulkPublishResponse>


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.

string

"publish" | "unpublish"

string[]

string[]

Promise<BulkPublishAsyncEnqueueResponse>


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.

string

string

Promise<{ authUrl: string; redirectUri: string; shop: string; }>


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.

string

Promise<{ teardown: { errors: object[]; feature: "shopify"; removed: { envVars: string[]; externalId?: string; oauthRows?: number; serviceRows: number; webhookSubs?: number; }; }; website: Website; }>


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.

string

Promise<ShopifyChannelsResponse>


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.

string

string

number

string

Promise<ShopifyCatalogPage>


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.

string

string

string[]

Promise<ShopifyPublishResult>


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.

string

number

Promise<AmazonCommerceState>


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.

string

number

Promise<ShopifyCommerceState>


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.

string

Promise<{ changed: object[]; checkedAt: string; websiteId: string; }>


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.

string

number

Promise<ShopifyInventoryAlertsState>


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.

string

Promise<ShopifyRecentOrdersState>


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.

string

ShopifyChannelKind

Promise<{ kind: ShopifyChannelKind; label: string; note: string; removed: true; }>


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.

string

Promise<ShopifyCommerceState>


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".

string

string

Promise<BulkPublishJobStatusResponse>


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.

string

Promise<ChannelSummariesResponse>


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.

string

number

Promise<ShopifyInventoryAlertsState>


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.

string

Promise<PublishingActivityResponse>


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.

string

Promise<ShopifyRecentOrdersState>


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.

string

Promise<ShopifyWebhookHealth>


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.

string

string[]

Promise<ShopifyWebhookHealth>


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.

string

string

string[]

Promise<ShopifyPublishResult>


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.

string

string

Promise<ShopifyWebhookHealth>