Crossly Analytics profit
Latest: v1.0.0
Initial release
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
- 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
| 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.estimatedFeeSalescounts 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) onPOST /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.costMissingSoldUnitstells 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.statuscompleted,cancelled,refunded,pending,all, andsizemax 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),recurringmonthly/yearlywith optionalrecurringUntil. 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_truckis 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%),accountingMethodcash/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), optionalstartLocation,endLocation(200),notes(2000). No dollar amount: the deduction is computed at read time.PATCH /v1/mileage/{id}(empty body: 400no_changes) andDELETE /v1/mileage/{id}(permanent) are also available.GET /v1/mileage(tax.mileage): newest trip first,yearand/or inclusivefrom/to,limitdefault 100, clamped to 500.GET /v1/mileage/summary(tax.mileageSummary({ year })):totalMiles,deduction(dollars) anddeductionCents, with each trip priced at the IRS rate on its own date (rates[];ratePerMileis 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 afterchangeAt. Only a sequentialfield: 'price'test may carryapplyPrice: { 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.plannedDays7-60 (default 14),namemax 120.stopends counting;declarewith{ 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
healthbeside profit: missing costs, estimated fees and pending details change what the number means. - Set
costBasisCentson inventory before items sell. Cost is captured at sale time, and editing it later doesn't change past sales. - Pass the seller's
tzso day and month boundaries match their books. - Don't read the tax profile, EIN or address with an
analytics:readtoken. Ask fortax: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
