360 Secure SkillHub
360 安全技能中心

Crossly Orders sales

该 Skill 说明如何通过 Crossly API 与 SDK 读取订单和销售数据,按状态、平台、渠道等筛选,并执行提交运单、批量标记发货、退款/取消及 CSV 导出等操作;同时强调权限范围、幂等与个人数据处理。

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

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add crossly/crossly-orders-sales
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
name
crossly-orders-sales
description
Read and act on Crossly orders and sales across every marketplace. List and page GET /v1/orders (status, platform, channel, orderNumber, assignee, updatedSince filters) and GET /v1/sales, read line items, buyer address and money fields, order sub-resources (shipments, refunds, cancel eligibility, evidence), submit tracking or bulk mark shipped, and react to order.created / sale.detected webhooks instead of polling. Explains the orders:read, sales:read, fulfillment:write, orders:write and orders:refund scopes. Use for fulfilment, shipping, bookkeeping, revenue reports or dropshipping integrations on Crossly.

Read Crossly orders and sales

Every detected sale creates two sibling records in one transaction:

  • an order (/v1/orders): the fulfilment view. Buyer, address, line items, tracking, status. You act on it.
  • a sale (/v1/sales): the accounting view. Sale price, platform fee, cost of goods, net profit, how it was detected. Read-only (apart from soft-delete).

Scopes:

Scope Allows
orders:read List and read orders and their sub-resources (below)
sales:read GET /v1/sales
fulfillment:write Submit tracking, bulk mark shipped, and PATCH /v1/orders/{id} limited to trackingNumber, carrier and status shipped / in_transit / delivered. The narrow scope for 3PL and dropship apps
orders:write Everything fulfillment:write does, plus labels, cancel, returns, disputes, notes, messages, bulk delete
orders:refund POST /v1/orders/{id}/refunds; also required (with orders:write) to cancel a Crossly-marketplace order
sales:write POST /v1/sales/bulk-delete (soft-delete)

orders:write does not let you call /refunds. Auth: crossly-api-setup. Pagination, errors and idempotency: 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

Orders

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

// GET /v1/orders?status=needs_fulfillment&limit=100
const { data } = await crossly.orders.list({ status: 'needs_fulfillment', limit: 100 }) as {
  data: Array<{ id: string; platform: string; platformOrderId: string | null; orderNumber: string | null;
                sku: string | null; quantity: number; shipByAt: string | null }>;
};
const order = await crossly.orders.get(data[0].id);       // GET /v1/orders/{id}

Query parameters on GET /v1/orders (newest first by createdAt, soft-deleted orders hidden):

