Back to docs

Ad ledger and payouts

Approfit writes ad requests and billable ad events to an internal ledger. Each event stores gross revenue, developer revenue, and Approfit revenue using the 85/15 split.

Attribution

Requests and events carry game, developer, placement, slot, device, campaign, creative, session, visitor, optional user, and hashed network/user-agent fields. The admin ledger is at /dashboard/admin/ads.

Fraud controls

Duplicate beacons for the same request and event type are not billable. The original event is marked withduplicate_request_event. Admin reporting also surfaces abnormal CTR and completion-rate signals.

Payout periods

Payout periods are generated by an internal CLI job. It snapshots eligible ad events into payout line items, applies the minimum payout threshold, and locks the generated period so later events do not change paid numbers.

pnpm payouts:generate
pnpm payouts:generate -- --interval=weekly
pnpm payouts:generate -- --start=2026-06-01 --end=2026-07-01

Workflow boundary

Admin payout approval, marking paid, Stripe Connect onboarding, and manual payout references are modeled in the schema but should not become public mutation routes until auth and admin RBAC exist.

Full source doc: docs/ad-ledger-payouts.md