{
 "openapi": "3.1.0",
 "info": {
  "title": "Chart of Accounts (Accounting)",
  "version": "20261030b",
  "description": "Read and maintain gl accounts records (acct.gl_accounts)."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "gl-accounts": {
    "type": "object",
    "required": [
     "account_no",
     "name",
     "account_type"
    ],
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id",
      "readOnly": true
     },
     "org_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org id",
      "readOnly": true
     },
     "account_no": {
      "type": "string",
      "description": "Account number"
     },
     "name": {
      "type": "string",
      "description": "Name"
     },
     "account_type": {
      "type": "string",
      "description": "Type"
     },
     "is_postable": {
      "type": "boolean",
      "description": "Postable"
     },
     "is_active": {
      "type": "boolean",
      "description": "Is active"
     },
     "org_unit_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org unit id",
      "readOnly": true
     },
     "is_monetary": {
      "type": "boolean",
      "description": "Is monetary",
      "readOnly": true
     },
     "is_intercompany": {
      "type": "boolean",
      "description": "Is intercompany",
      "readOnly": true
     },
     "group_account_code": {
      "type": "string",
      "description": "Group account code",
      "readOnly": true
     },
     "cash_flow_category": {
      "type": "string",
      "description": "Cash flow category",
      "readOnly": true
     },
     "translation_rate_type": {
      "type": "string",
      "description": "Translation rate type",
      "readOnly": true
     },
     "requires_partner": {
      "type": "boolean",
      "description": "Requires partner",
      "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
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Created at",
      "readOnly": true
     },
     "created_by": {
      "type": "string",
      "format": "uuid",
      "description": "Created by",
      "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
     },
     "posting_role": {
      "type": "string",
      "description": "Posting role",
      "enum": [
       "— none —",
       "Accounts receivable",
       "Accounts payable",
       "Cash / bank",
       "Revenue (default)",
       "Expense (default, non-PO)",
       "GR/IR accrual",
       "Procurement budget (requisitions and orders)",
       "Sales tax / VAT payable",
       "Exchange gain / loss",
       "Inventory",
       "Cost of goods sold",
       "Salaries and wages expense",
       "Wages payable",
       "Payroll taxes payable",
       "Employer payroll tax expense",
       "Benefit deductions payable",
       "Fixed assets",
       "Accumulated depreciation",
       "Depreciation expense",
       "Inventory adjustment",
       "Production variance",
       "Maintenance cost",
       "Field service parts",
       "Travel",
       "Professional services",
       "Landed cost clearing",
       "Landed cost accrual",
       "Input tax recoverable",
       "Output tax (tax return)",
       "Contract liability (deferred revenue)",
       "Service revenue",
       "Intercompany expense",
       "Staffing revenue",
       "Cost of placements",
       "Purchase discounts taken",
       "Allocation clearing",
       "Cost allocation (distribution)",
       "Finished goods inventory",
       "Work in process",
       "Travel advances",
       "Employee reimbursements payable",
       "Scrap and shrinkage",
       "Opening balance equity",
       "Impairment loss",
       "Revaluation reserve",
       "Asset acquisition clearing",
       "Intercompany receivable",
       "Intercompany payable",
       "Assets under construction",
       "Project cost clearing",
       "Due to other funds",
       "Due from other funds",
       "Labor absorption (payroll clearing)",
       "Tax payable on the return",
       "Tax refundable on the return",
       "Right-of-use asset",
       "Lease liability",
       "Rent / lease cost",
       "Interest expense",
       "Right-of-use depreciation",
       "Gain on disposal / modification",
       "Loss on disposal / modification",
       "Unrealised exchange gain",
       "Unrealised exchange loss"
      ]
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/api/accounting/gl-accounts": {
   "get": {
    "summary": "list gl-accounts",
    "operationId": "list_gl_accounts_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create gl-accounts",
    "operationId": "create_gl_accounts_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/gl-accounts/{id}": {
   "get": {
    "summary": "get gl-accounts",
    "operationId": "get_gl_accounts_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change gl-accounts",
    "operationId": "change_gl_accounts_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete gl-accounts",
    "operationId": "delete_gl_accounts_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/gl-accounts/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_gl_accounts_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"
     }
    }
   }
  }
 }
}