360 Secure SkillHub
360 安全技能中心

Crossly Marketplace connections

面向开发者的 Crossly 卖家账户管理 Skill:区分 cookie 会话账户和 OAuth/API 连接,查询平台目录、发起 OAuth、创建账户槽位、检查连接健康、重连或断开账户,并按店铺挂载账户;还包含断连 webhook 事件和平台限额参考。核心依赖 Crossly API 与个人访问令牌。

分类:开发
crossly
热度 9.16
最近更新 2026-11-30 11:10:34

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add crossly/crossly-marketplace-connections
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
name
crossly-marketplace-connections
description
Connect and monitor a seller's marketplace accounts through the Crossly API. List session (cookie) accounts with GET /v1/accounts and OAuth/API connections with GET /v1/connections, read the catalog of marketplaces (GET /v1/platforms), start OAuth (GET /v1/oauth/{platform}/init), add account slots (POST /v1/accounts with acceptOverage, hard cap 20 per platform), check health (GET /v1/connection-health), revive or disconnect accounts, attach accounts to stores with X-Storefront-Id (/v1/connections/stores/*), and react to the connection.disconnected webhook. Includes a per-platform reference (track, image caps, required fields, weight rule, offers, title limits). Use when code needs to know which marketplaces a seller can crosspost to, connect or reconnect one, diagnose a dead session, or manage multi-account and multi-store setups.

Marketplace connections with Crossly

Before Crossly can publish anywhere, the seller connects that marketplace once. There are two tracks, and they live in two different collections:

Track Marketplaces How it connects Listed by
cookie (session) poshmark, mercari, facebook, depop, grailed, vinted, whatnot, vestiaire, offerup, curtsy The seller signs in on the marketplace and the Crossly browser extension hands the session to Crossly's servers GET /v1/accounts
api (OAuth / keys) every other id: ebay, etsy, shopify, amazon, walmart, tcgplayer, crossly, … OAuth sign-in, a pasted API key, or the seller's own developer app GET /v1/connections

Either way, publishing, edits, delists and sale checks run on Crossly's servers. Per-platform limits and capabilities are in platforms.md next to this file. Auth: crossly-api-setup. Errors, idempotency, pagination, rate limits: crossly-api-conventions.

Setup

  1. Create a free Crossly account: https://crossly.net/register
  2. Create a personal access token at https://crossly.net/settings/api/tokens/new (guide: https://crossly.net/guides/personal-access-tokens). Use a crossly_pat_test_ token against the sandbox while building.
  3. Export it as CROSSLY_PAT and send it as Authorization: Bearer $CROSSLY_PAT to https://crossly.net/api/v1/*. Full docs: https://crossly.net/docs

Scopes

Endpoints Scope
GET /v1/accounts, GET /v1/connections, GET /v1/platforms, GET /v1/connection-health, GET /v1/connections/stores, GET /v1/connections/extension-online, GET /v1/platforms/limits, GET /v1/connections/own-apps accounts:read
POST /v1/accounts, DELETE /v1/accounts/{id}, GET /v1/oauth/{platform}/init, POST /v1/platform-accounts/{platform}/connect (disconnect, history-import), POST /v1/platform-accounts/refresh-status, DELETE /v1/connections/by-id/{id}, /v1/connections/stores/attach (detach, copy), PUT/DELETE /v1/connections/own-apps/{platform}, PATCH /v1/platforms/{platform}/preferences accounts:write
/v1/network/pool (Crossly Network engagement pool) automation:read / automation:write

GET /v1/connections and the /v1/connections/stores routes also check the store's team permission for Connections (read or write) in the store named by X-Storefront-Id (else the default store).

1. What can the seller crosspost to?

import { createClient } from '@crossly/sdk';
const crossly = createClient({ pat: process.env.CROSSLY_PAT! });

const accounts = await crossly.accounts.list() as {          // GET /v1/accounts (cookie track)
  data: { id: string; platform: string; accountSlot: number; label: string | null;
          platformUsername: string | null; status: string; lastSyncedAt: string | null }[];
};
const conns = await crossly.accounts.listConnections() as {  // GET /v1/connections (api track)
  data: { id: string; platform: string; isActive: boolean; shopUrl: string | null;
          tokenExpiresAt: string | null; attachedToStore: boolean | null }[];
};

const connected = new Set([
  ...accounts.data.filter((a) => a.status === 'active').map((a) => a.platform),
  ...conns.data.filter((c) => c.isActive && c.attachedToStore !== false).map((c) => c.platform),
]);
  • An account status is active, needs_reauth (session died, reconnect it) or archived (disconnected; the row stays for history). platformUsername stays null until a session arrives.
  • attachedToStore says whether the store in X-Storefront-Id may use that connection; it is null when the request names no store.
  • A sandbox token (see crossly-sandbox-testing) sees every simulated marketplace as connected.

