{
 "openapi": "3.1.0",
 "info": {
  "title": "Contribution Margin (Accounting)",
  "version": "20261030b",
  "description": "The ladder, cut by whatever you ask for. Rows that reverse between gross margin and full margin are the finding this module exists to produce."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {}
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/api/accounting/profitability/derive": {
   "post": {
    "summary": "Derive",
    "operationId": "action_profitability_0_5",
    "description": "Body keys: accountId, itemId, profitCenterId, costCenterId, orgUnitId, salesEmployeeId, channel, extra",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/profitability/post": {
   "post": {
    "summary": "Post",
    "operationId": "action_profitability_0_5",
    "description": "Body keys: segmentId*, periodCode, version, recordType, sourceType, sourceId, sourceRef; version one of actual|plan|forecast|simulation|prior_year; recordType one of billing|order|allocation|settlement|direct|accrual|plan|statistical; lines: [{ valueField, postingDate, amount, quantity, uom, currency }]",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/profitability/report": {
   "get": {
    "summary": "Report",
    "operationId": "action_profitability_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}