Payouts, billing and Crossly Funding
These endpoints move or commit a seller's money. Most of them are owner-only by design: the scopes that pay out, upgrade a plan or borrow can only be held by the seller's own personal access tokens, never by a third-party OAuth app, and several return a URL a person must complete instead of acting on their own.
| Scope | Third-party apps | Allows |
|---|---|---|
accounts:read |
yes | Payout account status, payout wallet, identity status |
listings:read |
yes | Net-payout estimates (/v1/payout/estimate, /compare, /gross-for-net) |
inventory:read |
yes | Plan usage (/v1/billing/usage) and app allowances |
payouts:write |
never | Payout onboarding and identity links, pay out now, payout schedule |
billing:write |
never | Plan invoices and upgrade checkout (never downgrade or cancel) |
funding:read |
yes | Offer, line, draws, repayments, statements, controls, draw quotes |
funding:write |
never | Apply, draw, repay, auto-repay, spend controls, pay with funding, pool staking |
funding:approve |
never | Approve or reject held draws (never your own) |
GET /v1/billing/plans needs no scope. Every route here is per store: send X-Storefront-Id (SDK { storefrontId }) or it applies to the default store; a teammate's token also needs that store's billing permission. Auth: crossly-api-setup. Errors, idempotency and rate limits: crossly-api-conventions.
import { createClient } from '@crossly/sdk';
const crossly = createClient({ pat: process.env.CROSSLY_PAT! });
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
Payouts (Crossly-marketplace sales)
Payouts cover sales on Crossly's own marketplace, paid through the seller's Stripe Connect account. Other marketplaces pay sellers themselves.
| Route | SDK | Scope |
|---|---|---|
GET /v1/payout/connect |
payout.connectStatus() |
accounts:read |
POST /v1/payout/connect/onboard |
payout.connectOnboard({ country }) |
payouts:write |
GET /v1/payouts/identity |
payout.identity({ fresh }) |
accounts:read |
POST /v1/payouts/identity/link |
payout.identityLink({ country }) |
payouts:write |
GET /v1/payout/wallet |
payout.wallet() |
accounts:read |
POST /v1/payout/payouts |
payout.createPayout({ method, amountCents, destination, idempotencyKey }) |
payouts:write |
PUT /v1/payout/schedule |
payout.setSchedule({ interval, weeklyAnchor, monthlyAnchor }) |
payouts:write |
- Status:
connect.statusisnot_started(withdefaultCountry),pending,active,restrictedorpayouts_unavailable; onlyactivecan be paid.payoutsSupported: falsemeans Stripe offers no payout path to that country. Identitystatusisnot_started,pending,action_required(dueNowlists what to add),verifiedorrestricted(disabledReasonText). - Onboarding and identity return a Stripe-hosted
urlthat a person completes; the identity link expires in minutes, so ask for a new one instead of storing it.country(ISO alpha-2) is fixed once the account exists. Refusals:422 connect_country_unsupported,409 connect_country_mismatch. - Wallet:
balance.availableCents,pendingCents,instantAvailableCents(account currency),schedule,nextPayout,instant(available,feeCents,netCents,reason),methods,payouts,transactions.connected: falsebefore onboarding. - Pay out now:
method: 'instant'(fee, minutes, eligible card or bank, US dollars only) or'standard'(free, only on amanualschedule).amountCentsdefaults to everything eligible. Always passidempotencyKey(<= 200 chars) so a retry is the same payout.409when the account can't be paid or instant is unavailable. - Schedule:
intervalmanual,daily,weekly(weeklyAnchormonday..sunday) ormonthly(monthlyAnchor1-31).
const w = await crossly.payout.wallet() as { data: { connected: boolean; instant?: { available: boolean; feeCents?: number; netCents?: number } } };
if (w.data.instant?.available) {
// Show the seller feeCents / netCents and get an explicit yes before this call.
await crossly.payout.createPayout({ method: 'instant', idempotencyKey: crypto.randomUUID() });
}
Net-payout estimates (listings:read, no money moves): payout.estimate({ platform, priceCents }), payout.compare({ priceCents, platforms? }), payout.grossForNet({ platform, netCents }), each also taking weightOz, shippingCents, shippingPaidBy (buyer | seller). Answers carry grossCents, feeCents, feeSource (exact | estimated), shippingCents, shippingSource, netCents, takeHomePct and assumptions. Use these for pricing floors (see crossly-pricing-offers).
Billing and plans
| Route | SDK | Scope |
|---|---|---|
GET /v1/billing/plans |
account.billing.listPlans() |
none |
GET /v1/billing/usage |
account.billing.usage({ storefrontId }) |
inventory:read |
GET /v1/billing/app-allowances |
account.billing.listAppAllowances() |
inventory:read |
GET /v1/billing/invoices |
account.billing.listInvoices(filters) |
billing:write |
POST /v1/billing/upgrade |
account.billing.upgradePlan({ tier, interval, separate }) |
billing:write |
- Plans:
free,starter,pro,business,scale, each withmonthlyUsd,yearlyUsd(whole dollars),featuresandlimits(null = no cap). - Usage:
tier,status,interval,pooled(one plan covering several stores;usedis then the sum),currentPeriodEnd,cancelAtPeriodEndandlimits[](used of limit,upgradeTier,resetsAt; null for standing counts). - Invoices: filters
status(draft, open, paid, uncollectible, void),from/to(YYYY-MM-DD, UTC),min/max(cents),q,limit<= 100; paged bycursor= previousmeta.nextCursor(null on the last page). Amounts are cents incurrency. - Upgrade only.
tiermust be higher than the store's (starter,pro,business,scale),intervalmonthly(default) oryearly. It returnscheckoutUrl; nothing is charged until a person pays on Stripe Checkout. A store already on a plan answers409(change it in Settings → Billing); a store sharing a grandfathered plan passesseparate: trueto take its own. Downgrade, cancel and the billing portal are never available to a token, and a teammate's plan change is limited by their spending cap.
Handling plan limits
| Code | Status | Meaning | What to do |
|---|---|---|---|
plan_limit_reached |
402 | A plan limit refused a new use. Monthly quotas carry details { limitKey, limit, used, plan, resetsAt, upgradeTier, upgradeUrl } and Retry-After until resetsAt |
Don't retry before resetsAt; tell the seller, offer the upgrade |
overage_consent_required |
402 | Adding a marketplace account (POST /v1/accounts) would cost an overage |
Show the charge, then resend with acceptOverage: true only after the seller agrees |
billing_failed |
402 | The card for that charge declined; nothing happened | Ask the seller to fix billing |
Limits count calendar months in UTC: new inventory items, crossposts (per marketplace that goes live), AI enhancements, Magic List extra-photo reads, automation rules, bulk actions and accounts per marketplace. Tokens and connected apps share the seller's plan. See crossly-marketplace-connections for account slots.
Crossly Funding
Inventory financing sized from the seller's Crossly payouts. A draw is debt with interest, paid out as restricted funding CBX spendable only on approved uses. Owing stays in US dollars; all amounts are cents, APRs in basis points.
| Group | Routes (SDK) | Scope |
|---|---|---|
| Offer, line | GET /v1/funding/offer (funding.offer), GET /v1/funding/line (funding.line), GET /v1/funding/invoice-advance-eligibility (funding.invoiceAdvance) |
funding:read |
| Apply | POST /v1/funding/apply (funding.apply) |
funding:write |
| Supplier draws | POST /v1/funding/draws/quote (funding.quoteDraw(amountCents), funding:read), POST /v1/funding/invoice-files (funding.createInvoiceUpload), POST /v1/funding/draws (funding.draw), GET /v1/funding/draws, GET /v1/funding/draws/{id}, GET /v1/funding/draws/{id}/invoice |
write / read |
| Use draws | POST /v1/funding/draws/use (fundingControls.requestDraw) |
funding:write |
| Approvals | GET /v1/funding/approvals (funding:read), POST /v1/funding/draws/{id}/approve, POST /v1/funding/draws/{id}/reject (fundingControls.approve / reject) |
funding:approve |
| Repay | POST /v1/funding/repay (funding.repay), PUT /v1/funding/autorepay (funding.setAutorepay(pct)), GET /v1/funding/repayments, GET /v1/funding/statements?month=YYYY-MM |
write / read |
| Controls | GET/PUT /v1/funding/controls (fundingControls.get / update), PUT/DELETE /v1/funding/members/{memberUserId} |
read / write |
| Pay with funding | GET /v1/funding/spendable, GET /v1/funding/receipts (funding:read), POST /v1/funding/pay/shipping-labels, /pay/crossly-fees, /pay/vault-fees (fundingPay.*) |
funding:write |
| Pool | GET /v1/funding/pool, GET/POST /v1/funding/pool/stake, POST /v1/funding/pool/unstake, POST /v1/funding/pool/unstake/{id}/cancel, POST /v1/funding/pool/waitlist |
read / write |
The safe draw flow: quote, show the disclosure, get consent, then draw with the APR the seller saw.
// POST /v1/funding/draws/quote: nothing is drawn
const q = await crossly.funding.quoteDraw(50_000) as { data: {
amountCents: number; aprBps: number; termDays: number; estFeeCents: number;
totalRepayCents: number; dueAt: string; availableCents: number; lineStatus: string } };
// ...show q.data to the seller and get an explicit yes...
// POST /v1/funding/draws: a supplier draw
await crossly.funding.draw({
amountCents: 50_000,
supplierName: 'Acme Wholesale',
invoiceRef: 'INV-2291', // or invoiceUrl, or invoiceFileId from createInvoiceUpload
acceptedAprBps: q.data.aprBps, // refused with 409 if the rate changed since the quote
idempotencyKey: crypto.randomUUID(),
});
- Apply:
requestedCentsrequired, plus business details (legalName,entityType,yearsOperating, revenue),uses[],autorepayPct,attest,acceptedTermsVersion. Decided at once: approved (line = 25% of 90 days of settled Crossly payouts), declined with reasons, orneeds_review. - Use draws (
cents,useone ofads,wholesale_on_crossly,verified_wholesaler,shipping_labels,crossly_fees,vault_fees,acceptedAprBps,idempotencyKey): refused by the spend controls, held for approval (no debt until disbursed), or disbursed at once. - Invoice upload: PDF or image (
application/pdf,image/jpeg,image/png,image/webp,image/heic) <= 15 MB; PUT the bytes touploadUrlwith the same Content-Type and exactcontentLength, then draw withinvoiceFileId. One draw per file. - Repay:
amountCents,idempotencyKey,sourcebalance(default, from the payout balance, applied at once),card(a PaymentIntent client secret),checkout(a hostedcheckoutUrl) orcbx. Auto-repaypctis a whole percent 10-100 (default 20). - Approvals: the two-person rule needs two distinct approvers; the requester never approves their own draw.
- Pay with funding: shipping-label wallet top-up (
amountCents,idempotencyKey), an open plan invoice (invoiceId), or a Vault unit's shipping and fees (vaultItemId,speed). Refused when the controls forbid that use or it is over the approval threshold with no approved draw.
Webhooks
Subscribe instead of polling (see crossly-webhooks):
- Payouts:
payout.sent(amount in cents, expected arrival),payout.released(held order funds now available),payout.failed(with the processor's reason). - Funding:
funding.application_decided,funding.waitlist_promoted,funding.draw_requested,funding.draw_decided,funding.draw_disbursed,funding.draw_spent,funding.repayment_applied,funding.due_soon,funding.late,funding.line_frozen.
There is no plan or subscription event; read GET /v1/billing/usage when you need the current plan.
Rules
- Never move money without an explicit confirmation from the seller in the same session: payouts, draws, repayments, pay-with-funding,
acceptOverage. Show the fee, APR, total and due date first. - Always send an idempotency key on money calls (
idempotencyKeyin the body for payouts and funding, theIdempotency-Keyheader elsewhere) and reuse it on retries. - Don't request
payouts:write,billing:write,funding:writeorfunding:approvefrom an OAuth app; consent will refuse them. Ask the seller to act with their own token or in the dashboard. - Hand Stripe URLs (onboarding, identity, checkout) to a person to open; never automate them or store them.
- Treat
402 plan_limit_reachedas final untilresetsAt(or an upgrade); retrying burns rate limit and can tripretry_storm. - Amounts here are integer cents unless a field says USD (
monthlyUsd,yearlyUsd).
Docs: https://crossly.net/docs/payouts · https://crossly.net/docs/billing-and-plans · https://crossly.net/docs/crossly-funding
