{
  "openapi": "3.0.1",
  "info": {
    "title": "Настройки: API",
    "contact": {
      "name": "Support Team",
      "email": "admin@selsup.ru"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "https://selsup.ru/dogovor-offerta/"
    },
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.selsup.ru/",
      "description": "Production server"
    }
  ],
  "tags": [
    {
      "name": "Настройки",
      "description": "Методы для управления различными настройками"
    }
  ],
  "paths": {
    "/api/property/updateProperty": {
      "post": {
        "tags": [
          "Настройки"
        ],
        "summary": "Изменить настройки",
        "description": "Изменяет настройки для компонента",
        "operationId": "updateProperty",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "description": "Идентификатор организации",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Идентификатор организации"
            }
          },
          {
            "name": "clientId",
            "in": "query",
            "description": "Идентификатор клиента",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Идентификатор клиента",
              "readOnly": true
            }
          },
          {
            "name": "component",
            "in": "query",
            "description": "Компонент для настройки",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Компонент для настройки"
            }
          },
          {
            "name": "name",
            "in": "query",
            "description": "Название свойства. Пример для МойСклад контрагент: \"contractor.Ozon\"; договор: \"contract.WB\"",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Название свойства. Пример для МойСклад контрагент: \"contractor.Ozon\"; договор: \"contract.WB\""
            }
          },
          {
            "name": "value",
            "in": "query",
            "description": "Значение свойства",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Значение свойства"
            }
          },
          {
            "name": "valueName",
            "in": "query",
            "description": "Название значения - в случае когда в value передается ID",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Название значения - в случае когда в value передается ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/property/getProperties": {
      "get": {
        "tags": [
          "Настройки"
        ],
        "summary": "Получение настроек",
        "description": "Получает сохраненные настройки для компонента",
        "operationId": "getProperties",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "description": "Организация для настроек. Можно не передавать, если настройки не зависят от организации",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "component",
            "in": "query",
            "description": "Компонент, для которого сохраняются настройки",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/property/getPropertiesList": {
      "get": {
        "tags": [
          "Настройки"
        ],
        "summary": "Список настроек",
        "description": "Получает список сохраненных настроек для компонента",
        "operationId": "getPropertiesList",
        "parameters": [
          {
            "name": "component",
            "in": "query",
            "description": "Компонент, для которого получаются настройки",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Property"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Property": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "integer",
            "description": "Идентификатор организации",
            "format": "int64"
          },
          "clientId": {
            "type": "integer",
            "description": "Идентификатор клиента",
            "format": "int64",
            "readOnly": true
          },
          "component": {
            "type": "string",
            "description": "Компонент для настройки"
          },
          "name": {
            "type": "string",
            "description": "Название свойства. Пример для МойСклад контрагент: \"contractor.Ozon\"; договор: \"contract.WB\""
          },
          "value": {
            "type": "string",
            "description": "Значение свойства"
          },
          "valueName": {
            "type": "string",
            "description": "Название значения - в случае когда в value передается ID"
          }
        },
        "description": "Различные настройки SelSup"
      }
    },
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "name": "Authorization",
        "in": "header"
      }
    }
  }
}