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
- Create a free Crossly account: https://crossly.net/register
- 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. - Export it as
CROSSLY_PATand send it asAuthorization: Bearer $CROSSLY_PATtohttps://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
statusisactive,needs_reauth(session died, reconnect it) orarchived(disconnected; the row stays for history).platformUsernamestaysnulluntil a session arrives. attachedToStoresays whether the store inX-Storefront-Idmay use that connection; it isnullwhen 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:
shopifyneeds?shop=<store>.myshopify.com(else400 missing_shop);woocommerceneeds?siteUrl=https://…(400 missing_site_url/invalid_site_url);amazontakes?region=.bonanzaaddsoneShot: true(single-use URL).walmartanswers{ status: "own_credentials", connectWith, docsUrl, message }: the seller connects their own Seller Center keys.- An
own_appmarketplace needs the seller's developer app saved first:PUT /v1/connections/own-apps/{platform}with{ clientId, clientSecret?, params?, secretParams? }(crossly.marketplaces.saveOwnApp(platform, body)), else400 own_app_required.GET /v1/connections/own-appslists which marketplaces take one; secrets are never returned. - A platform with no OAuth start is
400 unsupported_platform; an upstream failure is502 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}/connectwith optional{ accountId }(crossly.connections.connect(platform, { accountId })) revives an archived orneeds_reauthslot instead of making a new one.statuscomes backalready_active,connected,pending_verify(the seller must sign in again through the extension) orno_row_yet;404 account_not_foundfor a wrongaccountId.- An API connection with
isActive: falsewas revoked at the marketplace or its refresh failed for good: start OAuth again (section 2). GET /v1/connections/extension-onlinesays 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-importwith{ 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/limitsreturns{ 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/pooljoins the reciprocal share / follow / like pool,PATCH /v1/network/poolsets{ shareEnabled, followEnabled, likeEnabled, platforms },DELETEleaves (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) orisActive: true(API). Anything else means reconnect, not retry. - Never set
acceptOverage: truewithout the seller agreeing to the $5/month charge. - Subscribe to
connection.disconnectedin any integration that mirrors sales or listings. - Use
GET /v1/platformsfor availability and platforms.md for limits; don't hard-code a marketplace list. - Send an
Idempotency-Keyon 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
