What counts as an event
An event is one completed end-to-end send. A Peer buyer paid the handle, the payment was verified, and the buyer’s USDC was released. Nothing earlier in the pipeline is an event:- Never events: fee claims, bridges, listed or open orders, and fills that are still pending or were pruned.
- Several per payout: one payout can be filled by several buyers, so it can hold several events, one per buyer.
- Real cash:
amountUsdis the exact cash the recipient received, not a price estimate.usdcAmountis the raw USDC the buyer received for it, anddiscountBpsis the order’s discount below market.
Feed events also carry
token: { name, symbol, image }, read from the token’s Bags launch. Each field can be null.
Which endpoint to use
Prerequisites
- An API key from the Bags Developer Portal, sent as the
x-api-keyheader. - Node.js 18 or later for the TypeScript examples (they use the built-in
fetch). See the TypeScript and Node.js Setup Guide.
Filter by payout method
Both endpoints return only X Money payments by default (method=xmoney). Pass method=cashapp or method=venmo for one of the other methods, or method=all for every method.
cashoutMethod on each event tells you which method it was paid through, which matters with method=all.
The payment feed
Newest first, paged with before
With the default sort=time, the feed is ordered newest first. To read older events, pass the last event’s timestamp as before; you get only events older than it.
before is in whole seconds and excludes that second, so if two payments share the exact second at a page boundary, the second one is not on the next page. That is rare for payouts. For a gap-free walk of the whole history, page with sort=amount and cursor, which is exact, or read one token’s history in time mode.Largest first, paged with cursor
With sort=amount, events are ordered by cash paid, largest first. Page by passing the response’s nextCursor back as cursor. nextCursor is null on the last page.
Amount bounds and first payments
minAmountCentsandmaxAmountCentsbound the cash paid, in USD cents, both inclusive.minAmountCents=10000keeps payments of $100 or more. Sending a minimum above the maximum is a400.onlyFirstPayments=truekeeps only each handle’s first payment per token, which is the moment a token’s payout first reached its recipient. It works with both sorts and with the amount bounds: the first payments are picked first, then filtered and sorted.
TypeScript: read the whole feed
read-payout-feed.ts
TypeScript: a live payments bot
For a ticker or a bot that posts each payment once, poll the first page of the feed and remember whichpaymentIds you have already handled. This reuses getJson and the types from read-payout-feed.ts above.
payout-bot.ts
seen (for example in a file or database) if the bot restarts, and keep only recent ids so it does not grow forever.
One token’s events
Offset mode: newest first
The default mode pages withlimit (1 to 100, default 100) and offset (default 0), newest first. hasMore is true when more events exist past the page.
Time mode: a chart range
Withmode=time, pass from and to in unix seconds. Both are inclusive and required, and from must not be after to. Events come back oldest first, which is the order a chart expects, up to 1000 events per request. hasMore is true when the range holds more than 1000.
Each mode only accepts its own parameters.
limit or offset with mode=time, or from or to in offset mode, is a 400.TypeScript: payment markers on a price chart
This example draws one marker per candle that had payments on a TradingView Lightweight Charts candlestick chart (v5). It reads the chart’s range in time mode, followshasMore past the 1000-event cap, and highlights candles with a first payment. It reuses getJson and PayoutEvent from read-payout-feed.ts above.
payout-markers.ts
timestamp down to the candle interval puts the marker on the candle the payment happened in. To refresh a live chart, request time mode again from the last candle’s start and replace the markers. Pass "all" as the method argument of getTokenEventsInRange if the chart should show Cash App and Venmo payments too.
First payments
isFirstPayment is true on the first payment to a handle, with the same method, from a token. If a token’s handle is changed, the first payment to the new handle is a first payment too. Use it to:
- Celebrate a token’s first payout in a bot or ticker, or filter the feed to them with
onlyFirstPayments=true. - Highlight the first payment on a token’s chart, as the marker example above does.
Errors
Errors use the usual shape,{ "success": false, "response": "<message>" }.