Param Values
page, limit limit 1-100, default 25
status An exact status (below)
platform A platform id (ebay, poshmark, crossly, …)
channel retail, wholesale, auction, live, world, pos, rental
details=pending Only orders whose sale price and buyer haven't loaded yet
unlinked 1/true: only sales with no listing behind them
orderNumber A Crossly order number (NNN-NNNNNNN-NNNNNNN, dashes or # optional) or an exact marketplace order id (<= 200 chars)
assignee me, none, any or a team member id (anything else is a 400)
updatedSince ISO 8601: orders created or changed since then. Poll with the time of your last call to catch new orders and status or tracking changes

Statuses: needs_fulfillment → label_purchased → shipped → in_transit → delivered → completed, with disputed, refunded and cancelled off the main path (the dashboard also shows late_shipment and layaway). A layaway order is not to be shipped until it moves to needs_fulfillment. Statuses never move backwards on a late tracking update. GET /v1/orders/counts gives per-status badge counts.

What an order carries:

  • Money in dollars as JSON numbers: salePrice, platformFee, taxCollected, shippingCharged, plus feeSource (exact = what the marketplace charged, or estimated). appShare is what a connected OAuth app took from the sale (null = none). labelCost is the primary parcel only; use totalLabelCostCents from /shipments.
  • sku, quantity, and lineItems[]: { lineKey, listingId, inventoryItemId, platformListingId, sku, variantId, quantity, unitPrice, total } (dollars). A multi-item marketplace order is several Crossly orders sharing platformOrderId, each with its own lineKey.
  • orderNumber: the readable number of a Crossly sale (null elsewhere). Show orderNumber ?? platformOrderId.
  • buyerUsername, buyerEmail, and buyerAddress ({ name, line1, line2?, city, state, zip, country, phone? }). On session-based marketplaces (Poshmark, Mercari, Depop, Vinted…) the address arrives minutes after the sale. Don't ship until it is present.
  • detailsPending: true: the sale was recorded before its price and buyer loaded; money is null and lineItems is [] until then.
  • Shipping: carrier, service, trackingNumber, shippingLabelUrl, shippedAt, deliveredAt, carrierStatus, trackingHistory, carrierTracking (who reports progress), shipByAt (the marketplace's deadline, null when unknown) and handlingTimeDays.
  • Trade: channel, purchaseOrderRef, trade (the on-account invoice behind a wholesale order: invoiceStatus, dueAt, totalCents, balanceCents, …) and buyerCompany ({ id, name } or null).
  • Closing facts: refundAmount, refundedAt, cancelledAt, cancellationReason, isDisputed, disputeReason.

Sub-resources of one order (all orders:read)

Route SDK What
GET /v1/orders/{id}/shipments orders.shipments Every parcel, with totalLabelCostCents
GET /v1/orders/{id}/suggested-parcel orders.suggestedParcel The box and weight to rate with
GET /v1/orders/{id}/refunds orders.listRefunds Refund history (dollars)
GET /v1/orders/{id}/refund-options orders.refundOptions What a refund may be on this platform
GET /v1/orders/{id}/cancel-eligibility orders.cancelEligibility Whether it can be cancelled, and the reason codes
GET /v1/orders/{id}/packing-slip orders.packingSlip Packing slip PDF
GET /v1/orders/{id}/proof-of-delivery orders.proofOfDelivery Carrier scan evidence (PDF or JSON)
GET /v1/orders/{id}/delivery-photo — The courier's doorstep photo, if any
GET /v1/orders/{id}/evidence — Packing capture, seal check, arrival condition, units
GET /v1/orders/{id}/units — The serial-identified units that shipped
GET /v1/orders/{id}/order-chat orders.orderChat.list The buyer chat thread on the marketplace
GET /v1/orders/{id}/sales-tax — Who collected sales tax (also needs tax:read)

Sales

// GET /v1/sales?page=1&limit=100, newest first by detectedAt
let page = 1;
const sales: Array<{ id: string; platform: string; salePrice: string | null; platformFee: string | null; netProfit: string | null }> = [];
for (;;) {
  const res = await crossly.sales.list({ page, limit: 100 }) as { data: typeof sales };
  sales.push(...res.data);
  if (res.data.length < 100) break;        // /v1/sales omits pagination.total
  page += 1;
}

GET /v1/sales takes only page and limit (1-100, default 25). A sale has salePrice, platformFee, shippingCost, shippingCharged, taxCollected, costOfGoods, netProfit and refundedAmount (decimal strings, dollars), currency, feeSource, platform, platformOrderId, orderId, listingId, inventoryItemId, variantSku, detailsPending, cancelledAt, appShare, detectedBy (webhook, extension_poll, email_fallback, health_sweep, manual, …) and detectedAt. There is no endpoint for a single sale; use the linked order or page the list. For totals use the analytics endpoints (crossly.analytics.summary(), see crossly-analytics-profit) instead of summing pages.

Pages shift while new sales arrive. On a busy account, sync orders with updatedSince rather than walking /v1/sales page by page.

Prefer webhooks to polling

Subscribe to order.created, order.address_available, sale.detected, order.shipped, order.delivered, order.cancelled, order.refunded, order.disputed, order.ship_by_soon and order.ship_by_overdue (see the crossly-webhooks skill). order.created fires at once with addressPending: true when the address isn't known yet; order.address_available follows with it. Polling /v1/sales every 30 seconds spends 120 requests an hour for nothing.

Fulfil

// POST /v1/orders/{id}/tracking  (fulfillment:write or orders:write)
await crossly.orders.submitTracking(order.id,
  { trackingNumber: '9405511899561234567890', carrier: 'usps' },   // both required; labelCost (dollars) optional
  { idempotencyKey: crypto.randomUUID() });

// POST /v1/orders/bulk-mark-shipped  (fulfillment:write or orders:write)
const { updated, skipped } = await crossly.orders.bulkMarkShipped(
  { orderIds: ['…', '…'] },          // 1-500 ids; optional trackingNumber (<= 100) and carrier (<= 40) apply to ALL of them
  { idempotencyKey: crypto.randomUUID() }) as { updated: number; skipped: number };

/tracking marks the order shipped (order.shipped fires once), records the parcel, and pushes the tracking to the originating marketplace asynchronously (jobId). Bulk mark shipped skips cancelled and refunded orders (skipped) and tells each marketplace order once. If the label was bought through Crossly, tracking is submitted automatically; don't submit it again. Rates, labels, marketplace prepaid labels, tracking correction, pickups and printing: see crossly-shipping-labels.

Other actions: PATCH /v1/orders/{id} (notes <= 2000, trackingNumber, carrier, status, labelCost), POST /v1/orders/{id}/message (message the buyer on the marketplace; 409 buyer_username_pending until the username arrives), POST /v1/orders/{id}/link-listing (attach an unmatched sale to a listing), POST /v1/orders/import (re-pull order history for days on platforms), POST /v1/orders/bulk-export (CSV, orders:read), POST /v1/orders/bulk-delete (Crossly's copy only; never cancels on the marketplace).

Refunds (POST /v1/orders/{id}/refunds, scope orders:refund; the older POST /v1/orders/{id}/refund is deprecated), cancellation (GET /v1/orders/{id}/cancel-eligibility then POST /v1/orders/{id}/cancel), returns and disputes: see crossly-returns-refunds.

Rules

  • Money: order amounts are dollars as JSON numbers, sale amounts are dollars as decimal strings; …Cents fields are integer cents. Parse into integer cents before you add things up.
  • Dedupe on Crossly's id (or platform + platformOrderId + lineKey), never on buyer name or amount.
  • Treat buyer names, emails, phones and addresses as personal data: don't log them, and keep them only as long as fulfilment needs.
  • Send an Idempotency-Key on tracking, refund, cancel and bulk calls. A refund retried with a different key can double-refund.
  • Ask for the narrowest scope: fulfillment:write for shipping apps, orders:refund only if you really refund.

Docs: https://crossly.net/docs/api-orders · https://crossly.net/docs/api-sales · https://crossly.net/docs/orders-and-shipping