360 Secure SkillHub
360 安全技能中心

Crossly Analytics profit

说明 Crossly 的 analytics、books、mileage、tax 与 listing experiments 接口,涵盖净利润计算、scope、查询参数、返回字段和健康指标,适合构建销售分析、利润报表、账簿导出和税务工具;不包含可直接运行的应用或税务结论。

分类:数据
crossly
热度 9.16
最近更新 2026-11-30 11:07:32

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add crossly/crossly-analytics-profit
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
name
crossly-analytics-profit
description
Report a Crossly seller's sales, net profit and taxes through the API. Analytics overview KPIs with deltas, performance, marketplaces, segments, inventory aging and sell-through (GET /v1/analytics/overview and siblings), the legacy summary/by-platform/timeseries tiles, how net profit is computed (fees with feeSource exact vs estimated, shipping, cost of goods from costBasisCents), the books P&L and transactions (GET /v1/books), expenses and 1099-K (books:write), mileage and Schedule C (tax:*), and listing A/B experiments (analytics:write). Use when building dashboards, profit reports, bookkeeping exports or tax tooling on Crossly.

Analytics, net profit and books on Crossly

Crossly computes profit the same way on every marketplace, so you can compare channels. Ask the aggregate endpoints for totals. Don't page /v1/sales and sum it yourself, because the aggregates already exclude pending, cancelled and refunded money correctly.

Auth: crossly-api-setup. Errors, rate limits and idempotency: crossly-api-conventions. Per-sale and per-order money: crossly-orders-sales.

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

