GET /v2/merchant/x402-earnings returns the authenticated merchant’s rollup of
x402 settlement events: per-row settlement detail, totals envelope (settlement
amount + count), and pagination. This endpoint is the data source for the
merchant x402 Earnings page in the dashboard.
This endpoint requires:
- Merchant JWT — any authenticated merchant role (
OWNER,MEMBER,PRODUCER)
sub claim. There is no
merchantId query parameter. If a client passes one anyway it is silently
ignored — the response is always scoped to the JWT-bound merchant.GET /v2/merchant/x402-earnings
Authentication
Obtain a merchant JWT via
POST /merchant/admin/login — see
Authentication.
Query parameters
Example
Response — 200 OK
Fields
Errors
Notes
X402_ENABLEDgating. Until the platform flagX402_ENABLEDis set totrue,X402SettlementLogaccepts no writes and this endpoint always returnsrows: [],totalSettlementsUsdCents: 0,totalCount: 0. The endpoint itself is always reachable — the gate is at the write path, not the read path. Merchants safely linkable to the page before the flip; it renders an empty-state.- Auth scope. The endpoint reads
merchantIdfrom the JWTsubclaim only. Any?merchantId=is silently ignored. A merchant cannot read another merchant’s settlements through this endpoint — even with a syntactically valid query parameter pointing at the target. - Fail-open semantics. If the underlying
X402SettlementLogaggregation throws, the endpoint returns the empty-state envelope (rows: [], totals0) with200 OKrather than propagating the error. Inspect server logs / Sentry for the underlying failure. - Currency. All monetary fields are USD cents, integer — same contract
as the admin x402-earnings rollup.
Divide by
100for major-unit display. - Pagination.
totalandtotalCountcount settlement rows, not products / orders. A merchant with 50 settlements across 3 products reportstotal: 50,totalCount: 50. - Date filter semantics.
startDateandendDateare inclusive bounds onsettledAt. Omit either to leave that side of the window unbounded; omit both for the full per-merchant history (capped at the merchant’s earliest settlement).
Related
- Billing Invoices (Merchant) — companion merchant-facing billing history (trailing 365 days, paid subscription invoices).
- x402 Earnings (Admin) — admin-side per-merchant x402 settlement rollup (network-wide view).
- Platform Fee Summary (Admin) — network-wide MRR / ARR / 30d / 365d rollup that includes x402 in
revenue30dUsdCents/revenue365dUsdCents.