{
 "openapi": "3.0.1",
 "info": {
  "title": "RevexOne public API",
  "description": "The routes RevexOne keeps stable for integrations. Every call needs a sign-in token and keeps the caller's rights, organization, reach and pay rule; agent logins never approve.",
  "version": "1.0"
 },
 "paths": {
  "/api/account": {
   "get": {
    "tags": [
     "Sign in"
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "text/plain": {
        "schema": {
         "$ref": "#/components/schemas/Commissions.Dto.UserDto"
        }
       },
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Commissions.Dto.UserDto"
        }
       },
       "text/json": {
        "schema": {
         "$ref": "#/components/schemas/Commissions.Dto.UserDto"
        }
       }
      }
     }
    },
    "summary": "Who the token belongs to: login, organization, roles and language",
    "description": "Who the token belongs to: login, organization, roles and language.",
    "x-who-may-call": "Any signed-in login",
    "x-agent-login": "may call"
   }
  },
  "/api/approvals": {
   "get": {
    "tags": [
     "Approvals"
    ],
    "parameters": [
     {
      "name": "status",
      "in": "query",
      "schema": {
       "type": "string",
       "default": "PENDING"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "summary": "The organization's items: PENDING by default; ?status=APPROVED, REJECTED, SUPERSEDED, or ALL (latest 200)",
    "description": "The organization's items: PENDING by default; ?status=APPROVED, REJECTED, SUPERSEDED, or ALL (latest 200).",
    "x-who-may-call": "The rights of the login; rows inside its reach; pay by the pay rule",
    "x-agent-login": "may call"
   }
  },
  "/api/approvals/{id}/approve": {
   "post": {
    "tags": [
     "Approvals"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer",
       "format": "int64"
      }
     }
    ],
    "requestBody": {
     "content": {
      "application/json-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/ApprovalsController.DecisionDto"
       }
      },
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ApprovalsController.DecisionDto"
       }
      },
      "text/json": {
       "schema": {
        "$ref": "#/components/schemas/ApprovalsController.DecisionDto"
       }
      },
      "application/*+json": {
       "schema": {
        "$ref": "#/components/schemas/ApprovalsController.DecisionDto"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "summary": "An approver on the open step approves the item: { note, approvalMode }",
    "description": "An approver on the open step approves the item: { note, approvalMode }. A person only; an agent login never decides.",
    "x-who-may-call": "The people asked at the open step (a person; never an agent login)",
    "x-agent-login": "people only"
   }
  },
  "/api/approvals/{id}/reject": {
   "post": {
    "tags": [
     "Approvals"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer",
       "format": "int64"
      }
     }
    ],
    "requestBody": {
     "content": {
      "application/json-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/ApprovalsController.DecisionDto"
       }
      },
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ApprovalsController.DecisionDto"
       }
      },
      "text/json": {
       "schema": {
        "$ref": "#/components/schemas/ApprovalsController.DecisionDto"
       }
      },
      "application/*+json": {
       "schema": {
        "$ref": "#/components/schemas/ApprovalsController.DecisionDto"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "summary": "An approver on the open step rejects the item: { note }",
    "description": "An approver on the open step rejects the item: { note }. A person only; an agent login never decides.",
    "x-who-may-call": "The people asked at the open step (a person; never an agent login)",
    "x-agent-login": "people only"
   }
  },
  "/api/approvals/{id}/send-back": {
   "post": {
    "tags": [
     "Approvals"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer",
       "format": "int64"
      }
     }
    ],
    "requestBody": {
     "content": {
      "application/json-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/ApprovalsController.DecisionDto"
       }
      },
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ApprovalsController.DecisionDto"
       }
      },
      "text/json": {
       "schema": {
        "$ref": "#/components/schemas/ApprovalsController.DecisionDto"
       }
      },
      "application/*+json": {
       "schema": {
        "$ref": "#/components/schemas/ApprovalsController.DecisionDto"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "summary": "An approver on the open step sends the item back to the person who asked, saying what must change",
    "description": "An approver on the open step sends the item back to the person who asked, saying what must change. The record is not changed; sent again, the same workflow starts over at its first step.",
    "x-who-may-call": "The people asked at the open step (a person; never an agent login)",
    "x-agent-login": "people only"
   }
  },
  "/api/approvals/{id}/trail": {
   "get": {
    "tags": [
     "Approvals"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer",
       "format": "int64"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "summary": "The workflow trail of an item: steps done with who, when and how they were found, the open step and its holders, the ste",
    "description": "The workflow trail of an item: steps done with who, when and how they were found, the open step and its holders, the steps to come, and the monitor's actions. For the person who asked, the people named on any of its steps, those who may decide its kind of item, and the monitor's viewers.",
    "x-who-may-call": "The rights of the login; rows inside its reach; pay by the pay rule",
    "x-agent-login": "may call"
   }
  },
  "/api/authenticate": {
   "post": {
    "tags": [
     "Sign in"
    ],
    "requestBody": {
     "content": {
      "application/json-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/Commissions.Dto.Authentication.LoginDto"
       }
      },
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Commissions.Dto.Authentication.LoginDto"
       }
      },
      "text/json": {
       "schema": {
        "$ref": "#/components/schemas/Commissions.Dto.Authentication.LoginDto"
       }
      },
      "application/*+json": {
       "schema": {
        "$ref": "#/components/schemas/Commissions.Dto.Authentication.LoginDto"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "summary": "Signs in: { email, password }; answers with id_token, the bearer token for every other call",
    "description": "Signs in: { email, password }; answers with id_token, the bearer token for every other call.",
    "x-who-may-call": "Any login (a person's or an agent login's)",
    "x-agent-login": "may call"
   }
  },
  "/api/plan-engine/monitor/runs": {
   "get": {
    "tags": [
     "Runs"
    ],
    "parameters": [
     {
      "name": "plan",
      "in": "query",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "period",
      "in": "query",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "status",
      "in": "query",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "type",
      "in": "query",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "who",
      "in": "query",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "from",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "date-time"
      }
     },
     {
      "name": "to",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "date-time"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "summary": "All calculation runs (newest first, up to 500), with optional filters: plan, period, status, type, who, from, to (dates)",
    "description": "All calculation runs (newest first, up to 500), with optional filters: plan, period, status, type, who, from, to (dates).",
    "x-who-may-call": "The rights of the login; rows inside its reach; pay by the pay rule",
    "x-agent-login": "may call"
   }
  },
  "/api/plan-engine/monitor/runs/{runId}/breakdown": {
   "get": {
    "tags": [
     "Runs"
    ],
    "parameters": [
     {
      "name": "runId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer",
       "format": "int64"
      }
     },
     {
      "name": "by",
      "in": "query",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "level",
      "in": "query",
      "schema": {
       "type": "integer",
       "format": "int32"
      }
     },
     {
      "name": "filterBy",
      "in": "query",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "filterKey",
      "in": "query",
      "schema": {
       "type": "integer",
       "format": "int64"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "summary": "One run broken down: by EMPLOYEE, TEAM, TERRITORY (level: roll up to that hierarchy level) or RULE; filterBy (TEAM, TERR",
    "description": "One run broken down: by EMPLOYEE, TEAM, TERRITORY (level: roll up to that hierarchy level) or RULE; filterBy (TEAM, TERRITORY, RULE, EMPLOYEE) + filterKey narrow it first (drill-down).",
    "x-who-may-call": "The rights of the login; rows inside its reach; pay by the pay rule",
    "x-agent-login": "may call"
   }
  },
  "/api/plan-engine/monitor/runs/{runId}/proof": {
   "get": {
    "tags": [
     "Runs"
    ],
    "parameters": [
     {
      "name": "runId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer",
       "format": "int64"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "summary": "A run's proof: every sale accounted for, lines = seats = blocks = total, each rate line's arithmetic re-done, payees, ro",
    "description": "A run's proof: every sale accounted for, lines = seats = blocks = total, each rate line's arithmetic re-done, payees, rounding; at posting: before + now = period = ledger = dashboards, and who ran and who approved it.",
    "x-who-may-call": "The rights of the login; rows inside its reach; pay by the pay rule",
    "x-agent-login": "may call"
   }
  },
  "/api/plan-engine/payees": {
   "get": {
    "tags": [
     "Payees and pay"
    ],
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "summary": "The payee listing",
    "description": "The payee listing.",
    "x-who-may-call": "The rights of the login; rows inside its reach; pay by the pay rule",
    "x-agent-login": "may call"
   }
  },
  "/api/plan-engine/payees/{partnerId}": {
   "get": {
    "tags": [
     "Payees and pay"
    ],
    "parameters": [
     {
      "name": "partnerId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer",
       "format": "int64"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "summary": "One payee's register",
    "description": "One payee's register.",
    "x-who-may-call": "The rights of the login; rows inside its reach; pay by the pay rule",
    "x-agent-login": "may call"
   }
  },
  "/api/plan-engine/payees/{partnerId}/statements": {
   "get": {
    "tags": [
     "Payees and pay"
    ],
    "parameters": [
     {
      "name": "partnerId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer",
       "format": "int64"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "summary": "Statement level 1: every pay run that paid the payee",
    "description": "Statement level 1: every pay run that paid the payee.",
    "x-who-may-call": "The payee, their manager, pay roles",
    "x-agent-login": "may call"
   }
  },
  "/api/plan-engine/payees/{partnerId}/statements/{lineId}/lines": {
   "get": {
    "tags": [
     "Payees and pay"
    ],
    "parameters": [
     {
      "name": "partnerId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer",
       "format": "int64"
      }
     },
     {
      "name": "lineId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer",
       "format": "int64"
      }
     },
     {
      "name": "component",
      "in": "query",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "format": "int32"
      }
     },
     {
      "name": "offset",
      "in": "query",
      "schema": {
       "type": "integer",
       "format": "int32"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "summary": "Statement level 3: the transactions behind a payment (optionally one component), paged (limit up to 1,000)",
    "description": "Statement level 3: the transactions behind a payment (optionally one component), paged (limit up to 1,000).",
    "x-who-may-call": "The payee, their manager, pay roles",
    "x-agent-login": "may call"
   }
  },
  "/api/plan-engine/payments/runs": {
   "get": {
    "tags": [
     "Payees and pay"
    ],
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "summary": "The organization's payment runs, newest first",
    "description": "The organization's payment runs, newest first.",
    "x-who-may-call": "The rights of the login; rows inside its reach; pay by the pay rule",
    "x-agent-login": "may call"
   }
  },
  "/api/plan-engine/payments/runs/{id}": {
   "get": {
    "tags": [
     "Payees and pay"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer",
       "format": "int64"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "summary": "One payment run with its lines, holds and checks",
    "description": "One payment run with its lines, holds and checks.",
    "x-who-may-call": "The rights of the login; rows inside its reach; pay by the pay rule",
    "x-agent-login": "may call"
   }
  },
  "/api/plan-engine/payments/runs/{id}/lines/{lineId}/trace": {
   "get": {
    "tags": [
     "Payees and pay"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer",
       "format": "int64"
      }
     },
     {
      "name": "lineId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer",
       "format": "int64"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "summary": "The ledger lines one payment line pays (plan, period, seat, kind, amount)",
    "description": "The ledger lines one payment line pays (plan, period, seat, kind, amount).",
    "x-who-may-call": "The rights of the login; rows inside its reach; pay by the pay rule",
    "x-agent-login": "may call"
   }
  },
  "/api/plan-engine/plans": {
   "get": {
    "tags": [
     "Plans"
    ],
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "summary": "The organization's plans and their versions",
    "description": "The organization's plans and their versions.",
    "x-who-may-call": "The rights of the login; rows inside its reach; pay by the pay rule",
    "x-agent-login": "may call"
   }
  },
  "/api/plan-engine/plans/{code}/versions/{no}/document": {
   "get": {
    "tags": [
     "Plans"
    ],
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "no",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer",
       "format": "int32"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "summary": "A version as the document it was saved from (codes, not IDs) — what the plan builder edits",
    "description": "A version as the document it was saved from (codes, not IDs) — what the plan builder edits.",
    "x-who-may-call": "The rights of the login; rows inside its reach; pay by the pay rule",
    "x-agent-login": "may call"
   }
  },
  "/api/plan-engine/plans/{code}/versions/{no}/periods": {
   "get": {
    "tags": [
     "Plans"
    ],
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "no",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer",
       "format": "int32"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "summary": "The pay periods a version runs in, with what the latest run of each did",
    "description": "The pay periods a version runs in, with what the latest run of each did.",
    "x-who-may-call": "The rights of the login; rows inside its reach; pay by the pay rule",
    "x-agent-login": "may call"
   }
  },
  "/api/plan-engine/plans/{code}/versions/{no}/results": {
   "get": {
    "tags": [
     "Plans"
    ],
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "no",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer",
       "format": "int32"
      }
     },
     {
      "name": "period",
      "in": "query",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "test",
      "in": "query",
      "schema": {
       "type": "boolean",
       "default": false
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "summary": "Per seat results of a pay period (latest runs): holder, attainment, amount by block, total",
    "description": "Per seat results of a pay period (latest runs): holder, attainment, amount by block, total.",
    "x-who-may-call": "The rights of the login; rows inside its reach; pay by the pay rule",
    "x-agent-login": "may call"
   }
  },
  "/api/plan-engine/plans/{code}/versions/{no}/runs": {
   "post": {
    "tags": [
     "Runs"
    ],
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "no",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer",
       "format": "int32"
      }
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "period": {
          "type": "string",
          "description": "The pay period, e.g. FY2027-Q1"
         },
         "runType": {
          "type": "string",
          "description": "TEST (posts nothing) or FULL (posts after a person approves)"
         },
         "scope": {
          "type": "string",
          "description": "ALL or CHANGED (only the seats touched since the last posted run)"
         },
         "wait": {
          "type": "boolean",
          "description": "false: answer at once with requestId and poll run-requests/{id}"
         }
        }
       }
      }
     },
     "required": true
    },
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "summary": "Runs a compiled version for a pay period: { \"period\": \"FY2027-Q1\", \"runType\": \"TEST\" | \"FULL\", \"scope\": \"ALL\" | \"CHANGED",
    "description": "Runs a compiled version for a pay period: { \"period\": \"FY2027-Q1\", \"runType\": \"TEST\" | \"FULL\", \"scope\": \"ALL\" | \"CHANGED\" }. CHANGED (incremental) re-runs only the seats touched since the period's last posted run; the result's scope says which and why when it ran every seat.",
    "x-who-may-call": "Run right; a full run posts only after a person approves it",
    "x-agent-login": "may call"
   }
  },
  "/api/plan-engine/run-requests/{id}": {
   "get": {
    "tags": [
     "Runs"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer",
       "format": "int64"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "summary": "A queued run: status (QUEUED, RUNNING, DONE, FAILED), origin, cause, job, and its result or error",
    "description": "A queued run: status (QUEUED, RUNNING, DONE, FAILED), origin, cause, job, and its result or error.",
    "x-who-may-call": "The rights of the login; rows inside its reach; pay by the pay rule",
    "x-agent-login": "may call"
   }
  },
  "/api/reports": {
   "get": {
    "tags": [
     "Reports"
    ],
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "summary": "The report areas and the reports the caller may open, in order",
    "description": "The report areas and the reports the caller may open, in order.",
    "x-who-may-call": "The rights of the login; rows inside its reach; pay by the pay rule",
    "x-agent-login": "may call"
   }
  },
  "/api/reports/{code}": {
   "get": {
    "tags": [
     "Reports"
    ],
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "summary": "One report's inputs, columns and default view (charts, grouping, pivot)",
    "description": "One report's inputs, columns and default view (charts, grouping, pivot).",
    "x-who-may-call": "The rights of the login; rows inside its reach; pay by the pay rule",
    "x-agent-login": "may call"
   }
  },
  "/api/reports/{code}/run": {
   "post": {
    "tags": [
     "Reports"
    ],
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "content": {
      "application/json-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/ReportsController.RunRequest"
       }
      },
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/ReportsController.RunRequest"
       }
      },
      "text/json": {
       "schema": {
        "$ref": "#/components/schemas/ReportsController.RunRequest"
       }
      },
      "application/*+json": {
       "schema": {
        "$ref": "#/components/schemas/ReportsController.RunRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "summary": "Runs a report with the inputs given (only the report's own inputs are read) inside the caller's reach",
    "description": "Runs a report with the inputs given (only the report's own inputs are read) inside the caller's reach.",
    "x-who-may-call": "The rights of the login; rows inside its reach; pay by the pay rule",
    "x-agent-login": "may call"
   }
  },
  "/api/uploads/catalogue": {
   "get": {
    "tags": [
     "Send in data"
    ],
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "summary": "The catalogue: the organization's settings, then each group's objects with what the organization chose",
    "description": "The catalogue: the organization's settings, then each group's objects with what the organization chose.",
    "x-who-may-call": "Upload or sales-load right",
    "x-agent-login": "may call"
   }
  },
  "/api/uploads/engine/batches/{id}": {
   "get": {
    "tags": [
     "Send in data"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer",
       "format": "int64"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "summary": "One upload with its counts, holds and the rows that need a look",
    "description": "One upload with its counts, holds and the rows that need a look.",
    "x-who-may-call": "Upload or sales-load right",
    "x-agent-login": "may call"
   }
  },
  "/api/uploads/engine/batches/{id}/load": {
   "post": {
    "tags": [
     "Send in data"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer",
       "format": "int64"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "summary": "Loads a checked upload; one that is held goes for approval instead (it loads when approved)",
    "description": "Loads a checked upload; one that is held goes for approval instead (it loads when approved).",
    "x-who-may-call": "Upload or sales-load right; a held batch waits for a person's approval",
    "x-agent-login": "may call"
   }
  },
  "/api/uploads/objects/{code}/check": {
   "post": {
    "tags": [
     "Send in data"
    ],
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "file": {
          "type": "string",
          "description": "The file's name"
         },
         "fingerprint": {
          "type": "string",
          "description": "A hash of the rows; the same file sent twice is caught"
         },
         "size": {
          "type": "integer",
          "description": "The file's size in bytes"
         },
         "headers": {
          "type": "array",
          "description": "The column headings, in the order of the published format"
         },
         "rows": {
          "type": "array",
          "description": "One object per row, keyed by heading"
         },
         "controlTotals": {
          "type": "object",
          "description": "Optional: totals the batch must agree with"
         }
        }
       }
      }
     },
     "required": true
    },
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "summary": "Checks a file with the object's published format: { file, fingerprint, size, headers, rows, controlTotals? }",
    "description": "Checks a file with the object's published format: { file, fingerprint, size, headers, rows, controlTotals? }. Nothing loads; the batch shows what would.",
    "x-who-may-call": "Upload right (master data) or sales-load right (sales)",
    "x-agent-login": "may call"
   }
  },
  "/api/uploads/objects/{code}/formats": {
   "get": {
    "tags": [
     "Send in data"
    ],
    "parameters": [
     {
      "name": "code",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "summary": "An object's format versions, newest first",
    "description": "An object's format versions, newest first.",
    "x-who-may-call": "Upload or sales-load right",
    "x-agent-login": "may call"
   }
  },
  "/api/v1/disputes": {
   "get": {
    "tags": [
     "Disputes"
    ],
    "parameters": [
     {
      "name": "scope",
      "in": "query",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "status",
      "in": "query",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "type",
      "in": "query",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "assignee",
      "in": "query",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "overdue",
      "in": "query",
      "schema": {
       "type": "boolean"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "summary": "Disputes: scope MINE (raised by me / about me), TEAM (managers: their team), QUEUE (the teams: all); filters status (com",
    "description": "Disputes: scope MINE (raised by me / about me), TEAM (managers: their team), QUEUE (the teams: all); filters status (comma list), type, assignee (e-mail, \"-\" = nobody, \"me\"), overdue.",
    "x-who-may-call": "The rights of the login; rows inside its reach; pay by the pay rule",
    "x-agent-login": "may call"
   },
   "post": {
    "tags": [
     "Disputes"
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "type": {
          "type": "string",
          "description": "The dispute type"
         },
         "title": {
          "type": "string"
         },
         "description": {
          "type": "string"
         },
         "amountClaimed": {
          "type": "number"
         },
         "currency": {
          "type": "string",
          "description": "ISO code"
         },
         "payeePartnerId": {
          "type": "integer",
          "description": "On behalf of another payee (needs the right)"
         },
         "planVersionId": {
          "type": "integer"
         },
         "periodId": {
          "type": "integer"
         },
         "positionId": {
          "type": "integer"
         },
         "eventId": {
          "type": "integer",
          "description": "The sale"
         },
         "earningId": {
          "type": "integer"
         },
         "paymentLineId": {
          "type": "integer"
         },
         "quotaRef": {
          "type": "string"
         },
         "subjectLabel": {
          "type": "string"
         },
         "draft": {
          "type": "boolean",
          "description": "Keep as a draft (an agent login's dispute is always a draft for a person to send)"
         }
        }
       }
      }
     },
     "required": true
    },
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "summary": "Raises a dispute: { type, title, description, amountClaimed, currency, payeePartnerId (on behalf), planVersionId, period",
    "description": "Raises a dispute: { type, title, description, amountClaimed, currency, payeePartnerId (on behalf), planVersionId, periodId, positionId, eventId, earningId, paymentLineId, quotaRef, subjectLabel, draft }.",
    "x-who-may-call": "The payee, or a role that raises disputes for others",
    "x-agent-login": "may call"
   }
  },
  "/api/v1/disputes/{id}": {
   "get": {
    "tags": [
     "Disputes"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer",
       "format": "int64"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "summary": "One dispute with its timeline, attachments and what the caller may do next",
    "description": "One dispute with its timeline, attachments and what the caller may do next.",
    "x-who-may-call": "The rights of the login; rows inside its reach; pay by the pay rule",
    "x-agent-login": "may call"
   }
  },
  "/api/v1/disputes/{id}/messages": {
   "post": {
    "tags": [
     "Disputes"
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer",
       "format": "int64"
      }
     }
    ],
    "requestBody": {
     "content": {
      "application/json-patch+json": {
       "schema": {
        "$ref": "#/components/schemas/DisputesController.TextDto"
       }
      },
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/DisputesController.TextDto"
       }
      },
      "text/json": {
       "schema": {
        "$ref": "#/components/schemas/DisputesController.TextDto"
       }
      },
      "application/*+json": {
       "schema": {
        "$ref": "#/components/schemas/DisputesController.TextDto"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK"
     }
    },
    "summary": "A message on the dispute (payee side or team; team notes may be internal)",
    "description": "A message on the dispute (payee side or team; team notes may be internal). A payee's answer to a question puts the dispute back in review.",
    "x-who-may-call": "People on the dispute (a person)",
    "x-agent-login": "people only"
   }
  }
 },
 "components": {
  "schemas": {
   "ApprovalsController.DecisionDto": {
    "type": "object",
    "properties": {
     "note": {
      "type": "string",
      "nullable": true
     },
     "approvalMode": {
      "type": "string",
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "Commissions.Dto.Authentication.LoginDto": {
    "required": [
     "email",
     "password",
     "rememberMe"
    ],
    "type": "object",
    "properties": {
     "email": {
      "maxLength": 50,
      "minLength": 1,
      "type": "string"
     },
     "password": {
      "maxLength": 100,
      "minLength": 4,
      "type": "string"
     },
     "rememberMe": {
      "type": "boolean"
     }
    },
    "additionalProperties": false
   },
   "Commissions.Dto.MenuPrefsDto": {
    "type": "object",
    "properties": {
     "setupPaths": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "nullable": true
     },
     "favourites": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "nullable": true
     },
     "foldSetup": {
      "type": "boolean"
     },
     "myPagesOnly": {
      "type": "boolean"
     }
    },
    "additionalProperties": false
   },
   "Commissions.Dto.OrganizationDto": {
    "required": [
     "country",
     "currencyCode",
     "currencyName",
     "email",
     "orgName",
     "orgType",
     "phone",
     "status",
     "vertical"
    ],
    "type": "object",
    "properties": {
     "id": {
      "type": "integer",
      "format": "int64"
     },
     "orgTypeId": {
      "type": "integer",
      "format": "int64"
     },
     "orgName": {
      "minLength": 1,
      "type": "string"
     },
     "orgCode": {
      "type": "string",
      "nullable": true
     },
     "clientCode": {
      "type": "string",
      "nullable": true
     },
     "vertical": {
      "minLength": 1,
      "type": "string"
     },
     "currencyName": {
      "minLength": 1,
      "type": "string"
     },
     "currencyCode": {
      "minLength": 1,
      "type": "string"
     },
     "clientKey": {
      "type": "string",
      "nullable": true
     },
     "parentId": {
      "type": "integer",
      "format": "int64",
      "nullable": true
     },
     "level": {
      "type": "integer",
      "format": "int32"
     },
     "createdDate": {
      "type": "string",
      "format": "date-time"
     },
     "lastModifiedDate": {
      "type": "string",
      "format": "date-time",
      "nullable": true
     },
     "createdBy": {
      "type": "string",
      "nullable": true
     },
     "lastModifiedBy": {
      "type": "string",
      "nullable": true
     },
     "country": {
      "minLength": 1,
      "type": "string"
     },
     "address1": {
      "type": "string",
      "nullable": true
     },
     "address2": {
      "type": "string",
      "nullable": true
     },
     "state": {
      "type": "string",
      "nullable": true
     },
     "city": {
      "type": "string",
      "nullable": true
     },
     "zipCode": {
      "type": "string",
      "nullable": true
     },
     "email": {
      "minLength": 1,
      "type": "string",
      "format": "email"
     },
     "orgType": {
      "minLength": 1,
      "type": "string"
     },
     "phone": {
      "minLength": 1,
      "type": "string"
     },
     "status": {
      "type": "integer",
      "format": "int32"
     },
     "hierarchyTypes": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "nullable": true
     },
     "clientName": {
      "type": "string",
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "Commissions.Dto.UserDto": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "nullable": true
     },
     "login": {
      "type": "string",
      "nullable": true
     },
     "firstName": {
      "maxLength": 50,
      "type": "string",
      "nullable": true
     },
     "lastName": {
      "maxLength": 50,
      "type": "string",
      "nullable": true
     },
     "email": {
      "maxLength": 50,
      "minLength": 5,
      "type": "string",
      "format": "email",
      "nullable": true
     },
     "referenceId": {
      "maxLength": 50,
      "type": "string",
      "nullable": true
     },
     "imageUrl": {
      "type": "string",
      "nullable": true
     },
     "activated": {
      "type": "boolean"
     },
     "level": {
      "maxLength": 100,
      "minLength": 0,
      "pattern": "^[^<>\"'/;`%]*$",
      "type": "string",
      "nullable": true
     },
     "langKey": {
      "maxLength": 6,
      "minLength": 2,
      "type": "string",
      "nullable": true
     },
     "createdBy": {
      "type": "string",
      "nullable": true
     },
     "userType": {
      "type": "string",
      "nullable": true
     },
     "geography": {
      "type": "string",
      "nullable": true
     },
     "agencyName": {
      "type": "string",
      "nullable": true
     },
     "organizationName": {
      "type": "string",
      "nullable": true
     },
     "clientName": {
      "type": "string",
      "nullable": true
     },
     "remarks": {
      "type": "string",
      "nullable": true
     },
     "createdDate": {
      "type": "string",
      "format": "date-time",
      "nullable": true
     },
     "lastModifiedBy": {
      "type": "string",
      "nullable": true
     },
     "lastModifiedDate": {
      "type": "string",
      "format": "date-time",
      "nullable": true
     },
     "organizationDetailsId": {
      "type": "integer",
      "format": "int64",
      "nullable": true
     },
     "geographyId": {
      "type": "integer",
      "format": "int64",
      "nullable": true
     },
     "orgId": {
      "type": "integer",
      "format": "int64"
     },
     "clientId": {
      "type": "integer",
      "format": "int64"
     },
     "authorities": {
      "uniqueItems": true,
      "type": "array",
      "items": {
       "type": "string"
      },
      "nullable": true
     },
     "all_authorities": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "nullable": true
     },
     "createdDateDisplay": {
      "type": "string",
      "nullable": true
     },
     "updatedDateDisplay": {
      "type": "string",
      "nullable": true
     },
     "configDateFormat": {
      "type": "string",
      "nullable": true
     },
     "configCurrencySymbol": {
      "type": "string",
      "nullable": true
     },
     "configCurrencyCode": {
      "type": "string",
      "nullable": true
     },
     "menuMaster": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/MenuMasterDto"
      },
      "nullable": true
     },
     "menuMode": {
      "type": "string",
      "nullable": true
     },
     "holdsSeat": {
      "type": "boolean"
     },
     "managesTeam": {
      "type": "boolean"
     },
     "allowedPaths": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "nullable": true
     },
     "menuPrefs": {
      "$ref": "#/components/schemas/Commissions.Dto.MenuPrefsDto"
     },
     "aiPaths": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "nullable": true
     },
     "commercialPaths": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "nullable": true
     },
     "knownPaths": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "nullable": true
     },
     "modules": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "nullable": true
     },
     "moduleMenus": {
      "type": "object",
      "additionalProperties": {
       "type": "string",
       "nullable": true
      },
      "nullable": true
     },
     "editionName": {
      "type": "string",
      "nullable": true
     },
     "editionLocked": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": {
        "type": "string"
       }
      },
      "nullable": true
     },
     "plannedPaths": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "nullable": true
     },
     "deniedPaths": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "nullable": true
     },
     "organizationDetails": {
      "$ref": "#/components/schemas/Commissions.Dto.OrganizationDto"
     },
     "organizationDtos": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Commissions.Dto.OrganizationDto"
      },
      "nullable": true
     },
     "supportSession": {
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "DisputesController.TextDto": {
    "type": "object",
    "properties": {
     "text": {
      "type": "string",
      "nullable": true
     },
     "internal": {
      "type": "boolean"
     }
    },
    "additionalProperties": false
   },
   "MenuMasterDto": {
    "type": "object",
    "properties": {
     "id": {
      "type": "integer",
      "format": "int64"
     },
     "title": {
      "type": "string",
      "nullable": true
     },
     "icon": {
      "type": "string",
      "nullable": true
     },
     "parentId": {
      "type": "integer",
      "format": "int64",
      "nullable": true
     },
     "href": {
      "type": "string",
      "nullable": true
     },
     "componentKey": {
      "type": "string",
      "nullable": true
     },
     "collapse": {
      "type": "boolean"
     },
     "displayOrder": {
      "type": "integer",
      "format": "int32",
      "nullable": true
     },
     "status": {
      "type": "integer",
      "format": "int32",
      "nullable": true
     },
     "type": {
      "type": "string",
      "nullable": true
     },
     "headerTitle": {
      "type": "string",
      "nullable": true
     },
     "children": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/MenuMasterDto"
      },
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "ReportsController.RunRequest": {
    "type": "object",
    "properties": {
     "inputs": {
      "type": "object",
      "additionalProperties": {
       "type": "string",
       "nullable": true
      },
      "nullable": true
     }
    },
    "additionalProperties": false
   }
  },
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "description": "The id_token from POST /api/authenticate",
    "scheme": "bearer",
    "bearerFormat": "JWT"
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "servers": [
  {
   "url": "https://revexcommissions.com",
   "description": "RevexOne"
  }
 ]
}
