{"openapi":"3.1.0","info":{"title":"GET /api/v1/contracts/summary/by-type","version":"1.0.0","description":"Contracted value grouped by billing rule"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/contracts/summary/by-type":{"get":{"tags":["contracts"],"summary":"Contracted value grouped by billing rule","description":"Total contracted line value bucketed by billing rule (prepaid_block, flat, per_unit, recurring, usage_metered) for the value-by-type chart.","operationId":"contract_value_by_type_api_v1_contracts_summary_by_type_get","parameters":[{"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_ContractValueByTypeResponse_"}}}},"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":{"ContractValueByTypeResponse":{"properties":{"buckets":{"items":{"$ref":"#/components/schemas/ContractValueTypeBucket"},"type":"array","title":"Buckets"},"total_value_cents":{"type":"integer","title":"Total Value Cents","default":0}},"type":"object","title":"ContractValueByTypeResponse","description":"Total contracted line value grouped by billing rule (for a donut/bars)."},"ContractValueTypeBucket":{"properties":{"billing_rule":{"type":"string","title":"Billing Rule"},"value_cents":{"type":"integer","title":"Value Cents","default":0},"line_count":{"type":"integer","title":"Line Count","default":0},"pct":{"type":"number","title":"Pct","default":0.0}},"type":"object","required":["billing_rule"],"title":"ContractValueTypeBucket","description":"Contracted value attributed to one billing rule."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"SuccessEnvelope_ContractValueByTypeResponse_":{"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/ContractValueByTypeResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[ContractValueByTypeResponse]"},"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":[]}]}