{
 "openapi": "3.1.0",
 "info": {
  "title": "Service Accounts (CRM)",
  "version": "20261030b",
  "description": "A customer's utility account: class, cycle, contact, paperless and autopay, the life-support flag, and the deposit and credit the utility holds. Open one for its 360 view."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "util-accounts": {
    "type": "object",
    "required": [
     "account_no",
     "customer_account_id"
    ],
    "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
     },
     "account_no": {
      "type": "string",
      "description": "Account no"
     },
     "customer_account_id": {
      "type": "string",
      "format": "uuid",
      "description": "Customer"
     },
     "contact_id": {
      "type": "string",
      "format": "uuid",
      "description": "Contact id"
     },
     "account_class": {
      "type": "string",
      "description": "Class",
      "enum": [
       "residential",
       "commercial",
       "industrial",
       "municipal",
       "institutional"
      ]
     },
     "status": {
      "type": "string",
      "description": "Status",
      "readOnly": true
     },
     "billing_cycle_id": {
      "type": "string",
      "format": "uuid",
      "description": "Billing cycle"
     },
     "mailing_address": {
      "type": "string",
      "description": "Mailing address"
     },
     "email": {
      "type": "string",
      "description": "Email"
     },
     "phone": {
      "type": "string",
      "description": "Telephone"
     },
     "language": {
      "type": "string",
      "description": "Language"
     },
     "paperless": {
      "type": "boolean",
      "description": "Paperless billing"
     },
     "autopay": {
      "type": "boolean",
      "description": "Autopay",
      "readOnly": true
     },
     "life_support": {
      "type": "boolean",
      "description": "Life support / critical care"
     },
     "life_support_note": {
      "type": "string",
      "description": "Life support note"
     },
     "deposit_held": {
      "type": "string",
      "format": "decimal",
      "description": "Deposit held",
      "readOnly": true
     },
     "credit_balance": {
      "type": "string",
      "format": "decimal",
      "description": "Credit balance",
      "readOnly": true
     },
     "collection_hold_until": {
      "type": "string",
      "format": "date",
      "description": "Hold collections until"
     },
     "opened_on": {
      "type": "string",
      "format": "date",
      "description": "Opened on",
      "readOnly": true
     },
     "closed_on": {
      "type": "string",
      "format": "date",
      "description": "Closed on",
      "readOnly": true
     },
     "notes": {
      "type": "string",
      "description": "Notes"
     },
     "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
     },
     "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-accounts": {
   "get": {
    "summary": "list util-accounts",
    "operationId": "list_util_accounts_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-accounts",
    "operationId": "create_util_accounts_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/crm/util-accounts/{id}": {
   "get": {
    "summary": "get util-accounts",
    "operationId": "get_util_accounts_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-accounts",
    "operationId": "change_util_accounts_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-accounts",
    "operationId": "delete_util_accounts_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/crm/util-accounts/create": {
   "post": {
    "summary": "Create",
    "operationId": "action_util_accounts_0_5",
    "description": "Body keys: customer_name, name, customer_account_id, account_class, email, phone, address_line1, city, region, postal_code, billing_cycle_id, mailing_address, language, paperless, life_support, life_support_note, notes; account_class one of residential|commercial|industrial|municipal|institutional",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/crm/util-accounts/{id}/overview": {
   "get": {
    "summary": "Overview",
    "operationId": "action_util_accounts_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/crm/util-accounts/{id}/start-service": {
   "post": {
    "summary": "Start service",
    "operationId": "action_util_accounts_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/crm/util-accounts/{id}/stop-service": {
   "post": {
    "summary": "Stop service",
    "operationId": "action_util_accounts_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/crm/util-accounts/{id}/transfer": {
   "post": {
    "summary": "Transfer",
    "operationId": "action_util_accounts_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/crm/util-accounts/{id}/close": {
   "post": {
    "summary": "Close",
    "operationId": "action_util_accounts_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/crm/util-accounts/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_util_accounts_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"
     }
    }
   }
  }
 }
}