{
 "openapi": "3.1.0",
 "info": {
  "title": "Cash Forecast Lines (Accounting)",
  "version": "20261030b",
  "description": "Confidence is the difference between a forecast and a wish: a receivable from a customer who has never paid late is 95%, a sale that has not been signed is 30%."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "forecast-lines": {
    "type": "object",
    "required": [
     "forecast_id",
     "line_no",
     "expected_date",
     "direction"
    ],
    "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
     },
     "forecast_id": {
      "type": "string",
      "format": "uuid",
      "description": "Forecast"
     },
     "line_no": {
      "type": "integer",
      "description": "Line"
     },
     "liquidity_item_id": {
      "type": "string",
      "format": "uuid",
      "description": "Category"
     },
     "bank_account_id": {
      "type": "string",
      "format": "uuid",
      "description": "Bank account id"
     },
     "expected_date": {
      "type": "string",
      "format": "date",
      "description": "Expected date"
     },
     "period_bucket": {
      "type": "string",
      "description": "Period bucket"
     },
     "direction": {
      "type": "string",
      "description": "Direction",
      "enum": [
       "inflow",
       "outflow"
      ]
     },
     "description": {
      "type": "string",
      "description": "Description"
     },
     "currency": {
      "type": "string",
      "description": "Currency"
     },
     "amount": {
      "type": "string",
      "format": "decimal",
      "description": "Amount"
     },
     "base_amount": {
      "type": "string",
      "format": "decimal",
      "description": "Base amount"
     },
     "exchange_rate": {
      "type": "string",
      "format": "decimal",
      "description": "Exchange rate"
     },
     "confidence_pct": {
      "type": "string",
      "format": "decimal",
      "description": "Confidence %"
     },
     "weighted_amount": {
      "type": "string",
      "format": "decimal",
      "description": "Weighted amount",
      "readOnly": true
     },
     "contractual_date": {
      "type": "string",
      "format": "date",
      "description": "Contractual date"
     },
     "delay_days": {
      "type": "integer",
      "description": "Delay days"
     },
     "source_type": {
      "type": "string",
      "description": "Source type"
     },
     "source_id": {
      "type": "string",
      "format": "uuid",
      "description": "Source id"
     },
     "source_ref": {
      "type": "string",
      "description": "Source ref"
     },
     "account_id": {
      "type": "string",
      "format": "uuid",
      "description": "Account id"
     },
     "supplier_id": {
      "type": "string",
      "format": "uuid",
      "description": "Supplier id"
     },
     "is_committed": {
      "type": "boolean",
      "description": "Committed"
     },
     "is_manual": {
      "type": "boolean",
      "description": "Entered by hand"
     },
     "actual_date": {
      "type": "string",
      "format": "date",
      "description": "Actual date"
     },
     "actual_amount": {
      "type": "string",
      "format": "decimal",
      "description": "Actual amount"
     },
     "variance_days": {
      "type": "integer",
      "description": "Variance days"
     },
     "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
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/api/accounting/forecast-lines": {
   "get": {
    "summary": "list forecast-lines",
    "operationId": "list_forecast_lines_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create forecast-lines",
    "operationId": "create_forecast_lines_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/forecast-lines/{id}": {
   "get": {
    "summary": "get forecast-lines",
    "operationId": "get_forecast_lines_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change forecast-lines",
    "operationId": "change_forecast_lines_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete forecast-lines",
    "operationId": "delete_forecast_lines_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/forecast-lines/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_forecast_lines_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"
     }
    }
   }
  }
 }
}