{
 "openapi": "3.1.0",
 "info": {
  "title": "Leases (Accounting)",
  "version": "20261030b",
  "description": "IFRS 16 and ASC 842 give different answers for the same lease, and a group reporting both needs both. The classification is applied rather than typed."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "leases": {
    "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
     },
     "lease_no": {
      "type": "string",
      "description": "Lease no",
      "readOnly": true
     },
     "name": {
      "type": "string",
      "description": "Name"
     },
     "role": {
      "type": "string",
      "description": "We are the",
      "enum": [
       "lessee",
       "lessor",
       "sublessor",
       "intercompany"
      ]
     },
     "lease_type": {
      "type": "string",
      "description": "Asset type"
     },
     "classification": {
      "type": "string",
      "description": "Classification"
     },
     "transfers_ownership": {
      "type": "boolean",
      "description": "Ownership transfers at the end"
     },
     "purchase_option_reasonably_certain": {
      "type": "boolean",
      "description": "Purchase option reasonably certain"
     },
     "term_major_part_of_life": {
      "type": "boolean",
      "description": "Term is a major part of the asset’s life"
     },
     "pv_substantially_all_fair_value": {
      "type": "boolean",
      "description": "PV is substantially all of fair value"
     },
     "specialised_asset": {
      "type": "boolean",
      "description": "Specialised asset with no alternative use"
     },
     "is_short_term": {
      "type": "boolean",
      "description": "Short term (12 months or less)"
     },
     "is_low_value": {
      "type": "boolean",
      "description": "Low value"
     },
     "counterparty_supplier_id": {
      "type": "string",
      "format": "uuid",
      "description": "Landlord / lessor (supplier)"
     },
     "counterparty_account_id": {
      "type": "string",
      "format": "uuid",
      "description": "Tenant (customer)"
     },
     "counterparty_org_id": {
      "type": "string",
      "format": "uuid",
      "description": "Group company (intercompany lease)"
     },
     "counterparty_name": {
      "type": "string",
      "description": "Counterparty name"
     },
     "property_id": {
      "type": "string",
      "format": "uuid",
      "description": "Property"
     },
     "rental_unit_id": {
      "type": "string",
      "format": "uuid",
      "description": "Rental unit"
     },
     "asset_id": {
      "type": "string",
      "format": "uuid",
      "description": "Asset id"
     },
     "head_lease_id": {
      "type": "string",
      "format": "uuid",
      "description": "Head lease (for a sublease)"
     },
     "signature_date": {
      "type": "string",
      "format": "date",
      "description": "Signed on"
     },
     "commencement_date": {
      "type": "string",
      "format": "date",
      "description": "Commences"
     },
     "end_date": {
      "type": "string",
      "format": "date",
      "description": "Ends"
     },
     "term_months": {
      "type": "integer",
      "description": "Term (months)"
     },
     "renewal_option_months": {
      "type": "integer",
      "description": "Renewal option (months)"
     },
     "renewal_reasonably_certain": {
      "type": "boolean",
      "description": "Renewal reasonably certain"
     },
     "termination_option_date": {
      "type": "string",
      "format": "date",
      "description": "Termination option"
     },
     "termination_penalty": {
      "type": "string",
      "format": "decimal",
      "description": "Termination penalty"
     },
     "notice_period_days": {
      "type": "integer",
      "description": "Notice period (days)"
     },
     "currency": {
      "type": "string",
      "description": "Currency"
     },
     "payment_amount": {
      "type": "string",
      "format": "decimal",
      "description": "Payment"
     },
     "payment_frequency": {
      "type": "string",
      "description": "Frequency",
      "enum": [
       "monthly",
       "quarterly",
       "semi_annual",
       "annual",
       "weekly",
       "one_off"
      ]
     },
     "payment_timing": {
      "type": "string",
      "description": "Paid",
      "enum": [
       "advance",
       "arrears"
      ]
     },
     "first_payment_date": {
      "type": "string",
      "format": "date",
      "description": "First payment"
     },
     "escalation_type": {
      "type": "string",
      "description": "Escalation",
      "enum": [
       "none",
       "fixed_pct",
       "fixed_amount",
       "index",
       "market_review",
       "stepped"
      ]
     },
     "escalation_pct": {
      "type": "string",
      "format": "decimal",
      "description": "Escalation %"
     },
     "escalation_amount": {
      "type": "string",
      "format": "decimal",
      "description": "Escalation amount"
     },
     "escalation_months": {
      "type": "integer",
      "description": "Escalates every (months)"
     },
     "index_name": {
      "type": "string",
      "description": "Index"
     },
     "index_base_value": {
      "type": "string",
      "format": "decimal",
      "description": "Index base value"
     },
     "variable_payment_basis": {
      "type": "string",
      "description": "Variable payment basis"
     },
     "discount_rate_pct": {
      "type": "string",
      "format": "decimal",
      "description": "Discount rate %"
     },
     "rate_basis": {
      "type": "string",
      "description": "Rate basis",
      "enum": [
       "implicit",
       "incremental_borrowing",
       "group_rate",
       "risk_free"
      ]
     },
     "initial_direct_costs": {
      "type": "string",
      "format": "decimal",
      "description": "Initial direct costs"
     },
     "lease_incentives": {
      "type": "string",
      "format": "decimal",
      "description": "Incentives received"
     },
     "prepaid_amount": {
      "type": "string",
      "format": "decimal",
      "description": "Prepaid"
     },
     "restoration_provision": {
      "type": "string",
      "format": "decimal",
      "description": "Restoration provision"
     },
     "security_deposit": {
      "type": "string",
      "format": "decimal",
      "description": "Security deposit"
     },
     "residual_guarantee": {
      "type": "string",
      "format": "decimal",
      "description": "Residual value guarantee"
     },
     "purchase_option_price": {
      "type": "string",
      "format": "decimal",
      "description": "Purchase option price"
     },
     "initial_liability": {
      "type": "string",
      "format": "decimal",
      "description": "Initial liability",
      "readOnly": true
     },
     "initial_rou_asset": {
      "type": "string",
      "format": "decimal",
      "description": "Initial rou asset",
      "readOnly": true
     },
     "total_payments": {
      "type": "string",
      "format": "decimal",
      "description": "Total payments",
      "readOnly": true
     },
     "total_interest": {
      "type": "string",
      "format": "decimal",
      "description": "Total interest",
      "readOnly": true
     },
     "principle_id": {
      "type": "string",
      "format": "uuid",
      "description": "Accounting principle"
     },
     "ledger_id": {
      "type": "string",
      "format": "uuid",
      "description": "Ledger"
     },
     "rou_asset_account_id": {
      "type": "string",
      "format": "uuid",
      "description": "Right-of-use asset account"
     },
     "liability_account_id": {
      "type": "string",
      "format": "uuid",
      "description": "Lease liability account"
     },
     "interest_account_id": {
      "type": "string",
      "format": "uuid",
      "description": "Interest account"
     },
     "depreciation_account_id": {
      "type": "string",
      "format": "uuid",
      "description": "Depreciation account"
     },
     "rent_expense_account_id": {
      "type": "string",
      "format": "uuid",
      "description": "Rent expense account"
     },
     "cost_center_id": {
      "type": "string",
      "format": "uuid",
      "description": "Cost center"
     },
     "status": {
      "type": "string",
      "description": "Status",
      "readOnly": true
     },
     "version": {
      "type": "integer",
      "description": "Version",
      "readOnly": true
     },
     "contract_ref": {
      "type": "string",
      "description": "Contract reference"
     },
     "document_url": {
      "type": "string",
      "description": "Document"
     },
     "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/leases": {
   "get": {
    "summary": "list leases",
    "operationId": "list_leases_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create leases",
    "operationId": "create_leases_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/leases/{id}": {
   "get": {
    "summary": "get leases",
    "operationId": "get_leases_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change leases",
    "operationId": "change_leases_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete leases",
    "operationId": "delete_leases_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/leases/maturity": {
   "get": {
    "summary": "Maturity",
    "operationId": "action_leases_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/leases/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_leases_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/leases/{id}/classify": {
   "get": {
    "summary": "Classify",
    "operationId": "action_leases_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/leases/{id}/commence": {
   "post": {
    "summary": "Commence",
    "operationId": "action_leases_0_6",
    "description": "Body keys: post, rouAccountNo, liabilityAccountNo, cashAccountNo",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/leases/{id}/remeasure": {
   "post": {
    "summary": "Remeasure",
    "operationId": "action_leases_0_6",
    "description": "Body keys: eventType, effectiveDate, newPayment, newTermMonths, newRatePct, reason, scopeReductionPct; eventType one of commencement|remeasurement|modification|index_review|option_exercised|option_lapsed|termination|impairment|transfer|expiry|reassessment",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/leases/run": {
   "post": {
    "summary": "Run",
    "operationId": "action_leases_0_5",
    "description": "Body keys: ledgerId, periodCode, isTestRun",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/leases/what-if": {
   "post": {
    "summary": "What if",
    "operationId": "action_leases_0_5",
    "description": "Body keys: payment, termMonths, ratePct, frequency, timing, escalationPct, escalationMonths, initialDirectCosts, incentives, standard",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/leases/{parentId}/components": {
   "get": {
    "summary": "Components",
    "operationId": "action_leases_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "Components",
    "operationId": "action_leases_1_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/leases/{parentId}/components/{lineId}": {
   "put": {
    "summary": "Components",
    "operationId": "action_leases_0_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "Components",
    "operationId": "action_leases_1_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/leases/{parentId}/schedule": {
   "get": {
    "summary": "Schedule",
    "operationId": "action_leases_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_leases_1_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/leases/{parentId}/schedule/{lineId}": {
   "put": {
    "summary": "Schedule",
    "operationId": "action_leases_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_leases_1_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}