Scope Endpoints
analytics:read GET /v1/analytics/*, GET /v1/insights/by-platform, and the books reads: GET /v1/books, /v1/books/transactions, /v1/books/expenses, /v1/books/1099k (these also accept tax:read)
analytics:write experiment writes: POST /v1/analytics/experiments, PATCH/DELETE /v1/analytics/experiments/{id}, POST .../{id}/stop, POST .../{id}/declare
books:write POST /v1/books/expenses, PATCH/DELETE /v1/books/expenses/{id}, PUT /v1/books/1099k, PUT /v1/books/tax-profile
tax:read GET /v1/books/tax-profile (EIN and address: not readable with analytics:read; books:write also reads it), GET /v1/mileage, GET /v1/mileage/summary, GET /v1/tax/schedule-c (these three also accept analytics:read), GET /v1/tax/sales-tax, GET /v1/tax/sales-tax/not-collected, GET /v1/tax/crossly-collects (these three also accept orders:read)
tax:write POST /v1/mileage, PATCH/DELETE /v1/mileage/{id}

How net profit is computed

net profit = sale price − marketplace fees − cost of goods − shipping you paid

  • Sale price: what the buyer paid for the item, including shipping they paid, excluding sales tax the marketplace remits. Refunds reduce it, and a cancelled sale contributes nothing.
  • Fees: the fee the marketplace actually charged when it reports one (feeSource: 'exact'), else Crossly's estimate from that marketplace's schedule (feeSource: 'estimated'). eBay estimates are later replaced by real charges. health.estimatedFeeSales counts the estimated ones.
  • Cost of goods: the inventory item's cost, captured on the sale when it sells. Set it with costBasisCents (integer cents per unit) on POST /v1/inventory / PATCH (see crossly-inventory). Purchase invoices give a landed cost when no cost is set. An item with no cost counts as $0, so profit looks too high. health.costMissingSoldUnits tells you how many sold units have no cost.
  • Shipping you paid: labels bought through Crossly, plus postage entered for labels bought elsewhere.
  • Details pending: a sale recorded before its price loaded is left out of every money figure (pendingDetailsCount, health.detailsPendingSales). It is never shown as $0.
  • Non-USD sales are summed unconverted and flagged in health.nonUsdSales.

Surface health (DataHealth) next to any profit number you show.

The analytics pages (cents, { data } envelope)

These take one shared query: range (7d, 30d, 90d, 1y, ytd, all, custom with from/to as YYYY-MM-DD), compare (prev, yoy, none, custom with cmpFrom/cmpTo), filters labels, platforms, category, brand, and tz (IANA name, default UTC; an invalid one is 400). A bad param is 400 validation_error with details.field.

Endpoint SDK Returns
GET /v1/analytics/overview analytics.overview(q) KPIs with deltas (net sales, net profit, units, ASP, margin, sell-through, median days to sell, active listings, take rate), zero-filled series, byPlatform, feesCents, top categories/brands/items, byStore (2+ stores, filter with stores), sellThrough, health, insights
GET /v1/analytics/performance analytics.performance(q) one row per listing: channels, views, favorites, offers, units, net sales/profit, margin, days to sell, healthScore 0-100. status, q, sort, dir, page, size (25/50/100), minDays
GET /v1/analytics/items/{listingId} analytics.item(id) one listing in depth: timeline, engagement, price history, comps, money waterfall, offers, messages, experiments. by=inventory treats the id as an inventory item
GET /v1/analytics/compare analytics.compare({ ids }) 2-4 listings side by side with observational tests
GET /v1/analytics/marketplaces analytics.marketplaces(q) every marketplace: net sales/profit, take rate, margin, shipping subsidy, sell-through, cancel/return rates, offer stats. vs (2-3 platforms) adds a head-to-head
GET /v1/analytics/marketplaces/{platform} analytics.marketplace(p, q) fee breakdown, days-to-sell and price-realization histograms, at-risk listings, heatmap
GET /v1/analytics/segments analytics.segments({ dim }) niches by dim: category, subcategory, brand, condition, size, source, department, priceBand, ageBand. Rows under minN are lowSample
GET /v1/analytics/segments/{dim}/{key} analytics.segment(dim, key, q) one niche; 404 for an unknown dim or a key with no data under the filters
GET /v1/analytics/inventory analytics.inventory({ maturity }) unsold stock: aging buckets with cost, listed and market value, the 20 listings most in need of attention, shelf value over time, cohort sell-through, listed vs sold velocity

Sell-through is a cohort rate: of the items first listed in a window (shifted back by maturity days, 30/60/90), the share that sold within it. Immature items are counted separately (immature), and rate is null when n is 0. It is not "sold / active".

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

const { data: ov } = await crossly.analytics.overview({ range: '30d', compare: 'prev', tz: 'America/New_York' });
const profit = ov.kpis.netProfit;            // { value (cents), n, delta: { state, pct, pp, prev, good } }
const { data: inv } = await crossly.analytics.inventory({ maturity: 60 });
curl -sS "https://crossly.net/api/v1/analytics/marketplaces?range=90d&sort=netProfit&dir=desc" \
  -H "Authorization: Bearer $CROSSLY_PAT"

GET /v1/analytics/programs/{program} reports one Hub program (wholesale, ads, rentals, drops, discounts, funding, referrals…) over from/to (max 366 days), in cents.

Legacy tiles (dollars plus …Cents twins)

GET /v1/analytics/summary, /by-platform, /timeseries take days (calendar days back, today included, clamped to 365) and tz. They now run on the overview: summary returns sales, revenue and fees in dollars, plus netSalesCents, feesCents, netProfitCents, unitsSold and pendingDetailsCount. SDK analytics.summary({ days }), byPlatform, timeseries. GET /v1/analytics/dashboard is a deprecated composite kept in dollars. GET /v1/analytics/items (per-sale P&L), GET /v1/analytics/bookkeeping (monthly P&L for a year) and GET /v1/analytics/today remain. Prefer the overview family for new code.

Books: P&L, transactions, expenses, 1099-K

All amounts are integer cents. year 2020-2099 (default this year), period fy, ytd, q1-q4, m01-m12. Boundaries follow the tax profile's time zone unless you pass tz.

  • GET /v1/books (books.get({ year, period })): P&L on Schedule C lines: income, COGS, gross profit, expenses (marketplace fees, postage, mileage, your categories), net profit, monthly and per-marketplace tables with 1099-K expectations, estimated tax.
  • GET /v1/books/transactions (books.transactions): the sale rows behind any line: gross, refunded, fee and fee source, shipping, COGS, tax collected and net. status completed, cancelled, refunded, pending, all, and size max 100.
  • Expenses (books.expenses.list/create/update/delete): date (YYYY-MM-DD), amountCents (0-100,000,000), category, vendor (200), description (2000), receiptUrl (http/https), recurring monthly/yearly with optional recurringUntil. Categories: advertising, fees_commissions, contract_labor, insurance, interest_other, legal_professional, office, rent_storage, repairs, supplies, taxes_licenses, travel, meals, utilities, software_subscriptions, shipping_supplies, postage, other. car_truck is refused; it comes from mileage.
  • 1099-K (books.form1099k.get({ year }) / .put): record what a marketplace reported (year, platform, grossReportedCents, transactionsReported, notes). The answer reconciles it against Crossly's computed gross.
  • Tax profile (books.taxProfile.get/put): timezone, filingStatus, state, setAsideRateBps / federalRateBps / stateRateBps (basis points, 2500 = 25%), accountingMethod cash/accrual, businessName, ein, address. Fields you leave out are unchanged.
await crossly.books.expenses.create({
  date: '2026-11-02', amountCents: 4599, category: 'shipping_supplies', vendor: 'Uline',
}, { idempotencyKey: crypto.randomUUID() });
const { data: pl } = await crossly.books.get({ year: 2026, period: 'q4' });

Mileage and Schedule C

  • POST /v1/mileage (tax.createMileage): date (YYYY-MM-DD), miles (> 0, max 10,000), purpose (1-200), optional startLocation, endLocation (200), notes (2000). No dollar amount: the deduction is computed at read time. PATCH /v1/mileage/{id} (empty body: 400 no_changes) and DELETE /v1/mileage/{id} (permanent) are also available.
  • GET /v1/mileage (tax.mileage): newest trip first, year and/or inclusive from/to, limit default 100, clamped to 500.
  • GET /v1/mileage/summary (tax.mileageSummary({ year })): totalMiles, deduction (dollars) and deductionCents, with each trip priced at the IRS rate on its own date (rates[]; ratePerMile is the January rate).
  • GET /v1/tax/schedule-c?year= (tax.scheduleC({ year }), default the current year): line 1 gross receipts before refunds, line 2 refunds, Part III COGS, completed sales only, from the same P&L as /v1/books. It assumes a sole proprietor, so treat it as a worksheet.
  • Sales tax on Crossly-store sales: GET /v1/tax/crossly-collects, GET /v1/tax/sales-tax, GET /v1/tax/sales-tax/not-collected (tax.crosslyCollects, salesTax, salesTaxNotCollected). These are disclosures, not tax calculations.

Listing A/B experiments

analytics.experiments.{list,get,create,update,delete,stop,declare}. Reading needs analytics:read; every write needs analytics:write.

  • kind: 'split': 2-4 distinct live platform listings (arms[].platformListingId) observed over the same window.
  • kind: 'sequential': exactly one platform listing, before vs after changeAt. Only a sequential field: 'price' test may carry applyPrice: { newPriceCents }, and that changes the live price.
  • field: title, price, photos, description, shipping, category, marketplace, other. primaryMetric: favorite_rate, view_to_offer_rate, views_per_day, favorites_per_day, offers_per_day, sale. plannedDays 7-60 (default 14), name max 120.
  • stop ends counting; declare with { conclusion: 'winner' | 'no_difference' | 'inconclusive', winnerArmId } concludes it. Deleting an experiment leaves the listings untouched.

Rules

  • Use the overview family (cents) for new work, and parse the legacy tiles' dollar fields into cents before doing arithmetic.
  • Always show health beside profit: missing costs, estimated fees and pending details change what the number means.
  • Set costBasisCents on inventory before items sell. Cost is captured at sale time, and editing it later doesn't change past sales.
  • Pass the seller's tz so day and month boundaries match their books.
  • Don't read the tax profile, EIN or address with an analytics:read token. Ask for tax:read.
  • Mileage and expense deletions are permanent tax records, so confirm before deleting.

Docs: https://crossly.net/docs/api-analytics · https://crossly.net/docs/net-profit-and-cogs · https://crossly.net/docs/dashboard-analytics · https://crossly.net/docs/mileage-tracking · https://crossly.net/docs/schedule-c-tax