{"openapi":"3.1.0","info":{"title":"Cox & Hazel Client Portal API","version":"0.1.0","description":"Programmatic access to invoices and documents. Authenticate with a Bearer API key (chp_live_…) minted in the developer portal."},"servers":[{"url":"https://coxhazel-portal.derekethandavis.com"}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"chp_live_*"}},"schemas":{"Invoice":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"description":{"type":"string"},"amountCents":{"type":"integer"},"currency":{"type":"string"},"status":{"type":"string","enum":["draft","sent","paid","void"]},"paymentUrl":{"type":"string","nullable":true},"dueAt":{"type":"integer","nullable":true},"paidAt":{"type":"integer","nullable":true}}},"File":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"sizeBytes":{"type":"integer"},"contentType":{"type":"string","nullable":true},"spWebUrl":{"type":"string","nullable":true}}}}},"security":[{"apiKey":[]}],"paths":{"/api/invoices":{"get":{"summary":"List invoices for the authenticated client","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Invoice"}}}}}}}},"/api/invoices/{id}":{"get":{"summary":"Get one invoice","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"404":{"description":"Not found"}}}},"/api/invoices/{id}/pay":{"post":{"summary":"Get a hosted payment link for an invoice","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK, returns { paymentUrl }"}}}},"/api/files":{"get":{"summary":"List documents","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/File"}}}}}}},"post":{"summary":"Upload a document (multipart/form-data, field 'file')","responses":{"201":{"description":"Created"}}}},"/api/files/{id}/download":{"get":{"summary":"302-redirect to a short-lived download URL","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"302":{"description":"Redirect"}}}}}}