{
 "openapi": "3.1.0",
 "info": {
  "title": "Assistant Suggestions (Accounting)",
  "version": "20261030b",
  "description": "Suggestion rather than detection, with the reasoning attached. \"Because the last nine invoices from this supplier were coded 6410\" is a reason a person can check; a confidence score is not."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "ai-suggestions": {
    "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
     },
     "suggestion_type": {
      "type": "string",
      "description": "Suggestion type",
      "readOnly": true
     },
     "document_type": {
      "type": "string",
      "description": "Document type",
      "readOnly": true
     },
     "document_id": {
      "type": "string",
      "format": "uuid",
      "description": "Document id",
      "readOnly": true
     },
     "document_no": {
      "type": "string",
      "description": "Document no",
      "readOnly": true
     },
     "line_no": {
      "type": "integer",
      "description": "Line no",
      "readOnly": true
     },
     "suggestion": {
      "type": "object",
      "description": "Suggestion",
      "readOnly": true
     },
     "suggested_text": {
      "type": "string",
      "description": "Suggested text",
      "readOnly": true
     },
     "confidence": {
      "type": "string",
      "format": "decimal",
      "description": "Confidence",
      "readOnly": true
     },
     "reasoning": {
      "type": "string",
      "description": "Reasoning",
      "readOnly": true
     },
     "basis": {
      "type": "object",
      "description": "Basis",
      "readOnly": true
     },
     "alternatives": {
      "type": "object",
      "description": "Alternatives",
      "readOnly": true
     },
     "model": {
      "type": "string",
      "description": "Model",
      "readOnly": true
     },
     "model_version": {
      "type": "string",
      "description": "Model version",
      "readOnly": true
     },
     "status": {
      "type": "string",
      "description": "Status"
     },
     "accepted_by": {
      "type": "string",
      "format": "uuid",
      "description": "Accepted by",
      "readOnly": true
     },
     "decided_at": {
      "type": "string",
      "format": "date-time",
      "description": "Decided at",
      "readOnly": true
     },
     "actual_value": {
      "type": "object",
      "description": "Actual value",
      "readOnly": true
     },
     "was_correct": {
      "type": "boolean",
      "description": "Was correct",
      "readOnly": true
     },
     "feedback": {
      "type": "string",
      "description": "Feedback"
     },
     "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
     },
     "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/ai-suggestions": {
   "get": {
    "summary": "list ai-suggestions",
    "operationId": "list_ai_suggestions_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create ai-suggestions",
    "operationId": "create_ai_suggestions_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/ai-suggestions/{id}": {
   "get": {
    "summary": "get ai-suggestions",
    "operationId": "get_ai_suggestions_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change ai-suggestions",
    "operationId": "change_ai_suggestions_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete ai-suggestions",
    "operationId": "delete_ai_suggestions_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/accounting/ai-suggestions/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_ai_suggestions_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"
     }
    }
   }
  }
 }
}