GET /v1/platforms (crossly.marketplaces.list()) is the catalog: every marketplace with track (api / cookie), availability (connect, own_app = needs the seller's own developer app, coming_soon = cannot connect yet), connectFlow (cookie, oauth, credentials, dialog), multiAccount and capability chips (beta, listing_soon, orders_soon, messages_soon, labels_soon). Read it instead of hard-coding which marketplaces are open.

2. Connect an API marketplace

const init = await crossly.connections.oauthInitUrl('shopify', { shop: 'mystore.myshopify.com' }) as {
  url?: string; oneShot?: boolean; status?: string; connectWith?: string; docsUrl?: string; message?: string;
};
// Send the seller to init.url; the connection appears in GET /v1/connections when they approve.

GET /v1/oauth/{platform}/init returns { url } for most platforms. Exceptions:

  • shopify needs ?shop=<store>.myshopify.com (else 400 missing_shop); woocommerce needs ?siteUrl=https://… (400 missing_site_url / invalid_site_url); amazon takes ?region=.
  • bonanza adds oneShot: true (single-use URL).
  • walmart answers { status: "own_credentials", connectWith, docsUrl, message }: the seller connects their own Seller Center keys.
  • An own_app marketplace needs the seller's developer app saved first: PUT /v1/connections/own-apps/{platform} with { clientId, clientSecret?, params?, secretParams? } (crossly.marketplaces.saveOwnApp(platform, body)), else 400 own_app_required. GET /v1/connections/own-apps lists which marketplaces take one; secrets are never returned.
  • A platform with no OAuth start is 400 unsupported_platform; an upstream failure is 502 external_service_error (retry).

Key-based connects have their own routes: POST /v1/connections/cardnexus/api-key (crossly.connections.connectCardnexus(apiKey), validated live) and POST /v1/connections/lightspeed_x/token (crossly.connections.connectLightspeedX({ domainPrefix, accessToken })).

3. Add a cookie account slot

POST /v1/accounts creates an empty slot; the seller then signs in on the marketplace and clicks Connect in the Crossly extension, which fills it. Send it only for cookie-track ids.

curl -X POST https://crossly.net/api/v1/accounts \
  -H "Authorization: Bearer $CROSSLY_PAT" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"platform":"poshmark","label":"Vintage closet","acceptOverage":false}'
# 201 { "id": "<uuid>", "platform": "poshmark", "accountSlot": 2, "region": "us", "proxyAssigned": true }

Body: platform (required), label (up to 60 chars), acceptOverage (default false). SDK: crossly.accounts.create(body, { idempotencyKey }).

Slots, proxies and the cap. Each cookie account runs from a residential connection address (proxy). Accounts on different marketplaces in the same region share one address for free; a second account on the same platform, or an account in a new region, needs another. Plans include 1 (Free, Starter), 3 (Pro), 5 (Business) or 10 (Scale) addresses; each extra one is $5/month.

Status Code Meaning
402 overage_consent_required This account needs a paid extra address. The error carries newOverageQuantity and monthlyCostUsd: 5. Show the seller the charge, then retry with acceptOverage: true.
402 billing_failed The billing update failed; the row was rolled back.
409 hard_cap_reached 20 accounts on that platform already (support can raise it).
409 no_slot_available No free slot for that platform.
503 no_proxy_in_region No connection address available in that region yet.

The same marketplace account can be linked to only one Crossly account at a time; for staff access use team seats (crossly-team-stores), not a second connection.

4. Health and reconnecting

const health = await crossly.devices.health() as {            // GET /v1/connection-health
  extension: { online: boolean; lastBrowserPushAt: string | null; reportedVersion: string | null };
  accounts: { platform: string; accountId: string; accountSlot: number; accountStatus: string;
              state: string; severity: string; summary: string; action: string | null }[];
  generatedAt: string;
};

One entry per cookie account (slot 2 can be dead while slot 1 is fine). state is healthy, stale, signed_out, no_cookies, blank_credential, partial_blank, anchor_drift, disconnected, unmonitored or unknown (never measured: not a failure); severity is ok, info, warn, error or unknown; summary and action are plain-English text for the seller. ?includeUnconnected=true adds a row per platform never connected.

  • POST /v1/platform-accounts/refresh-status (crossly.connections.refreshStatus()) runs the session checks now and returns { results }.
  • POST /v1/platform-accounts/{platform}/connect with optional { accountId } (crossly.connections.connect(platform, { accountId })) revives an archived or needs_reauth slot instead of making a new one. status comes back already_active, connected, pending_verify (the seller must sign in again through the extension) or no_row_yet; 404 account_not_found for a wrong accountId.
  • An API connection with isActive: false was revoked at the marketplace or its refresh failed for good: start OAuth again (section 2).
  • GET /v1/connections/extension-online says whether the seller's extension is running right now. Jobs do not need it to be online.

