Skip to content

Royalties period close ​

Who: system (scheduler); staff (payouts:approve) for manual close and adjustments; creator reads statements.

Entry points ​

KindEntry
Jobsroyalties.ensure-periods (creates monthly periods), royalties.close-due (3rd of the month, UTC), royalties.close (one period)
StaffGET /staff/royalties/periods, GET /staff/royalties/periods/:id, POST /staff/royalties/periods/:id/close, POST /staff/royalties/adjustments
CreatorGET /profiles/:profileId/royalties/statements, GET /royalties/statements/:id, GET /royalties/statements/:id/lines
Deep linkstudioStatement, studioEarnings
Push/emailroyalty.statement_ready

Flow ​

  1. royalties.close-due picks ended, unposted periods (or staff POST …/close → 202, job queued). Status open → closing.
  2. Lock qualified streams of the month from paid subscribers only (trial plays never pay); drop streams flagged by playback.fraud-scan and holds from safety (safety.royalties.withheld).
  3. For each subscriber: net revenue × payout ratio (default 70%) split across only what they played; a DJ set's share by time played per track.
  4. Each item's amount follows its split sheet as it stood at period end (snapshot). Items without splits are held (heldNoSplits).
  5. Adjustments (manual, clawback, carry forward) from earlier periods apply. → computed.
  6. Post in one ledger transaction: platform_revenue → royalty_pool, then royalty_pool → creator_earnings per statement. → posted. Events royalties.period.posted, royalties.statement.ready; notification royalty.statement_ready to each payee owner.
  7. A failure marks the period failed with failureReason; the job retries.

Exit states ​

StateCodeActionsClient next
Posted——Creator opens the statement, then withdraws
Not ended yetROYALTY_PERIOD_NOT_ENDED—Wait until after month end
Wrong stateROYALTY_PERIOD_INVALID_TRANSITION—Already closing or posted
UnknownROYALTY_PERIOD_NOT_FOUND, ROYALTY_STATEMENT_NOT_FOUND——
Zero or carriedstatement `outcome: zerocarried_forward`—

Notifications ​

royalty.statement_ready.

Known gaps ​

  • Studio analytics has no per-profile revenue reader from royalties, so revenue widgets are empty (I14).

Plemuz API v2