{"lexicon":1,"id":"money.atmosphere.analytics.getPaymentVolumeTrends","defs":{"bucket":{"type":"object","required":["bucket","currency","count","successCount","grossCents"],"properties":{"bucket":{"type":"string","format":"datetime","description":"Start of the time bucket (UTC)."},"currency":{"type":"string","maxLength":3,"description":"Lowercase ISO 4217. Buckets are per-currency; never sum across currencies."},"count":{"type":"integer","description":"All payments in the bucket."},"successCount":{"type":"integer","description":"Payments with a settled status in the bucket."},"grossCents":{"type":"integer","description":"Gross settled volume for this currency in the bucket."}}},"methodStat":{"type":"object","required":["method","currency","count","grossCents"],"properties":{"method":{"type":"string","maxLength":32,"description":"Payment method type (e.g. card, link), or 'unknown'."},"currency":{"type":"string","maxLength":3},"count":{"type":"integer"},"grossCents":{"type":"integer"}}},"currencyStat":{"type":"object","required":["currency","count","successCount","grossCents"],"properties":{"currency":{"type":"string","maxLength":3},"count":{"type":"integer"},"successCount":{"type":"integer"},"grossCents":{"type":"integer"}}},"main":{"type":"query","description":"Aggregate payment-volume trends for the calling app, scoped to payments it originated. Requires a service-auth JWT signed by the app DID. Returns ONLY aggregates (per-currency time buckets, by-method and by-currency totals) — never per-payment rows, buyer DIDs, emails, or processor ids. Settled volume comes from ATM's private ledger.","parameters":{"type":"params","properties":{"environment":{"type":"string","knownValues":["test","live"],"maxLength":8,"description":"Which app environment to report on. Defaults to live."},"granularity":{"type":"string","knownValues":["hour","day"],"maxLength":8,"description":"Time-bucket size. Defaults to day. (5m is a future tier.)"},"windowDays":{"type":"integer","minimum":1,"maximum":92,"default":30,"description":"Lookback window in days from now. Capped at 92."},"currency":{"type":"string","maxLength":3,"description":"Optional lowercase ISO 4217 filter."}}},"output":{"encoding":"application/json","schema":{"type":"object","required":["series","byMethod","byCurrency","window"],"properties":{"series":{"type":"array","items":{"type":"ref","ref":"#bucket"}},"byMethod":{"type":"array","items":{"type":"ref","ref":"#methodStat"}},"byCurrency":{"type":"array","items":{"type":"ref","ref":"#currencyStat"}},"window":{"type":"object","required":["granularity","windowDays","from","to"],"properties":{"granularity":{"type":"string","maxLength":8},"windowDays":{"type":"integer"},"from":{"type":"string","format":"datetime"},"to":{"type":"string","format":"datetime"}}}}}}}}}