{"openapi":"3.1.0","info":{"title":"GET /api/v1/deferred-revenue/recognized","version":"1.0.0","description":"Recognized revenue"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/deferred-revenue/recognized":{"get":{"tags":["deferred-revenue"],"summary":"Recognized revenue","description":"Recognized revenue by period, method and source, with upcoming totals for drill-down.","operationId":"get_recognized_revenue_api_v1_deferred_revenue_recognized_get","parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Only periods ending on/after this date","title":"Start Date"},"description":"Only periods ending on/after this date"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Only periods ending on/before this date","title":"End Date"},"description":"Only periods ending on/before this date"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"description":"Page size, in groups","default":100,"title":"Limit"},"description":"Page size, in groups"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Offset, in groups","default":0,"title":"Offset"},"description":"Offset, in groups"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_RecognizedRevenueResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"RecognizedRevenueMethodTotal":{"properties":{"recognized_cents":{"type":"integer","title":"Recognized Cents","default":0},"upcoming_cents":{"type":"integer","title":"Upcoming Cents","default":0}},"type":"object","title":"RecognizedRevenueMethodTotal","description":"Recognized/upcoming totals for one recognition method, across all groups."},"RecognizedRevenueResponse":{"properties":{"rows":{"items":{"$ref":"#/components/schemas/RecognizedRevenueRow"},"type":"array","title":"Rows"},"count":{"type":"integer","title":"Count","description":"Total groups matching the filters, unpaged"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"},"method_totals":{"additionalProperties":{"$ref":"#/components/schemas/RecognizedRevenueMethodTotal"},"type":"object","title":"Method Totals","description":"Recognized/upcoming totals per recognition method, across every matching group - not just the current page"},"total_recognized_cents":{"type":"integer","title":"Total Recognized Cents"},"total_upcoming_cents":{"type":"integer","title":"Total Upcoming Cents"}},"type":"object","required":["rows","count","limit","offset","total_recognized_cents","total_upcoming_cents"],"title":"RecognizedRevenueResponse","description":"Recognized revenue by period, method and source, paginated over groups."},"RecognizedRevenueRow":{"properties":{"period":{"type":"string","title":"Period","description":"YYYY-MM recognition period (period_end month)"},"method":{"$ref":"#/components/schemas/RevenueRecognitionMethodEnum"},"source":{"type":"string","enum":["invoice","contract"],"title":"Source","description":"invoice: an invoice-deferral tranche (source=invoice). contract: any contract-referenced tranche (ASC 606 straight-line or hours-percent burndown) - the union the O2C waterfall export does not cover, since it only sees reference_type=contract."},"label":{"type":"string","title":"Label","description":"Invoice number (with customer) for invoice-sourced rows, or the contract's number/name for contract-sourced rows - including hours-percent burndown rows, which the O2C waterfall otherwise leaves unlabeled."},"reference_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference Id","description":"Invoice id or contract id this group's tranches reference"},"recognized_cents":{"type":"integer","title":"Recognized Cents","description":"Posted (recognized=true) total"},"upcoming_cents":{"type":"integer","title":"Upcoming Cents","description":"Scheduled but not yet recognized total"},"schedule_ids":{"items":{"type":"string"},"type":"array","title":"Schedule Ids","description":"revenue_schedules row ids behind this group, for drill-down"}},"type":"object","required":["period","method","source","label","recognized_cents","upcoming_cents"],"title":"RecognizedRevenueRow","description":"One (period, method, source, reference) group in the recognized-revenue report."},"RevenueRecognitionMethodEnum":{"type":"string","enum":["straight_line","point_in_time","hours_percent"],"title":"RevenueRecognitionMethodEnum","description":"How a tranche becomes due for recognition."},"SuccessEnvelope_RecognizedRevenueResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/RecognizedRevenueResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[RecognizedRevenueResponse]"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"security":[{"BearerAuth":[]}]}