{
  "openapi": "3.0.0",
  "info": {
    "title": "Transaction API",
    "version": "2.0.0"
  },
  "servers": [
    {
      "url": "https://api.production.de.insiders.cloud/1/rest"
    }
  ],
  "paths": {
    "/subsystems/transactions/": {
      "post": {
        "operationId": "BeginTransaction",
        "requestBody": {
          "x-name": "request",
          "content": {
            "application/json": {
              "schema": {
                "nullable": false,
                "$ref": "#/components/schemas/BeginTransactionRequest"
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "400": {
            "description": ""
          },
          "403": {
            "description": ""
          },
          "500": {
            "description": ""
          },
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BeginTransactionResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": []
          }
        ]
      }
    },
    "/subsystems/transactions/{transactionId}/commit": {
      "delete": {
        "operationId": "Commit",
        "parameters": [
          {
            "name": "transactionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "x-position": 1
          }
        ],
        "responses": {
          "400": {
            "description": ""
          },
          "403": {
            "description": ""
          },
          "500": {
            "description": ""
          },
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "token": []
          }
        ]
      }
    },
    "/subsystems/transactions/{transactionId}/{tablename}": {
      "put": {
        "operationId": "WriteData",
        "parameters": [
          {
            "name": "transactionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "x-position": 1
          },
          {
            "name": "tablename",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "x-position": 2
          }
        ],
        "requestBody": {
          "x-name": "body",
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "nullable": false,
                "items": {
                  "type": "array",
                  "items": {}
                }
              }
            }
          },
          "required": true,
          "x-position": 3
        },
        "responses": {
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WriteDataResponse"
                }
              }
            }
          },
          "403": {
            "description": ""
          },
          "500": {
            "description": ""
          },
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WriteDataResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": []
          }
        ]
      }
    },
    "/subsystems/transactions/{transactionId}/rollback": {
      "delete": {
        "operationId": "Rollback",
        "parameters": [
          {
            "name": "transactionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "x-position": 1
          }
        ],
        "responses": {
          "400": {
            "description": ""
          },
          "403": {
            "description": ""
          },
          "500": {
            "description": ""
          },
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "token": []
          }
        ]
      }
    },
    "/subsystems/transactions/{transactionId}/status": {
      "get": {
        "operationId": "Status",
        "parameters": [
          {
            "name": "transactionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "x-position": 1
          }
        ],
        "responses": {
          "400": {
            "description": ""
          },
          "403": {
            "description": ""
          },
          "404": {
            "description": ""
          },
          "500": {
            "description": ""
          },
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetTransactionStatusResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": []
          }
        ]
      }
    },
    "/subsystems/transactions/{transactionId}/{tablename}/deletedata": {
      "post": {
        "operationId": "DeleteData",
        "parameters": [
          {
            "name": "transactionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "x-position": 1
          },
          {
            "name": "tablename",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "x-position": 2
          }
        ],
        "requestBody": {
          "x-name": "body",
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "nullable": false,
                "items": {
                  "type": "array",
                  "items": {}
                }
              }
            }
          },
          "required": true,
          "x-position": 3
        },
        "responses": {
          "400": {
            "description": ""
          },
          "403": {
            "description": ""
          },
          "500": {
            "description": ""
          },
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteDataResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": []
          }
        ]
      }
    },
    "/subsystems/transactions/reencrypt": {
      "post": {
        "operationId": "Reencrypt",
        "requestBody": {
          "x-name": "request",
          "content": {
            "application/json": {
              "schema": {
                "nullable": false,
                "$ref": "#/components/schemas/ReencryptRequest"
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "400": {
            "description": ""
          },
          "403": {
            "description": ""
          },
          "500": {
            "description": ""
          },
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReencryptResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": []
          }
        ]
      }
    },
    "/subsystems/transactions/reencrypt/{transactionId}/{tenantId}": {
      "get": {
        "operationId": "GetReencryptStatus",
        "parameters": [
          {
            "name": "transactionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "x-position": 1
          },
          {
            "name": "tenantId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "x-position": 2
          }
        ],
        "responses": {
          "400": {
            "description": ""
          },
          "403": {
            "description": ""
          },
          "404": {
            "description": ""
          },
          "500": {
            "description": ""
          },
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetReencryptStatusResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": []
          }
        ]
      }
    },
    "/subsystems/transactions/version": {
      "get": {
        "operationId": "GetVersion",
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetVersionResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "BeginTransactionRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "subsystem",
          "tableMetaData"
        ],
        "properties": {
          "subsystem": {
            "type": "string"
          },
          "tableMetaData": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TableMetaData"
            }
          },
          "commitStrategy": {
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/CommitStrategy"
              }
            ]
          }
        }
      },
      "TableMetaData": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "columns",
          "tableName",
          "clear"
        ],
        "properties": {
          "columns": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "tableName": {
            "type": "string"
          },
          "clear": {
            "type": "boolean"
          }
        }
      },
      "CommitStrategy": {
        "type": "string",
        "description": "",
        "enum": [
          "BestEffort",
          "RollbackOnPrimaryKeyErrors"
        ]
      },
      "BeginTransactionResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "transactionId"
        ],
        "properties": {
          "transactionId": {
            "type": "string"
          }
        }
      },
      "WriteDataResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MasterDataError"
            }
          }
        }
      },
      "MasterDataError": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "index": {
            "type": "integer",
            "format": "int32"
          },
          "error": {
            "type": "string"
          }
        }
      },
      "GetTransactionStatusResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "TransactionState",
          "ImportJob"
        ],
        "properties": {
          "TransactionState": {
            "$ref": "#/components/schemas/TransactionProcessState"
          },
          "ImportJob": {
            "$ref": "#/components/schemas/AsyncTransactionInfo"
          }
        }
      },
      "TransactionProcessState": {
        "type": "string",
        "description": "",
        "enum": [
          "ReceivingData",
          "WaitingForImport",
          "Importing",
          "Finished",
          "RolledBack",
          "Failed",
          "Unknown"
        ]
      },
      "AsyncTransactionInfo": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "Id": {
            "type": "string"
          },
          "Messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AsyncTransactionMessage"
            }
          }
        }
      },
      "AsyncTransactionMessage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "Timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "Message": {
            "type": "string"
          },
          "Type": {
            "type": "string"
          }
        }
      },
      "DeleteDataResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MasterDataError"
            }
          }
        }
      },
      "ReencryptRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "tenantId",
          "subsystem"
        ],
        "properties": {
          "tenantId": {
            "type": "string"
          },
          "subsystem": {
            "type": "string"
          }
        }
      },
      "ReencryptResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "transactionId"
        ],
        "properties": {
          "transactionId": {
            "type": "string"
          }
        }
      },
      "GetReencryptStatusResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "state",
          "reencryptedTables",
          "getsReencrypted",
          "tablesToReencrypt",
          "error",
          "modified"
        ],
        "properties": {
          "state": {
            "type": "string"
          },
          "reencryptedTables": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "getsReencrypted": {
            "type": "string"
          },
          "tablesToReencrypt": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "error": {
            "type": "string"
          },
          "modified": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        }
      },
      "GetVersionResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "Major": {
            "type": "string"
          },
          "Minor": {
            "type": "string"
          },
          "Patch": {
            "type": "string"
          },
          "Commit": {
            "type": "string"
          },
          "Version": {
            "type": "string"
          }
        }
      }
    },
    "securitySchemes": {
      "token": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  }
}