{
 "openapi": "3.1.0",
 "info": {
  "title": "Journals (Accounting)",
  "version": "20261030b",
  "description": "Read and maintain journals records (acct.journals)."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "journals": {
    "type": "object",
    "required": [],
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id",
      "readOnly": true
     },
     "org_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org id",
      "readOnly": true
     },
     "journal_no": {
      "type": "string",
      "description": "Journal no",
      "readOnly": true
     },
     "journal_date": {
      "type": "string",
      "format": "date",
      "description": "Journal date",
      "readOnly": true
     },
     "journal_type": {
      "type": "string",
      "description": "Journal type",
      "readOnly": true
     },
     "source_module": {
      "type": "string",
      "description": "Source module",
      "readOnly": true
     },
     "source_ref": {
      "type": "string",
      "description": "Source ref",
      "readOnly": true
     },
     "memo": {
      "type": "string",
      "description": "Memo",
      "readOnly": true
     },
     "status": {
      "type": "string",
      "description": "Status",
      "readOnly": true
     },
     "total_debit": {
      "type": "string",
      "format": "decimal",
      "description": "Total debit",
      "readOnly": true
     },
     "total_credit": {
      "type": "string",
      "format": "decimal",
      "description": "Total credit",
      "readOnly": true
     },
     "posted_by": {
      "type": "string",
      "format": "uuid",
      "description": "Posted by",
      "readOnly": true
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Created at",
      "readOnly": true
     },
     "org_unit_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org unit id",
      "readOnly": true
     },
     "cancelled_at": {
      "type": "string",
      "format": "date-time",
      "description": "Cancelled at",
      "readOnly": true
     },
     "cancelled_by": {
      "type": "string",
      "format": "uuid",
      "description": "Cancelled by",
      "readOnly": true
     },
     "cancel_reason": {
      "type": "string",
      "description": "Cancel reason",
      "readOnly": true
     },
     "reversed_by_id": {
      "type": "string",
      "format": "uuid",
      "description": "Reversed by id",
      "readOnly": true
     },
     "reverses_id": {
      "type": "string",
      "format": "uuid",
      "description": "Reverses id",
      "readOnly": true
     },
     "is_reversal": {
      "type": "boolean",
      "description": "Is reversal",
      "readOnly": true
     },
     "ledger_id": {
      "type": "string",
      "format": "uuid",
      "description": "Ledger id",
      "readOnly": true
     },
     "currency": {
      "type": "string",
      "description": "Currency",
      "readOnly": true
     },
     "exchange_rate": {
      "type": "string",
      "format": "decimal",
      "description": "Exchange rate",
      "readOnly": true
     },
     "valuation_run_id": {
      "type": "string",
      "format": "uuid",
      "description": "Valuation run id",
      "readOnly": true
     },
     "is_intercompany": {
      "type": "boolean",
      "description": "Is intercompany",
      "readOnly": true
     },
     "partner_org_id": {
      "type": "string",
      "format": "uuid",
      "description": "Partner org id",
      "readOnly": true
     },
     "elimination_group_id": {
      "type": "string",
      "format": "uuid",
      "description": "Elimination group id",
      "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_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
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/api/accounting/journals": {
   "get": {
    "summary": "list journals",
    "operationId": "list_journals_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "Post journals",
    "operationId": "action_journals_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/journals/{id}": {
   "get": {
    "summary": "get journals",
    "operationId": "get_journals_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "Put journals",
    "operationId": "action_journals_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "Delete journals",
    "operationId": "action_journals_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/journals/approval-required": {
   "post": {
    "summary": "Approval required",
    "operationId": "action_journals_0_5",
    "description": "Body keys: journalType, sourceModule, journalDate, amount, accountNos, ledgerId; sourceModule one of acct|manual",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/journals/approvals/request": {
   "post": {
    "summary": "Approvals request",
    "operationId": "action_journals_0_6",
    "description": "Body keys: journalId, proposedEntry, amount, reason*, supportingUrl, ruleCode",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/journals/approvals/{id}/decide": {
   "post": {
    "summary": "Approvals decide",
    "operationId": "action_journals_0_7",
    "description": "Body keys: action, comment; action one of approve|reject|request_info",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/journals/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_journals_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/journals/{parentId}/lines": {
   "get": {
    "summary": "Lines",
    "operationId": "action_journals_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "Lines",
    "operationId": "action_journals_1_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/journals/{parentId}/lines/{lineId}": {
   "put": {
    "summary": "Lines",
    "operationId": "action_journals_0_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "Lines",
    "operationId": "action_journals_1_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/journals/{id}/lines": {
   "get": {
    "summary": "Lines",
    "operationId": "action_journals_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/journals/post": {
   "post": {
    "summary": "Post",
    "operationId": "action_journals_0_5",
    "description": "Body keys: journalType, dimensions, fundId, grantId, programId, functionId, journalDate, memo, costCenterId, profitCenterId, currency, exchangeRate; lines*: [{ currency, exchangeRate }]",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}