{
 "openapi": "3.1.0",
 "info": {
  "title": "Debt & Instruments (Accounting)",
  "version": "20261030b",
  "description": "Loans, facilities, deposits and derivatives. A facility’s undrawn headroom is the most important liquidity figure a company has and lives nowhere in an ordinary ledger."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "financial-instruments": {
    "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
     },
     "instrument_no": {
      "type": "string",
      "description": "Instrument no",
      "readOnly": true
     },
     "name": {
      "type": "string",
      "description": "Name"
     },
     "instrument_type": {
      "type": "string",
      "description": "Type"
     },
     "direction": {
      "type": "string",
      "description": "Direction",
      "enum": [
       "borrowing",
       "investment",
       "hedge"
      ]
     },
     "counterparty": {
      "type": "string",
      "description": "Counterparty"
     },
     "counterparty_supplier_id": {
      "type": "string",
      "format": "uuid",
      "description": "Counterparty (supplier)"
     },
     "counterparty_org_id": {
      "type": "string",
      "format": "uuid",
      "description": "Counterparty (group company)"
     },
     "bank_account_id": {
      "type": "string",
      "format": "uuid",
      "description": "Bank account"
     },
     "currency": {
      "type": "string",
      "description": "Currency"
     },
     "principal_amount": {
      "type": "string",
      "format": "decimal",
      "description": "Principal"
     },
     "outstanding_amount": {
      "type": "string",
      "format": "decimal",
      "description": "Outstanding"
     },
     "facility_limit": {
      "type": "string",
      "format": "decimal",
      "description": "Facility limit"
     },
     "drawn_amount": {
      "type": "string",
      "format": "decimal",
      "description": "Drawn"
     },
     "trade_date": {
      "type": "string",
      "format": "date",
      "description": "Traded"
     },
     "value_date": {
      "type": "string",
      "format": "date",
      "description": "Value date"
     },
     "maturity_date": {
      "type": "string",
      "format": "date",
      "description": "Matures"
     },
     "rate_type": {
      "type": "string",
      "description": "Rate type",
      "enum": [
       "fixed",
       "floating",
       "zero",
       "discount",
       "stepped"
      ]
     },
     "interest_rate_pct": {
      "type": "string",
      "format": "decimal",
      "description": "Interest rate %"
     },
     "reference_rate": {
      "type": "string",
      "description": "Reference rate"
     },
     "margin_pct": {
      "type": "string",
      "format": "decimal",
      "description": "Margin %"
     },
     "day_count": {
      "type": "string",
      "description": "Day count",
      "enum": [
       "actual_360",
       "actual_365",
       "30_360",
       "actual_actual"
      ]
     },
     "payment_frequency": {
      "type": "string",
      "description": "Payment frequency",
      "enum": [
       "monthly",
       "quarterly",
       "semi_annual",
       "annual",
       "at_maturity",
       "irregular"
      ]
     },
     "buy_currency": {
      "type": "string",
      "description": "Buy currency"
     },
     "sell_currency": {
      "type": "string",
      "description": "Sell currency"
     },
     "buy_amount": {
      "type": "string",
      "format": "decimal",
      "description": "Buy amount"
     },
     "sell_amount": {
      "type": "string",
      "format": "decimal",
      "description": "Sell amount"
     },
     "contract_rate": {
      "type": "string",
      "format": "decimal",
      "description": "Contract rate"
     },
     "is_hedge": {
      "type": "boolean",
      "description": "Designated as a hedge"
     },
     "hedge_type": {
      "type": "string",
      "description": "Hedge type",
      "enum": [
       "fair_value",
       "cash_flow",
       "net_investment"
      ]
     },
     "hedged_item": {
      "type": "string",
      "description": "Hedged item"
     },
     "hedge_ratio": {
      "type": "string",
      "format": "decimal",
      "description": "Hedge ratio"
     },
     "effectiveness_pct": {
      "type": "string",
      "format": "decimal",
      "description": "Effectiveness %"
     },
     "fair_value": {
      "type": "string",
      "format": "decimal",
      "description": "Fair value"
     },
     "fair_value_date": {
      "type": "string",
      "format": "date",
      "description": "Valued on"
     },
     "accrued_interest": {
      "type": "string",
      "format": "decimal",
      "description": "Accrued interest"
     },
     "principal_account_id": {
      "type": "string",
      "format": "uuid",
      "description": "Principal account"
     },
     "interest_account_id": {
      "type": "string",
      "format": "uuid",
      "description": "Interest account"
     },
     "fair_value_account_id": {
      "type": "string",
      "format": "uuid",
      "description": "Fair value account id"
     },
     "status": {
      "type": "string",
      "description": "Status",
      "readOnly": true
     },
     "contract_ref": {
      "type": "string",
      "description": "Contract reference"
     },
     "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
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/api/accounting/financial-instruments": {
   "get": {
    "summary": "list financial-instruments",
    "operationId": "list_financial_instruments_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create financial-instruments",
    "operationId": "create_financial_instruments_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/financial-instruments/{id}": {
   "get": {
    "summary": "get financial-instruments",
    "operationId": "get_financial_instruments_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change financial-instruments",
    "operationId": "change_financial_instruments_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete financial-instruments",
    "operationId": "delete_financial_instruments_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/financial-instruments/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_financial_instruments_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/financial-instruments/{parentId}/schedule": {
   "get": {
    "summary": "Schedule",
    "operationId": "action_financial_instruments_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "Schedule",
    "operationId": "action_financial_instruments_1_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/financial-instruments/{parentId}/schedule/{lineId}": {
   "put": {
    "summary": "Schedule",
    "operationId": "action_financial_instruments_0_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "Schedule",
    "operationId": "action_financial_instruments_1_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}