{
 "openapi": "3.1.0",
 "info": {
  "title": "Projects (Accounting)",
  "version": "20261030b",
  "description": "A plan and a cost collector at once. The join between them is the work breakdown structure — a WBS element is simultaneously a piece of work and an account assignment."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "projects": {
    "type": "object",
    "required": [
     "name"
    ],
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id",
      "readOnly": true
     },
     "org_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org id",
      "readOnly": true
     },
     "org_unit_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org unit id",
      "readOnly": true
     },
     "project_no": {
      "type": "string",
      "description": "Project no",
      "readOnly": true
     },
     "name": {
      "type": "string",
      "description": "Name"
     },
     "program_id": {
      "type": "string",
      "format": "uuid",
      "description": "Program"
     },
     "portfolio_id": {
      "type": "string",
      "format": "uuid",
      "description": "Portfolio"
     },
     "parent_id": {
      "type": "string",
      "format": "uuid",
      "description": "Parent project"
     },
     "project_type": {
      "type": "string",
      "description": "Type"
     },
     "cost_object_type": {
      "type": "string",
      "description": "Cost object",
      "enum": [
       "cost_collector",
       "asset_under_construction",
       "billable",
       "statistical",
       "investment"
      ]
     },
     "account_id": {
      "type": "string",
      "format": "uuid",
      "description": "Customer"
     },
     "opportunity_id": {
      "type": "string",
      "format": "uuid",
      "description": "Opportunity"
     },
     "rev_contract_id": {
      "type": "string",
      "format": "uuid",
      "description": "Revenue contract"
     },
     "manager_employee_id": {
      "type": "string",
      "format": "uuid",
      "description": "Project manager"
     },
     "sponsor_employee_id": {
      "type": "string",
      "format": "uuid",
      "description": "Sponsor"
     },
     "cost_center_id": {
      "type": "string",
      "format": "uuid",
      "description": "Cost center"
     },
     "profit_center_id": {
      "type": "string",
      "format": "uuid",
      "description": "Profit center"
     },
     "baseline_start": {
      "type": "string",
      "format": "date",
      "description": "Baseline start"
     },
     "baseline_end": {
      "type": "string",
      "format": "date",
      "description": "Baseline end"
     },
     "planned_start": {
      "type": "string",
      "format": "date",
      "description": "Planned start"
     },
     "planned_end": {
      "type": "string",
      "format": "date",
      "description": "Planned end"
     },
     "actual_start": {
      "type": "string",
      "format": "date",
      "description": "Actual start"
     },
     "actual_end": {
      "type": "string",
      "format": "date",
      "description": "Actual end"
     },
     "currency": {
      "type": "string",
      "description": "Currency"
     },
     "budget_amount": {
      "type": "string",
      "format": "decimal",
      "description": "Budget"
     },
     "approved_amount": {
      "type": "string",
      "format": "decimal",
      "description": "Approved"
     },
     "contract_value": {
      "type": "string",
      "format": "decimal",
      "description": "Contract value"
     },
     "estimate_at_completion": {
      "type": "string",
      "format": "decimal",
      "description": "Estimate at completion"
     },
     "estimate_to_complete": {
      "type": "string",
      "format": "decimal",
      "description": "Estimate to complete"
     },
     "percent_complete": {
      "type": "string",
      "format": "decimal",
      "description": "Percent complete"
     },
     "progress_method": {
      "type": "string",
      "description": "Progress method",
      "enum": [
       "Cost to cost",
       "Effort (hours)",
       "Milestones",
       "Units completed",
       "Physical progress",
       "Entered by hand"
      ]
     },
     "allow_direct_postings": {
      "type": "boolean",
      "description": "Accepts postings at header level"
     },
     "settlement_receiver_type": {
      "type": "string",
      "description": "Settlement receiver type"
     },
     "settlement_receiver_id": {
      "type": "string",
      "format": "uuid",
      "description": "Settlement receiver id"
     },
     "asset_id": {
      "type": "string",
      "format": "uuid",
      "description": "Asset under construction"
     },
     "status": {
      "type": "string",
      "description": "Status",
      "readOnly": true
     },
     "health": {
      "type": "string",
      "description": "Health",
      "enum": [
       "green",
       "amber",
       "red"
      ]
     },
     "priority": {
      "type": "string",
      "description": "Priority",
      "enum": [
       "critical",
       "high",
       "medium",
       "low"
      ]
     },
     "risk_level": {
      "type": "string",
      "description": "Risk level",
      "enum": [
       "high",
       "medium",
       "low"
      ]
     },
     "approved_by": {
      "type": "string",
      "format": "uuid",
      "description": "Approved by",
      "readOnly": true
     },
     "approved_at": {
      "type": "string",
      "format": "date-time",
      "description": "Approved at",
      "readOnly": true
     },
     "closed_at": {
      "type": "string",
      "format": "date-time",
      "description": "Closed at",
      "readOnly": true
     },
     "description": {
      "type": "string",
      "description": "Description"
     },
     "notes": {
      "type": "string",
      "description": "Notes"
     },
     "created_by": {
      "type": "string",
      "format": "uuid",
      "description": "Created by",
      "readOnly": true
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Created at",
      "readOnly": true
     },
     "xf_text_1": {
      "type": "string",
      "description": "Xf text 1",
      "readOnly": true
     },
     "xf_text_2": {
      "type": "string",
      "description": "Xf text 2",
      "readOnly": true
     },
     "xf_text_3": {
      "type": "string",
      "description": "Xf text 3",
      "readOnly": true
     },
     "xf_text_4": {
      "type": "string",
      "description": "Xf text 4",
      "readOnly": true
     },
     "xf_text_5": {
      "type": "string",
      "description": "Xf text 5",
      "readOnly": true
     },
     "xf_num_1": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 1",
      "readOnly": true
     },
     "xf_num_2": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 2",
      "readOnly": true
     },
     "xf_num_3": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 3",
      "readOnly": true
     },
     "xf_date_1": {
      "type": "string",
      "format": "date",
      "description": "Xf date 1",
      "readOnly": true
     },
     "xf_date_2": {
      "type": "string",
      "format": "date",
      "description": "Xf date 2",
      "readOnly": true
     },
     "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Updated at",
      "readOnly": true
     },
     "updated_by": {
      "type": "string",
      "format": "uuid",
      "description": "Updated by",
      "readOnly": true
     },
     "released_at": {
      "type": "string",
      "format": "date-time",
      "description": "Released at",
      "readOnly": true
     },
     "released_by": {
      "type": "string",
      "format": "uuid",
      "description": "Released by",
      "readOnly": true
     },
     "status_reason": {
      "type": "string",
      "description": "Status reason",
      "readOnly": true
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/api/accounting/projects": {
   "get": {
    "summary": "list projects",
    "operationId": "list_projects_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create projects",
    "operationId": "create_projects_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/projects/{id}": {
   "get": {
    "summary": "get projects",
    "operationId": "get_projects_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change projects",
    "operationId": "change_projects_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete projects",
    "operationId": "delete_projects_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/projects/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_projects_0_6",
    "description": "Body keys: overrides, preview, withLines",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/projects/{id}/plan": {
   "get": {
    "summary": "Plan",
    "operationId": "action_projects_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/projects/{id}/schedule": {
   "post": {
    "summary": "Schedule",
    "operationId": "action_projects_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/projects/{id}/progress": {
   "post": {
    "summary": "Progress",
    "operationId": "action_projects_0_6",
    "description": "Body keys: method, estimateToComplete, estimateAtCompletion",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/projects/{id}/charge": {
   "post": {
    "summary": "Charge",
    "operationId": "action_projects_0_6",
    "description": "Body keys: sourceRef, post, fundId, grantId, creditAccountNo, wbsElementId, activityId, valueType, amount, description, accountNo, hours, employeeId, supplierId, itemId, postingDate, isBillable, override; valueType one of plan|commitment|actual|statistical|revenue|billed|accrual|settlement",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/projects/{id}/settle-to-asset": {
   "post": {
    "summary": "Settle to asset",
    "operationId": "action_projects_0_6",
    "description": "Body keys: usefulLifeMonths, assetAccountNo, aucAccountNo, assetId, inServiceDate, assetName, assetClassId",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/projects/{id}/cost-report": {
   "get": {
    "summary": "Cost report",
    "operationId": "action_projects_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/projects/{id}/approve": {
   "post": {
    "summary": "Approve",
    "operationId": "action_projects_0_6",
    "description": "Body keys: approvedAmount",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/projects/{id}/release": {
   "post": {
    "summary": "Release",
    "operationId": "action_projects_0_6",
    "description": "Body keys: releaseWbs",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/projects/{id}/start": {
   "post": {
    "summary": "Start",
    "operationId": "action_projects_0_6",
    "description": "Body keys: actualStart",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/projects/{id}/hold": {
   "post": {
    "summary": "Hold",
    "operationId": "action_projects_0_6",
    "description": "Body keys: reason",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/projects/{id}/resume": {
   "post": {
    "summary": "Resume",
    "operationId": "action_projects_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/projects/{id}/complete": {
   "post": {
    "summary": "Complete",
    "operationId": "action_projects_0_6",
    "description": "Body keys: actualEnd",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/projects/{id}/close": {
   "post": {
    "summary": "Close",
    "operationId": "action_projects_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/projects/{id}/cancel": {
   "post": {
    "summary": "Cancel",
    "operationId": "action_projects_0_6",
    "description": "Body keys: reason",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}