Crossly Imports sync
Latest: v1.0.0
Initial release
Imports and store sync
Three ways stock gets into Crossly without retyping:
| Way | Use it when | Endpoint |
|---|---|---|
| Marketplace import | The items are already live on a connected marketplace. Links each item to its live listing, so sales are detected and the other copies delisted from day one. | /v1/imports |
| CSV import | Stock that isn't listed anywhere, a move off another tool, or offline edits of item details. | /v1/inventory/csv/import |
| Source sync | The seller's own store (Shopify, WooCommerce…) stays in charge and every change should flow out to the marketplaces. | /v1/source-sync |
Scopes: inventory:read / inventory:write for imports and CSV, source-sync:read / source-sync:write for store sync. Auth: crossly-api-setup. Errors and idempotency: crossly-api-conventions. The account must already be connected (crossly-marketplace-connections).
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
Marketplace import
import { createClient } from '@crossly/sdk';
const crossly = createClient({ pat: process.env.CROSSLY_PAT! });
const { jobId } = await crossly.imports.start( // POST /v1/imports -> 202
{ platform: 'ebay', marketplaces: ['EBAY_US', 'EBAY_GB'] },
{ idempotencyKey: crypto.randomUUID() },
) as { jobId: string; platform: string; status: 'queued' };
for (;;) {
const job = await crossly.imports.get(jobId) as { // GET /v1/imports/{id}
status: 'queued' | 'running' | 'completed' | 'failed';
totalCount: number; importedCount: number; skippedCount: number; errorCount: number;
lastError: string | null;
};
if (job.status === 'completed') break;
if (job.status === 'failed') throw new Error(`Import failed: ${job.lastError}`);
await new Promise((r) => setTimeout(r, 10_000));
}
curl -X POST https://crossly.net/api/v1/imports \
-H "Authorization: Bearer $CROSSLY_PAT" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"platform":"poshmark"}'
Body:
| Field | Notes |
|---|---|
platform | Required platform id (poshmark, ebay, mercari, depop, etsy, shopify…). An unknown id is 400 import_failed. |
marketplaces | eBay only: up to 25 site ids matching EBAY_* (EBAY_US, EBAY_GB). Omit for every site. GET /v1/imports/sites?platform=ebay lists the sites the account's listings are on, with counts. |
listOnCrossly | Also list what the import brings in on Crossly's own marketplace once each item's details are filled in. |
Every /v1 import runs in both mode (inventory items and linked listings) and pulls active listings only. Inventory-only, listings-only, sold-and-delisted history and the date or price filters are dashboard options.
The job: status (queued, running, completed, failed), totalCount (set once the fetch completes), importedCount (grows while it runs), skippedCount, errorCount, lastError, startedAt, finishedAt. Problems found while running (an expired marketplace session, say) end as failed with lastError naming the next step. GET /v1/imports lists the 50 most recent jobs, newest first, as { data, pagination }.
Poll every 5-10 seconds. There is no import-finished webhook.
Dedup, merges and stock
- Already tracked: a listing whose
(platform, platformListingId)Crossly already has is skipped, so re-running an import is safe and only brings in what is new. A re-import never overwrites details edited in Crossly. - Same item on two marketplaces: items are matched to an existing inventory item only on an identifier (SKU) or a conclusive photo match, never on a similar title, so two "Nike Tee" shirts stay two items. Uncertain pairs are left for the seller to decide in the dashboard. Merge leftovers yourself with
POST /v1/inventory/merge{ keepItemId, mergeItemIds }; stock is not summed (see crossly-inventory). - Stock: only marketplaces that show a real count (eBay, Etsy, Shopify, Poshmark, Whatnot, Depop) decide an item's quantity. When two disagree, Crossly takes the lower number and flags it. One-at-a-time marketplaces (Mercari, Grailed, Vinted…) always say 1 and don't count. Raise stock afterwards with
POST /v1/inventory/bulk-quantityif the shelf holds more. - Plan limit: each new inventory item counts toward the monthly allowance (Free 25, Starter 150, Pro 500, Business 10,000, Scale 100,000). Past it, the rest are skipped, not failed, and the job still completes. Listings attached to items you already have don't count.
- Nothing is crossposted. An import only mirrors existing listings. Crosspost afterwards (crossly-crosspost, crossly-bulk-operations).
CSV import and export
The CSV is sent as a JSON string, up to 8 MB and 5,000 rows (rows past that are reported as skippedOverLimit).
import { readFileSync } from 'node:fs';
const csv = readFileSync('items.csv', 'utf8');
const preview = await crossly.inventory.importCsv({ csv, dryRun: true }) as { // POST /v1/inventory/csv/import
totalRows: number; usable: number; created: number; updated: number;
problems: { line: number }[]; problemCount: number; skippedOverLimit: number; maxRows: number;
};
if (preview.problemCount === 0) {
await crossly.inventory.importCsv({ csv }, { idempotencyKey: crypto.randomUUID() });
}
const out = await crossly.inventory.exportCsv({}); // POST /v1/inventory/csv/export -> text/csv
- Always dry-run first.
dryRun: truevalidates and counts without writing.problems[].lineis 1-based and counts the header row, so it matches the spreadsheet. - SKU decides add vs update: a row whose
skuexactly matches an item updates it; a row with no usable SKU (N/A,none,-count as none) adds a new item. Titles are never used to match. - Columns:
titleandpriceare required (missing or non-numeric is a skipped row), thenquantity(blank = 1,0= none),condition,brand,size,color,sku,cost_of_goods(your cost, not a "was" price),description,images,category_main,category_sub,tags,notes,warehouse_location,storage_bin. Headers match loosely (Cost of Goodsworks). Separate several values in one cell with;. Prices like$12.50,12,50and1.299,00parse. - Price, description and category make a draft listing for a new row (
listingsCreatedcounts them). On an update row they are ignored; reprice existing listings with bulk update. A CSV import never publishes to a marketplace. - Updates overwrite: on an update, a blank
quantitysets stock to 1, and blankimages,tagsorcolorclear those fields. Keep those columns filled, or drop the rows you aren't changing. - Image links must be public; Crossly copies each photo into the seller's storage.
- An empty or headerless file is
400 no_rows. - Export takes optional
itemIds(up to 20,000) and returnstext/csvwith exactly the columns import reads, so export → edit → import round-trips.
CLI (@crossly/cli), which reads the file itself instead of passing it through argv:
crossly inventory import items.csv # validates only, writes nothing
crossly inventory import items.csv --yes # writes
crossly inventory export items.csv # or no file for stdout; --ids a,b,c for a selection
Continuous source-store sync
Make the seller's own store the source of truth: new products, edits, stock and removals there flow into Crossly and out to every marketplace. Shopify, WooCommerce, BigCommerce and Lightspeed X-Series push changes instantly; Wix, Squarespace and Lightspeed R-Series are checked every 30 minutes, and every store is fully re-checked every 30 minutes.
const { data } = await crossly.sourceSync.list() as { // GET /v1/source-sync
data: { platform: string; connected: boolean; webhooks: boolean; lastEventAt?: string | null;
lastReconciledAt?: string | null; lastError?: string | null; linkedProducts: number }[];
};
await crossly.sourceSync.update('shopify', { // PATCH /v1/source-sync/{platform}
enabled: true,
sourceOwnedFields: ['title', 'description', 'price', 'images', 'quantity'],
importNewProducts: true,
onSourceDelete: 'delist_everywhere', // or source_only
autoExportEnabled: true,
autoExportPlatforms: ['ebay', 'poshmark'],
}, { idempotencyKey: crypto.randomUUID() });
await crossly.sourceSync.syncNow('shopify'); // POST /v1/source-sync/{platform}/sync -> 202
| Setting | Meaning |
|---|---|
sourceOwnedFields | Fields that always follow the store: title, description, price, images, quantity, sku, brand, tags. Unticked fields keep Crossly's value; a sync never overwrites with a blank. |
importNewProducts | Create a Crossly listing when a product is added to the store. |
onSourceDelete | delist_everywhere ends it on every channel when the product is removed or unpublished; source_only marks only the store copy removed. |
autoExportEnabled + autoExportPlatforms | Crosspost each newly imported product to those connected marketplaces automatically. |
- Platforms:
shopify,woocommerce,bigcommerce,wix,squarespace,lightspeed_r,lightspeed_x,square. POST /v1/source-sync/{platform}/syncre-reads the whole catalogue in the background; with sync off it is400 sync_off.GET /v1/source-sync/events?platform=shopify&limit=200shows each webhook delivery and reconcile change with itsoutcome,fieldsanderror. Read it before telling a seller a change "didn't sync".- Registers (
lightspeed_r,lightspeed_x,square): stock is per location.GET /v1/source-sync/{platform}/locationslists them;PUT /v1/source-sync/{platform}/location{ locationId }picks the one Crossly syncs. Register sales arrive as sales and counted stock as changes, soquantityisn't a source-owned field there. - Sales are not part of store sync: a sale anywhere lowers stock and delists elsewhere as usual.
Rules
- Connect the account before importing; poll the job until
completedorfailed, never assume. - Send an
Idempotency-KeyonPOST /v1/importsand on CSV writes; a retried import without one starts a second job. - Dry-run every CSV and show
problemsbefore writing; keep theskucolumn so a re-import updates instead of duplicating. - Don't pass prices or descriptions through CSV to change live listings; use bulk update.
- With source sync on, edit source-owned fields in the store, not in Crossly, or the next sync puts them back.
Docs: https://crossly.net/docs/api-imports · https://crossly.net/docs/inventory-bulk-import · https://crossly.net/docs/store-sync · https://crossly.net/docs/api-cli