The connection.disconnected webhook

Subscribe to it (see crossly-webhooks): a dead session silently stops every sync for that marketplace. It fires when Crossly detects the death, not when you disconnect on purpose.

{ "type": "connection.disconnected",
  "data": { "platform": "poshmark", "accountSlot": 1, "reason": "session_expired", "detectedAt": "2026-09-11T14:02:11.000Z" } }

reason is session_expired for a cookie account, token_revoked or unauthorized for an API connection (whose accountSlot is null). Related, finer-grained events: connection.lost, connection.degraded, connection.restored, connection.session_expiring.

5. Disconnect

Call What it removes
DELETE /v1/accounts/{id} (crossly.accounts.delete(id)) One cookie account: archived, its stored session deleted. 404 not_found if it isn't the seller's.
POST /v1/platform-accounts/{platform}/disconnect (crossly.connections.disconnect(platform)) Every cookie account of that platform; returns { archived }.
DELETE /v1/connections/by-id/{id} (crossly.connections.deleteById(id)) One API connection: access revoked where the marketplace allows it, and switched off.
DELETE /v1/connections/own-apps/{platform} The seller's own developer app; connections it authorized are switched off.

Listings already live on the marketplace stay there; Crossly just stops managing them. Disconnecting frees the slot's proxy once no other platform uses that slot.

6. Stores: which store may use which account

A seller with several stores attaches each marketplace account to the stores that may publish through it. "This store" is X-Storefront-Id (SDK: createClient({ pat, storefrontId }) or { storefrontId } per call), else the default store.

const view = await crossly.connections.stores() as {           // GET /v1/connections/stores
  data: { stores: { id: string; name: string; isDefault: boolean }[];
          attachments: { storefrontId: string; kind: 'api' | 'cookie'; connectionId: string;
                         platform: string; isDefault: boolean; isHome: boolean }[] };
};
await crossly.connections.attachToStore({ kind: 'api', connectionId: conns.data[0].id },
  { storefrontId: '<store uuid>', idempotencyKey: crypto.randomUUID() });   // POST /v1/connections/stores/attach

detachFromStore (POST /v1/connections/stores/detach) stops one store using an account (it stays connected for the others); copyToStores(account, storefrontIds) (POST /v1/connections/stores/copy) attaches it to several at once. kind is api for a GET /v1/connections id and cookie for a GET /v1/accounts id.

7. After connecting

  • History import: POST /v1/platform-accounts/{platform}/history-import with { days, accountId? } (crossly.connections.setHistoryImportWindow(platform, days, { accountId })) sets how far back past sales and active listings import: null = all time, 0 = none, N = days (max 3650). Unknown platform: 400 unknown_platform. Per account: GET/PUT /v1/channel-accounts/{accountId}/history-import. Imports themselves: crossly-imports-sync.
  • eBay free tier / Etsy fees: GET /v1/platforms/limits returns { ebay, etsy }; PATCH /v1/platforms/{platform}/preferences?connection_id= with { freeListingTier?, respectFreeQuota? } (400 no_fields_to_update, 404 connection_not_found).
  • Policy management (Crossly keeps eBay / Etsy business policies in step with presets): GET /v1/connections/policy-management, PUT /v1/connections/policy-management/{connectionId} with { managed }. See crossly-listing-overrides.
  • Crossly Network: POST /v1/network/pool joins the reciprocal share / follow / like pool, PATCH /v1/network/pool sets { shareEnabled, followEnabled, likeEnabled, platforms }, DELETE leaves (crossly.network.joinPool(), updatePool(), leavePool()).

Rules

  • Check both collections: cookie accounts (GET /v1/accounts) and API connections (GET /v1/connections) never appear in each other.
  • A connected account is status: "active" (cookie) or isActive: true (API). Anything else means reconnect, not retry.
  • Never set acceptOverage: true without the seller agreeing to the $5/month charge.
  • Subscribe to connection.disconnected in any integration that mirrors sales or listings.
  • Use GET /v1/platforms for availability and platforms.md for limits; don't hard-code a marketplace list.
  • Send an Idempotency-Key on every write.

Docs: https://crossly.net/docs/platform-overview · https://crossly.net/docs/api-platforms · https://crossly.net/docs/cookie-platforms · https://crossly.net/docs/api-accounts