{
 "openapi": "3.1.0",
 "info": {
  "title": "Utility Settings (CRM)",
  "version": "20261030b",
  "description": "The company's own numbers: grace and notice days, the late fee, the reconnect fee, deposits, read checks, the ledger accounts, and whether the public forms are open. One row; the shipped defaults apply until it is saved."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "util-settings": {
    "type": "object",
    "required": [],
    "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
     },
     "grace_days": {
      "type": "integer",
      "description": "Grace days before a late fee"
     },
     "notice_days": {
      "type": "integer",
      "description": "Past-due notice after (days)"
     },
     "final_notice_days": {
      "type": "integer",
      "description": "Final notice after (days)"
     },
     "disconnect_days": {
      "type": "integer",
      "description": "Propose disconnection after (days)"
     },
     "late_fee_flat": {
      "type": "string",
      "format": "decimal",
      "description": "Late fee (flat)"
     },
     "late_fee_pct": {
      "type": "string",
      "format": "decimal",
      "description": "Late fee (% of past due)"
     },
     "late_fee_min_balance": {
      "type": "string",
      "format": "decimal",
      "description": "No late fee below"
     },
     "reconnect_fee": {
      "type": "string",
      "format": "decimal",
      "description": "Reconnect fee"
     },
     "deposit_residential": {
      "type": "string",
      "format": "decimal",
      "description": "Deposit, residential"
     },
     "deposit_commercial": {
      "type": "string",
      "format": "decimal",
      "description": "Deposit, commercial"
     },
     "high_usage_pct": {
      "type": "integer",
      "description": "High-use exception above (% of average)"
     },
     "low_usage_pct": {
      "type": "integer",
      "description": "Low-use exception below (% of average)"
     },
     "bill_due_days": {
      "type": "integer",
      "description": "Bills due in (days)"
     },
     "revenue_account_no": {
      "type": "string",
      "description": "Utility revenue account"
     },
     "deposit_account_no": {
      "type": "string",
      "description": "Customer deposits account"
     },
     "credit_account_no": {
      "type": "string",
      "description": "Customer credit balances account"
     },
     "bad_debt_account_no": {
      "type": "string",
      "description": "Bad debt account"
     },
     "public_forms_enabled": {
      "type": "boolean",
      "description": "Take start-service and problem reports from the public"
     },
     "portal_link_factor": {
      "type": "string",
      "description": "Portal sign-up proves the bill by",
      "enum": [
       "either",
       "last_bill_amount",
       "postal_code"
      ]
     },
     "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
     },
     "receivable_account_no": {
      "type": "string",
      "description": "Utility receivable account"
     },
     "cash_account_no": {
      "type": "string",
      "description": "Utility cash / lockbox account"
     },
     "service_charge_account_no": {
      "type": "string",
      "description": "Service (customer) charge account"
     },
     "late_fee_account_no": {
      "type": "string",
      "description": "Late fee account"
     },
     "reconnect_fee_account_no": {
      "type": "string",
      "description": "Connection and reconnection fee account"
     },
     "leak_adjustment_account_no": {
      "type": "string",
      "description": "Leak adjustment account"
     },
     "cost_center_id": {
      "type": "string",
      "format": "uuid",
      "description": "Utility cost center"
     },
     "leak_max_per_year": {
      "type": "integer",
      "description": "Leak adjustments per account in 12 months"
     },
     "leak_method": {
      "type": "string",
      "description": "Leak credit method",
      "enum": [
       "excess_lowest_tier",
       "excess_waived"
      ]
     },
     "leak_requires_approval": {
      "type": "boolean",
      "description": "A second person approves each leak adjustment"
     },
     "leak_history_bills": {
      "type": "integer",
      "description": "Normal use: average of the last (bills)"
     },
     "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
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/api/crm/util-settings": {
   "get": {
    "summary": "list util-settings",
    "operationId": "list_util_settings_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create util-settings",
    "operationId": "create_util_settings_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/crm/util-settings/{id}": {
   "get": {
    "summary": "get util-settings",
    "operationId": "get_util_settings_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change util-settings",
    "operationId": "change_util_settings_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete util-settings",
    "operationId": "delete_util_settings_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/crm/util-settings/{id}/ledger-changes": {
   "get": {
    "summary": "Ledger changes",
    "operationId": "action_util_settings_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/crm/util-settings/{id}/ledger-change": {
   "post": {
    "summary": "Ledger change",
    "operationId": "action_util_settings_0_6",
    "description": "Body keys: changeId, decision",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/crm/util-settings/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_util_settings_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"
     }
    }
   }
  }
 }
}