360 Secure SkillHub
360 安全技能中心

Crossly Payouts billing

该 Skill 说明 Crossly 卖家收款、账单套餐和 Crossly Funding 的 API/SDK 用法,覆盖 Stripe Connect 状态、钱包提现、套餐限额与升级、融资申请/支取/还款及权限范围,并强调金额确认、幂等键和敏感写权限限制。

分类:开发
crossly
热度 13.16
最近更新 2026-11-30 11:12:28

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add crossly/crossly-payouts-billing
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
name
crossly-payouts-billing
description
Read and act on a Crossly seller's money through the API, safely. Payouts (Stripe Connect status, GET /v1/payout/wallet balances, POST /v1/payout/payouts instant or standard, PUT /v1/payout/schedule, identity verification links, net-payout estimates per platform), billing and plans (GET /v1/billing/plans, /usage, /invoices, POST /v1/billing/upgrade checkout URL; 402 plan_limit_reached and overage_consent_required), and Crossly Funding (offer, apply, draw quotes and draws, repay, auto-repay, spend controls, approvals, pay labels and fees with restricted funding CBX). Covers the payouts:write, billing:write, funding:read/write/approve scopes and which ones third-party apps can never hold. Use when building seller finance dashboards, payout automation, plan-limit handling or Crossly Funding tooling.

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

  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

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.status is not_started (with defaultCountry), pending, active, restricted or payouts_unavailable; only active can be paid. payoutsSupported: false means Stripe offers no payout path to that country. Identity status is not_started, pending, action_required (dueNow lists what to add), verified or restricted (disabledReasonText).
  • Onboarding and identity return a Stripe-hosted url that 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: false before onboarding.
  • Pay out now: method: 'instant' (fee, minutes, eligible card or bank, US dollars only) or 'standard' (free, only on a manual schedule). amountCents defaults to everything eligible. Always pass idempotencyKey (<= 200 chars) so a retry is the same payout. 409 when the account can't be paid or instant is unavailable.
  • Schedule: interval manual, daily, weekly (weeklyAnchor monday..sunday) or monthly (monthlyAnchor 1-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 with monthlyUsd, yearlyUsd (whole dollars), features and limits (null = no cap).
  • Usage: tier, status, interval, pooled (one plan covering several stores; used is then the sum), currentPeriodEnd, cancelAtPeriodEnd and limits[] (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 by cursor = previous meta.nextCursor (null on the last page). Amounts are cents in currency.
  • Upgrade only. tier must be higher than the store's (starter, pro, business, scale), interval monthly (default) or yearly. It returns checkoutUrl; nothing is charged until a person pays on Stripe Checkout. A store already on a plan answers 409 (change it in Settings → Billing); a store sharing a grandfathered plan passes separate: true to 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: requestedCents required, 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, or needs_review.
  • Use draws (cents, use one of ads, 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 to uploadUrl with the same Content-Type and exact contentLength, then draw with invoiceFileId. One draw per file.
  • Repay: amountCents, idempotencyKey, source balance (default, from the payout balance, applied at once), card (a PaymentIntent client secret), checkout (a hosted checkoutUrl) or cbx. Auto-repay pct is 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 (idempotencyKey in the body for payouts and funding, the Idempotency-Key header elsewhere) and reuse it on retries.
  • Don't request payouts:write, billing:write, funding:write or funding:approve from 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_reached as final until resetsAt (or an upgrade); retrying burns rate limit and can trip retry_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