Bulk operations on Crossly
Bulk endpoints exist so you never loop a single-item route hundreds of times. Two kinds:
- Per-item synchronous:
POST /v1/listings/bulkanswers with one result per item. - Queued: the other listing bulk verbs (and inventory label, archive, quantity pushes) validate the selection, write one bulk job and return a
bulkJobIdstraight away. The marketplace work runs in the background.
Scopes: listings:write for every listing bulk route below, inventory:write for the inventory ones, product-sets:read / product-sets:write for product sets. Auth: crossly-api-setup. Errors, idempotency and 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
Bulk create listings
import { createClient } from '@crossly/sdk';
const crossly = createClient({ pat: process.env.CROSSLY_PAT! });
const res = await crossly.listings.bulkCreate( // POST /v1/listings/bulk, body { items }
rows.slice(0, 50).map((r) => ({
clientReferenceId: r.sku, // required, 1-100 chars, your id for the item
inventoryItemId: r.inventoryItemId,
platforms: ['ebay', 'poshmark'],
data: { title: r.title, price: r.price, weightLb: r.weightLb }, // a POST /v1/listings body
})),
{ idempotencyKey: crypto.randomUUID() }) as {
data: { index: number; clientReferenceId?: string; status: 'created' | 'existing' | 'error';
httpStatus: number; listingId?: string; jobs?: unknown[]; skipped?: unknown[];
error?: { code: string; message: string } }[];
meta: { created: number; existing: number; failed: number };
};
- 1-50 items per call. Items run in order and independently.
created: the listing exists; platforms it could not be sent to are in that item'sskipped(for exampleweight_required).existing: thatclientReferenceIdwas already used, the existing listing is returned and nothing is created. This is what makes retrying a whole batch safe: only what is missing gets created.error: no listing exists for the item;error.codeis whatPOST /v1/listingswould have answered (validation_error,plan_limit_reached, …).
The listing body itself is described in crossly-crosspost.
Queued listing actions
All take listingIds (UUIDs of your listings) and an optional filters object that narrows the selection server-side: listedMoreThanDays, noSaleDays, priceMin, priceMax, viewsLessThan, favoritesLessThan, quantityAvailableLessThanOrEqual, listedOnLessThan, listedOnAtLeast, brandContains, hasAnyLabels, hasNoneLabels, condition. If nothing matches, the answer is 200 with bulkJobId: null.
| Endpoint | SDK | What it does |
|---|---|---|
POST /v1/listings/bulk-update |
bulkUpdate |
Title / description / price edits (below). Pushes only the changed fields to every marketplace each listing is live on. |
POST /v1/listings/bulk-delist |
bulkDelist |
Takes the listings down on their marketplaces. |
POST /v1/listings/bulk-relist |
bulkRelist |
Ends and relists to refresh them. platforms optional. |
POST /v1/listings/bulk-crosspost |
bulkCrosspost |
Publishes to more marketplaces, no delist phase. platforms required (400 invalid_request without). |
POST /v1/listings/bulk-delete |
bulkDelete |
Archives and delists. |
POST /v1/listings/bulk-hard-delete |
bulkHardDelete |
Permanently deletes. Live listings need allowLive: true (they stay up on the marketplaces and Crossly stops tracking them), otherwise 409 listings_live with the counts. dryRun: true returns the counts only. |
POST /v1/listings/bulk-check-status |
bulkCheckStatus |
Re-checks each listing's status on its marketplaces. |
POST /v1/listings/bulk-delist-preview |
bulkDelistPreview |
Read-only: per marketplace, how many active listings a delist would touch and whether that account needs_reauth. Run it before a big delist. |
POST /v1/listings/tags/bulk |
crossly.listingTags.bulk |
{ listingIds (≤5000), add, remove, dryRun }. Max 30 tags a listing, 40 chars a tag. Returns matched, changed, capped. |
POST /v1/listings/by-ids |
byIds |
Fetch up to 200 hydrated listings (with platformListings) in one call. |
The listingIds cap is 50,000 on update, delist, delete, hard-delete, check-status and delist-preview. A listing you don't own is 404 not_found; one another app manages is 403 listing_managed_elsewhere.
Bulk update body
await crossly.listings.bulkUpdate({
listingIds,
updates: {
title: { action: 'insert_start', value: 'NWT ' }, // set | insert_start | insert_end | find_replace | remove
description: { action: 'find_replace', find: 'Addidas', replace: 'Adidas' },
price: { action: 'drop_percent', value: 10, rounding: 'down' }, // set | drop_percent | drop_amount | raise_percent | raise_amount
},
}, { idempotencyKey: crypto.randomUUID() }); // -> { success, updated, bulkJobId }
Prices are dollars. Marketplace rules still apply after the edit: Poshmark rounds to whole dollars (minimum $3) and Grailed refuses a price increase after a drop. There is no undo; apply the reverse edit.
Relist and crosspost guards
Both check the plan's monthly crosspost allowance first: listings that no longer fit are left out and named in refused, and none fitting is 402 plan_limit_reached. Each marketplace's preflight can also refuse the batch up-front: eBay 409 selling_cap_reached (hard cap) or 402 free_quota_exceeded (past the free listings; resend with confirmOverFreeQuota: true once the seller accepts the per-listing fee), the Crossly shop 409 shop_selling_limit_reached or 422 storefront_requirements_missing.
Bulk inventory
| Endpoint | Body | Returns |
|---|---|---|
POST /v1/inventory/bulk-quantity |
{ ids, mode: set|increase|decrease, value } or { mode: "set", items: [{ id, quantity }] } (1-5000), syncMarketplaces? |
{ affected, skipped, bulkJobId? }. Stock changes at once; live listings are pushed against bulkJobId, and 0 delists. |
POST /v1/inventory/bulk-labels |
{ ids, addLabels, removeLabels } (labels ≤100 chars) |
{ updated, bulkJobId }; neither list is 400 no_changes. |
POST /v1/inventory/bulk-archive |
{ ids } |
{ archived, bulkJobId } (soft). |
POST /v1/inventory/bulk-restore |
{ ids } |
{ restored, restoredIds }. |
POST /v1/inventory/bulk-delete |
{ ids, force?, deleteListings? } |
{ deleted, deletedIds, refused, bulkJobId }; linked items are 409 inventory_linked_to_listings until you resend with force: true. |
POST /v1/inventory/labels/rename |
{ from, to } |
{ updated } across every item. |
ids takes up to 50,000 UUIDs on labels, archive, restore and delete. Get them from GET /v1/inventory/ids with the same filters you would list with. Item fields and the quantity model: crossly-inventory.
Plan gate
On the Free plan, value-generating bulk work on two or more items is 403 forbidden: bulk create, update, crosspost, relist, labels and quantity. One item is just the normal action. Cleanup and safety verbs are open on every plan: delist, delete, hard-delete, archive, check-status and delist-preview. The gate reads the plan of the store in X-Storefront-Id (else the default store).
Product sets: a saved selection
A product set is a named selection of listings by filters (search, statuses, categories, brands, tags + tagsMatch, minPrice/maxPrice, listedOn/notListedOn, stock, minQuantity/maxQuantity, minAgeDays/maxAgeDays), explicit picks, or both. Members are evaluated when used, so new matching listings join automatically.
const set = await crossly.productSets.create({ // POST /v1/product-sets
name: 'Stale denim',
filters: { categories: ['Bottoms'], minAgeDays: 60, stock: 'in_stock' },
}, { idempotencyKey: crypto.randomUUID() }) as { id: string; memberCount: number };
await crossly.productSets.editMembers(set.id, { add: [], exclude: [pinnedId], remove: [] }); // POST /v1/product-sets/{id}/members
const run = await crossly.productSets.bulk(set.id, { action: 'relist', platforms: ['poshmark'] },
{ idempotencyKey: crypto.randomUUID() }) as { bulkJobId?: string; listingCount: number; refused?: unknown };
POST /v1/product-sets/{id}/bulk runs delist, relist or check-status on the current members (confirmOverFreeQuota as above). GET /v1/product-sets/{id}/members pages the members (limit ≤200). Deleting a set (DELETE /v1/product-sets/{id}) also drops it from channel exclusion lists. Sets can be excluded from quantity sync per account (excludedSetIds, see crossly-inventory).
Bulk list from photos (bulk batches)
/v1/bulk-batches (scope listings:read / listings:write) is the photo-capture flow behind the dashboard's bulk market listing: POST /v1/bulk-batches opens a batch, POST /v1/bulk-batches/{id}/items appends an item's photos, POST /v1/bulk-batches/{id}/identify matches items in the background (route: magic, market or auto), PATCH /v1/bulk-batches/items/{id} or POST /v1/bulk-batches/{id}/items/bulk corrects price (priceCents), quantity, cost or condition, and POST /v1/bulk-batches/{id}/publish creates drafts (default) or publishes live to destinations with live: true, merging duplicates into an existing matching listing. Poll GET /v1/bulk-batches/{id} for item status. SDK: crossly.bulkBatches.*.
Following a bulk job
There is no /v1 endpoint that returns a bulk job by its bulkJobId. Keep the id for support and the Activity Log (a bulk job is one event with per-item children: crossly-activity-log), and verify the outcome on the records themselves:
// After a bulk relist/delist/update: read the listings back in pages of 200.
for (let i = 0; i < listingIds.length; i += 200) {
const { items } = await crossly.listings.byIds(listingIds.slice(i, i + 200)) as {
items: { id: string; platformListings: { platform: string; status: string; errorMessage?: string | null }[] }[];
};
for (const l of items) for (const pl of l.platformListings)
if (pl.status === 'failed') console.warn(l.id, pl.platform, pl.errorMessage);
}
For ongoing sync, poll GET /v1/listings?updatedSince=<last seen> or use webhooks (crossly-webhooks) instead of re-reading everything. Give background work a few minutes on large selections; marketplaces are called at their own pace.
Batching and rate limits
- Writes per token per minute: Free 15, Starter 60, Pro 240, Unlimited 1,000 (reads 1,200). One bulk call is one write, however many ids it carries; 500 single PATCHes is 500.
- Send the whole selection in one queued call rather than splitting it, up to the cap. For
POST /v1/listings/bulk, send consecutive chunks of 50 and wait for each response. - On
429 rate_limited, waitRetry-Afterseconds and resend with the sameIdempotency-Key.
Rules
- Always send an
Idempotency-Key; for bulk create also give every item a stableclientReferenceId. - Preview before destroying:
bulk-delist-preview,bulk-hard-deletewithdryRun,bulk-deletewithoutforce. - A queued
200means accepted, not done. CheckplatformListingsbefore reporting success, per platform. - Never use bulk delist after a sale: the sale cascade already delists the other copies.
- On Free, expect
403 forbiddenfor multi-item value actions and fall back to single-item calls.
Docs: https://crossly.net/docs/bulk-edits · https://crossly.net/docs/managing-listings · https://crossly.net/docs/api-listings · https://crossly.net/docs/api-rate-limits
