{"lexicon":1,"id":"money.atmosphere.app.auditFeeDistributions","defs":{"distribution":{"type":"object","required":["id","paymentId","role","amount","currency","status","clawbackAmount","createdAt"],"properties":{"id":{"type":"string","maxLength":128,"description":"Distribution row id."},"paymentId":{"type":"string","maxLength":128,"description":"The originating payment id (the app-visible payment id)."},"chargeId":{"type":"string","maxLength":256,"description":"Processor charge/invoice id this distribution settled against. For subscription renewals this is the per-cycle invoice id, so one subscription produces one distribution per cycle."},"role":{"type":"string","maxLength":32,"description":"For this endpoint, distribution role 'app' identifies the calling app as the payee of ATM's contractual revenue-share obligation. The underlying application fee remains ATM's own fee."},"amount":{"type":"integer","description":"Gross amount of ATM's contractual revenue-share obligation to the app for this distribution, calculated from ATM's own application-fee base (or an equivalent platform-fee amount computed from gross proceeds on an enabled route without a separate application fee), before any clawback, in the smallest currency unit."},"currency":{"type":"string","minLength":3,"maxLength":3,"description":"Lowercase ISO 4217 alphabetic code. Chargeability is enforced separately by the configured processor allowlist. Asset-denominated value uses the money.atmosphere.payment.defs value union, never this field. Never sum amounts across differing currencies."},"status":{"type":"string","knownValues":["queued","scheduled","transferred","held","reversed","failed"],"maxLength":16,"description":"Synthesized payout status. queued = awaiting transfer; scheduled = deferred under a payout schedule until heldUntil; held = transfer paused due to a problem (see heldReason); transferred = paid out; reversed = fully reversed; failed = transfer failed."},"heldReason":{"type":"string","maxLength":512,"description":"Operator-authored reason a queued transfer is held (only set when status = held)."},"heldUntil":{"type":"string","format":"datetime","description":"Scheduled payout time. Set only when status = scheduled (ATM's revenue-share distribution to the app is deferred under a payout schedule); the transfer runs on or after this time."},"processorTransferId":{"type":"string","maxLength":256,"description":"Rail-agnostic processor transfer id for the payout movement (e.g. a Stripe transfer id). Never the recipient connected-account id."},"clawbackStatus":{"type":"string","knownValues":["pending","reversed","failed","waived"],"maxLength":16,"description":"Partial-refund clawback state of an already-transferred revenue-share payment from ATM to the app. Absent when no clawback applies. Net revenue share = amount - clawbackAmount when the clawback is reversed."},"clawbackAmount":{"type":"integer","description":"Amount of ATM's revenue-share payment to the app clawed back by a partial refund, in the smallest currency unit. 0 when none."},"processorReversalId":{"type":"string","maxLength":256,"description":"Rail-agnostic processor reversal id for the clawback/reversal movement."},"period":{"type":"string","maxLength":16,"description":"Optional operator grouping period."},"createdAt":{"type":"string","format":"datetime"}}},"main":{"type":"query","description":"Audit ATM's contractual revenue-share distributions payable to the calling app and calculated from ATM's own application-fee base (or an equivalent platform-fee amount supplied by ATM from gross proceeds on an enabled route without a separate application fee). Requires a service-auth JWT signed by the app DID; returns ONLY rows for payments the app originated and for which the app is the payee of ATM's obligation. Creator/recipient settlement is out of scope (direct-charge proceeds are never in this table). Free core read over ATM's revenue-share distribution rail; carries no buyer PII, payer fields, or connected-account ids.","parameters":{"type":"params","properties":{"cursor":{"type":"string","maxLength":128,"description":"Opaque keyset cursor from a prior page. Omit to start at the most recent distribution."},"environment":{"type":"string","knownValues":["test","live"],"maxLength":16,"description":"Which app environment's payouts to return. Defaults to live."},"paymentId":{"type":"string","maxLength":128,"description":"Optional filter to a single originating payment."},"status":{"type":"string","knownValues":["queued","scheduled","transferred","held","reversed","failed"],"maxLength":16,"description":"Optional filter to one synthesized payout status."},"limit":{"type":"integer","minimum":1,"maximum":200,"default":50}}},"output":{"encoding":"application/json","schema":{"type":"object","required":["distributions"],"properties":{"distributions":{"type":"array","items":{"type":"ref","ref":"#distribution"}},"cursor":{"type":"string","maxLength":128,"description":"Keyset cursor for the next page; absent when no more rows."}}}},"errors":[{"name":"UnsupportedHistoricalCurrency"}]}}}