{
 "openapi": "3.0.1",
 "info": {
  "title": "Pola elastyczne API",
  "version": "2026-10-08",
  "description": "Własne pola dodatkowe dla zamówień, produktów i innych obiektów (odpowiednik „pól dodatkowych” w BaseLinker).\n\nAdres bazowy: `https://{instancja}-additional-fields-api.enterprise.sellrocket.pl` — `{instancja}` to nazwa Twojej instancji Sellrocket, którą otrzymasz przy jej uruchomieniu.\n\nWszystkie żądania wymagają nagłówka `Authorization: Bearer <token>` — zobacz [Uwierzytelnianie](../../start/uwierzytelnianie/).\n\n**Specyfikacja OpenAPI:** [pola-elastyczne.json](../../specs/pola-elastyczne.json) — do importu w Postmanie/Insomnii lub generowania klienta."
 },
 "servers": [
  {
   "url": "https://{instancja}-additional-fields-api.enterprise.sellrocket.pl",
   "variables": {
    "instancja": {
     "default": "twoja-instancja",
     "description": "Nazwa Twojej instancji Sellrocket"
    }
   }
  }
 ],
 "tags": [
  {
   "name": "Wartości pól"
  },
  {
   "name": "Definicje pól"
  },
  {
   "name": "Właściciele pól"
  },
  {
   "name": "Typy pól"
  }
 ],
 "paths": {
  "/api/v2/AdditionalFields": {
   "get": {
    "tags": [
     "Wartości pól"
    ],
    "summary": "Pobierz pola dodatkowe obiektu",
    "description": "Zwraca wszystkie pola dodatkowe (definicje z wartościami) dla obiektu danego typu, np. zamówienia; pola bez wartości również są zwracane. Odpowiada odczytowi pól dodatkowych zamówienia w BaseLinker.\n\nIf the owner with specified type has any field definitions assigned, fields should be returned even if there are no values for the owner with specified id.",
    "parameters": [
     {
      "name": "objectId",
      "in": "query",
      "description": "Id of an object for which the all the fields should be returned",
      "style": "form",
      "schema": {
       "type": "integer",
       "format": "int64"
      }
     },
     {
      "name": "ownerType",
      "in": "query",
      "description": "Type of an object for which the all the fields should be returned. To check available OwnerTypes, check `GET /AdditionalFieldsOwners`",
      "style": "form",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/AdditionalFieldDefinitionWithValueDto"
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/BadRequestResponse"
        }
       }
      }
     },
     "500": {
      "description": "Server Error"
     }
    },
    "operationId": "get-additionalfields"
   },
   "put": {
    "tags": [
     "Wartości pól"
    ],
    "summary": "Zapisz pola elastyczne obiektu",
    "description": "Tworzy lub aktualizuje wartości pól elastycznych obiektu. Pole musi mieć definicję — istniejącą albo przekazaną w żądaniu. Odpowiednik setOrderFields (custom_extra_fields) w BaseLinker.\n\nFieldDefinitions will be created for that owner type if they do not exist yet.",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "allOf": [
         {
          "$ref": "#/components/schemas/CreateAdditionalFieldsRequestV2"
         }
        ]
       }
      },
      "text/json": {
       "schema": {
        "allOf": [
         {
          "$ref": "#/components/schemas/CreateAdditionalFieldsRequestV2"
         }
        ]
       }
      },
      "application/*+json": {
       "schema": {
        "allOf": [
         {
          "$ref": "#/components/schemas/CreateAdditionalFieldsRequestV2"
         }
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/CreateAdditionalFieldsResponseV2"
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/BadRequestResponse"
        }
       }
      }
     },
     "500": {
      "description": "Server Error"
     }
    },
    "operationId": "put-additionalfields"
   }
  },
  "/api/v2/AdditionalFields/Complex": {
   "get": {
    "tags": [
     "Wartości pól"
    ],
    "summary": "Pobierz wskazane pole dodatkowe obiektu",
    "parameters": [
     {
      "name": "objectId",
      "in": "query",
      "description": "Id of an object for which the all the fields should be returned",
      "style": "form",
      "schema": {
       "type": "integer",
       "format": "int64"
      }
     },
     {
      "name": "ownerType",
      "in": "query",
      "description": "Type of an object for which the all the fields should be returned. To check available OwnerTypes, check `GET /AdditionalFieldsOwners`",
      "style": "form",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "fieldName",
      "in": "query",
      "description": "Name of the complex field, which value should be returned",
      "style": "form",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/AdditionalFieldDefinitionWithValueDto"
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/BadRequestResponse"
        }
       }
      }
     },
     "500": {
      "description": "Server Error"
     }
    },
    "operationId": "get-additionalfields-complex",
    "description": "Zwraca definicję i wartość pojedynczego pola dodatkowego obiektu, wskazanego po nazwie."
   }
  },
  "/api/v2/AdditionalFields/File": {
   "post": {
    "tags": [
     "Wartości pól"
    ],
    "summary": "Wgraj plik do pola dodatkowego",
    "description": "Przesyła plik do magazynu plików i zapisuje link do niego jako wartość pola dodatkowego obiektu.\n\nUploads file to the storage and creates or updates additional fields for a given object id and owner type",
    "parameters": [
     {
      "name": "objectId",
      "in": "query",
      "style": "form",
      "schema": {
       "type": "integer",
       "format": "int64"
      }
     },
     {
      "name": "ownerType",
      "in": "query",
      "style": "form",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "fieldName",
      "in": "query",
      "style": "form",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "id",
      "in": "query",
      "style": "form",
      "schema": {
       "type": "integer",
       "format": "int64"
      }
     }
    ],
    "requestBody": {
     "content": {
      "application/octet-stream": {
       "schema": {
        "type": "string",
        "format": "byte"
       }
      },
      "application/json": {
       "schema": {
        "type": "string",
        "format": "byte"
       }
      },
      "text/json": {
       "schema": {
        "type": "string",
        "format": "byte"
       }
      },
      "application/*+json": {
       "schema": {
        "type": "string",
        "format": "byte"
       }
      },
      "application/xml": {
       "schema": {
        "type": "string",
        "format": "byte"
       }
      },
      "text/xml": {
       "schema": {
        "type": "string",
        "format": "byte"
       }
      },
      "application/*+xml": {
       "schema": {
        "type": "string",
        "format": "byte"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/FileUploadedResponse"
        }
       }
      }
     }
    },
    "operationId": "post-additionalfields-file"
   }
  },
  "/api/v2/AdditionalFields/File/Link": {
   "post": {
    "tags": [
     "Wartości pól"
    ],
    "summary": "Zapisz link do zewnętrznego pliku w polu",
    "description": "Zapisuje podany URL zewnętrznego pliku jako wartość pola dodatkowego, bez przesyłania pliku.\n\nInstead of uploading the file, this stores a provided link as the field value.",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "allOf": [
         {
          "$ref": "#/components/schemas/AddFileLinkFieldRequest"
         }
        ]
       }
      },
      "text/json": {
       "schema": {
        "allOf": [
         {
          "$ref": "#/components/schemas/AddFileLinkFieldRequest"
         }
        ]
       }
      },
      "application/*+json": {
       "schema": {
        "allOf": [
         {
          "$ref": "#/components/schemas/AddFileLinkFieldRequest"
         }
        ]
       }
      },
      "application/xml": {
       "schema": {
        "allOf": [
         {
          "$ref": "#/components/schemas/AddFileLinkFieldRequest"
         }
        ]
       }
      },
      "text/xml": {
       "schema": {
        "allOf": [
         {
          "$ref": "#/components/schemas/AddFileLinkFieldRequest"
         }
        ]
       }
      },
      "application/*+xml": {
       "schema": {
        "allOf": [
         {
          "$ref": "#/components/schemas/AddFileLinkFieldRequest"
         }
        ]
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Created",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/FileUploadedResponse"
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/BadRequestResponse"
        }
       }
      }
     },
     "500": {
      "description": "Server Error"
     }
    },
    "operationId": "post-additionalfields-file-link"
   }
  },
  "/api/v2/AdditionalFields/history": {
   "get": {
    "tags": [
     "Wartości pól"
    ],
    "summary": "Pobierz historię zmian pól dodatkowych",
    "parameters": [
     {
      "name": "objectId",
      "in": "query",
      "description": "Id of an object for which the all the fields should be returned",
      "style": "form",
      "schema": {
       "type": "integer",
       "format": "int64"
      }
     },
     {
      "name": "ownerType",
      "in": "query",
      "description": "Type of an object for which the all the fields should be returned. To check available OwnerTypes, check `GET /AdditionalFieldsOwners`",
      "style": "form",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "from",
      "in": "query",
      "description": "Starting point of the history entries",
      "style": "form",
      "schema": {
       "type": "string",
       "format": "date-time"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "description": "Limit of how many entries we are returning",
      "style": "form",
      "schema": {
       "type": "integer",
       "format": "int32",
       "default": 100
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/PageableAdditionalFieldHistoryResponse"
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/BadRequestResponse"
        }
       }
      }
     },
     "500": {
      "description": "Server Error"
     }
    },
    "operationId": "get-additionalfields-history",
    "description": "Zwraca stronicowaną historię zmian wartości pól dodatkowych obiektu."
   }
  },
  "/api/v2/AdditionalFields/history/all/flatten": {
   "get": {
    "tags": [
     "Wartości pól"
    ],
    "summary": "Pobierz pełną historię pól (spłaszczoną)",
    "parameters": [
     {
      "name": "objectId",
      "in": "query",
      "description": "Id of an object for which the all the fields should be returned",
      "style": "form",
      "schema": {
       "type": "integer",
       "format": "int64"
      }
     },
     {
      "name": "ownerType",
      "in": "query",
      "description": "Type of an object for which the all the fields should be returned. To check available OwnerTypes, check `GET /AdditionalFieldsOwners`",
      "style": "form",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/AdditionalFieldFlattenedHistoryResponse"
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/BadRequestResponse"
        }
       }
      }
     },
     "500": {
      "description": "Server Error"
     }
    },
    "operationId": "get-additionalfields-history-all-flatten",
    "description": "Zwraca całą historię zmian pól dodatkowych obiektu w spłaszczonej postaci, bez stronicowania."
   }
  },
  "/api/v2/AdditionalFields/history/flatten": {
   "get": {
    "tags": [
     "Wartości pól"
    ],
    "summary": "Pobierz historię pól (spłaszczoną, stronicowaną)",
    "parameters": [
     {
      "name": "objectId",
      "in": "query",
      "description": "Id of an object for which the all the fields should be returned",
      "style": "form",
      "schema": {
       "type": "integer",
       "format": "int64"
      }
     },
     {
      "name": "ownerType",
      "in": "query",
      "description": "Type of an object for which the all the fields should be returned. To check available OwnerTypes, check `GET /AdditionalFieldsOwners`",
      "style": "form",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "from",
      "in": "query",
      "description": "Starting point of the history entries",
      "style": "form",
      "schema": {
       "type": "string",
       "format": "date-time"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "description": "Limit of how many entries we are returning",
      "style": "form",
      "schema": {
       "type": "integer",
       "format": "int32",
       "default": 100
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/PageableAdditionalFieldFlattenedHistoryResponse"
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/BadRequestResponse"
        }
       }
      }
     },
     "500": {
      "description": "Server Error"
     }
    },
    "operationId": "get-additionalfields-history-flatten",
    "description": "Zwraca historię zmian pól dodatkowych obiektu w spłaszczonej postaci, ze stronicowaniem."
   }
  },
  "/api/v2/AdditionalFields/many": {
   "put": {
    "tags": [
     "Wartości pól"
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "array",
        "items": {
         "$ref": "#/components/schemas/CreateAdditionalFieldsRequestV2"
        }
       }
      },
      "text/json": {
       "schema": {
        "type": "array",
        "items": {
         "$ref": "#/components/schemas/CreateAdditionalFieldsRequestV2"
        }
       }
      },
      "application/*+json": {
       "schema": {
        "type": "array",
        "items": {
         "$ref": "#/components/schemas/CreateAdditionalFieldsRequestV2"
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/CreateAdditionalFieldsResponseV2"
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/BadRequestResponse"
        }
       }
      }
     },
     "500": {
      "description": "Server Error"
     }
    },
    "operationId": "put-additionalfields-many",
    "summary": "Zapisz pola dodatkowe wielu obiektów",
    "description": "Masowo tworzy lub aktualizuje wartości pól dodatkowych dla wielu obiektów w jednym żądaniu."
   }
  },
  "/api/v2/AdditionalFields/MultipleObjects": {
   "get": {
    "tags": [
     "Wartości pól"
    ],
    "summary": "Pobierz pola dodatkowe wielu obiektów (GET)",
    "description": "Zwraca pola dodatkowe z wartościami dla wielu obiektów danego typu; identyfikatory przekazywane w query stringu.\n\nIf the owner with specified type has any field definitions assigned, fields should be returned even if there are no values for the object with specified id.",
    "parameters": [
     {
      "name": "objectIds",
      "in": "query",
      "description": "Ids of an objects for which the all the fields should be returned.<br />\nIds should be sent as a JSON array, e.g. `[1,2,3]`",
      "style": "form",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "ownerType",
      "in": "query",
      "description": "Type of an object for which the all the fields should be returned.<br />\nTo check available OwnerTypes, check `GET /AdditionalFieldsOwners`",
      "style": "form",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/AdditionalFieldDefinitionWithValueDto"
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/BadRequestResponse"
        }
       }
      }
     },
     "500": {
      "description": "Server Error"
     }
    },
    "deprecated": true,
    "operationId": "get-additionalfields-multipleobjects"
   }
  },
  "/api/v3/AdditionalFields/MultipleObjects": {
   "post": {
    "tags": [
     "Wartości pól"
    ],
    "summary": "Pobierz pola dodatkowe wielu obiektów",
    "description": "Zwraca pola dodatkowe z wartościami dla wielu obiektów; lista ID w treści żądania, zalecane przy dużej liczbie ID. To operacja odczytu.\n\nIf the owner with specified type has any field definitions assigned, fields should be returned even if there are no values for the object with specified id.",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "allOf": [
         {
          "$ref": "#/components/schemas/GetMultipleObjectsRequestV2"
         }
        ]
       }
      },
      "text/json": {
       "schema": {
        "allOf": [
         {
          "$ref": "#/components/schemas/GetMultipleObjectsRequestV2"
         }
        ]
       }
      },
      "application/*+json": {
       "schema": {
        "allOf": [
         {
          "$ref": "#/components/schemas/GetMultipleObjectsRequestV2"
         }
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/AdditionalFieldDefinitionWithValueDto"
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/BadRequestResponse"
        }
       }
      }
     },
     "500": {
      "description": "Server Error"
     }
    },
    "operationId": "post-additionalfields-multipleobjects"
   }
  },
  "/api/v2/AdditionalFields/MultipleObjects/Pageable": {
   "get": {
    "tags": [
     "Wartości pól"
    ],
    "summary": "Pobierz pola wielu obiektów stronicowo (GET)",
    "description": "Stronicowana wersja pobierania pól dodatkowych dla wielu obiektów; identyfikatory w query stringu.\n\nIf the owner with specified type has any field definitions assigned, fields should be returned even if there are no values for the object with specified id.",
    "parameters": [
     {
      "name": "objectIds",
      "in": "query",
      "description": "Ids of an objects for which the all the fields should be returned.<br />\nIds should be sent as a JSON array, e.g. `[1,2,3]`",
      "style": "form",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "ownerType",
      "in": "query",
      "description": "Type of an object for which the all the fields should be returned.<br />\nTo check available OwnerTypes, check `GET /AdditionalFieldsOwners`",
      "style": "form",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "pageNumber",
      "in": "query",
      "description": "Number of results page to return.<br />\nPageSize is set to 100",
      "style": "form",
      "schema": {
       "type": "integer",
       "format": "int32",
       "default": 0
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/PageableFieldDefinitionsWithValuesResponseV2"
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/BadRequestResponse"
        }
       }
      }
     },
     "500": {
      "description": "Server Error"
     }
    },
    "deprecated": true,
    "operationId": "get-additionalfields-multipleobjects-pageable"
   },
   "post": {
    "tags": [
     "Wartości pól"
    ],
    "summary": "Pobierz pola wielu obiektów stronicowo",
    "description": "Stronicowana wersja pobierania pól dodatkowych dla wielu obiektów; parametry w treści żądania. To operacja odczytu.\n\nIf the owner with specified type has any field definitions assigned, fields should be returned even if there are no values for the object with specified id.",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "allOf": [
         {
          "$ref": "#/components/schemas/GetMultipleObjectsPageableRequestV2"
         }
        ]
       }
      },
      "text/json": {
       "schema": {
        "allOf": [
         {
          "$ref": "#/components/schemas/GetMultipleObjectsPageableRequestV2"
         }
        ]
       }
      },
      "application/*+json": {
       "schema": {
        "allOf": [
         {
          "$ref": "#/components/schemas/GetMultipleObjectsPageableRequestV2"
         }
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/PageableFieldDefinitionsWithValuesResponseV2"
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/BadRequestResponse"
        }
       }
      }
     },
     "500": {
      "description": "Server Error"
     }
    },
    "operationId": "post-additionalfields-multipleobjects-pageable"
   }
  },
  "/api/v3/AdditionalFields/Search": {
   "get": {
    "tags": [
     "Wartości pól"
    ],
    "summary": "Wyszukaj obiekty po wartości pola (GET)",
    "parameters": [
     {
      "name": "ownerType",
      "in": "query",
      "description": "Type of an object for which the all the fields should be searched. To check available OwnerTypes, check `GET /AdditionalFieldsOwners`",
      "style": "form",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "fieldValue",
      "in": "query",
      "description": "Value of the field",
      "style": "form",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "offset",
      "in": "query",
      "style": "form",
      "schema": {
       "type": "integer",
       "format": "int32",
       "default": 0
      }
     },
     {
      "name": "limit",
      "in": "query",
      "style": "form",
      "schema": {
       "type": "integer",
       "format": "int32",
       "default": 100
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Int64Page"
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/BadRequestResponse"
        }
       }
      }
     },
     "500": {
      "description": "Server Error"
     }
    },
    "operationId": "get-additionalfields-search",
    "description": "Zwraca identyfikatory obiektów danego typu, których pole dodatkowe ma wskazaną wartość."
   },
   "post": {
    "tags": [
     "Wartości pól"
    ],
    "summary": "Wyszukaj obiekty po wartości pola",
    "requestBody": {
     "description": "<br />\n            `ownerType` - Type of an object for which the all the fields should be searched. To check available OwnerTypes, check `GET /AdditionalFieldsOwners`<br />\n            `fieldValue` - Value of the field<br />\n            `orderIds` - List of order Ids to search through<br /><br /><b>Sample request</b><br />\n            ```\n            {instancja}-smerp-api.enterprise.sellrocket.pl/api/v2/Orders/{orderId}\",\n                \"fieldValue\": \"t\", \n                \"ownerIds\": [201492, 205784],\n                \"offset\": 0,\n                \"limit\": 100   \n            }\n            ```",
     "content": {
      "application/json": {
       "schema": {
        "allOf": [
         {
          "$ref": "#/components/schemas/SearchValueInOrdersWithSpecificIdsRequest"
         }
        ]
       }
      },
      "text/json": {
       "schema": {
        "allOf": [
         {
          "$ref": "#/components/schemas/SearchValueInOrdersWithSpecificIdsRequest"
         }
        ]
       }
      },
      "application/*+json": {
       "schema": {
        "allOf": [
         {
          "$ref": "#/components/schemas/SearchValueInOrdersWithSpecificIdsRequest"
         }
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Int64Page"
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/BadRequestResponse"
        }
       }
      }
     },
     "500": {
      "description": "Server Error"
     }
    },
    "operationId": "post-additionalfields-search",
    "description": "Zwraca identyfikatory obiektów (np. zamówień) spełniających filtry po wartościach pól dodatkowych, opcjonalnie zawężone do podanej listy ID. To operacja odczytu."
   }
  },
  "/api/v2/AdditionalFieldsDefinitions": {
   "get": {
    "tags": [
     "Definicje pól"
    ],
    "summary": "Pobierz definicje pól dodatkowych",
    "parameters": [
     {
      "name": "OwnerType",
      "in": "query",
      "style": "form",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "FieldName",
      "in": "query",
      "style": "form",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/AdditionalFieldDefinitionDto"
         }
        }
       }
      }
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ProblemDetails"
        }
       }
      }
     },
     "500": {
      "description": "Server Error"
     }
    },
    "operationId": "get-additionalfieldsdefinitions",
    "description": "Zwraca definicje pól dodatkowych dla typu obiektu, opcjonalnie dla konkretnej nazwy pola. Odpowiednik getOrderExtraFields w BaseLinker."
   },
   "post": {
    "tags": [
     "Definicje pól"
    ],
    "summary": "Utwórz definicję pola dodatkowego",
    "description": "Tworzy nową definicję pola dla typu obiektu; kończy się błędem, jeśli pole o tej nazwie już istnieje.\n\nIt will fail if there is already a field definition with the same `OwnerType` and `FieldName`",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "allOf": [
         {
          "$ref": "#/components/schemas/CreateAdditionalFieldDefinitionRequest"
         }
        ]
       }
      },
      "text/json": {
       "schema": {
        "allOf": [
         {
          "$ref": "#/components/schemas/CreateAdditionalFieldDefinitionRequest"
         }
        ]
       }
      },
      "application/*+json": {
       "schema": {
        "allOf": [
         {
          "$ref": "#/components/schemas/CreateAdditionalFieldDefinitionRequest"
         }
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "boolean"
        }
       }
      }
     },
     "500": {
      "description": "Server Error"
     }
    },
    "operationId": "post-additionalfieldsdefinitions"
   },
   "put": {
    "tags": [
     "Definicje pól"
    ],
    "summary": "Zaktualizuj definicję pola dodatkowego",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "allOf": [
         {
          "$ref": "#/components/schemas/UpdateAdditionalFieldDefinitionRequest"
         }
        ]
       }
      },
      "text/json": {
       "schema": {
        "allOf": [
         {
          "$ref": "#/components/schemas/UpdateAdditionalFieldDefinitionRequest"
         }
        ]
       }
      },
      "application/*+json": {
       "schema": {
        "allOf": [
         {
          "$ref": "#/components/schemas/UpdateAdditionalFieldDefinitionRequest"
         }
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "boolean"
        }
       }
      }
     },
     "500": {
      "description": "Server Error"
     }
    },
    "operationId": "put-additionalfieldsdefinitions",
    "description": "Aktualizuje istniejącą definicję pola dodatkowego."
   },
   "delete": {
    "tags": [
     "Definicje pól"
    ],
    "summary": "Usuń definicję pola dodatkowego",
    "description": "Usuwa definicję pola wraz ze wszystkimi jego wartościami we wszystkich obiektach danego typu. Używaj ostrożnie.\n\n<b>[USE WITH CAUTION]</b> It deletes field definition with the values for all objects of given `OwnerType`",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "allOf": [
         {
          "$ref": "#/components/schemas/DeleteAdditionalFieldDefinitionRequest"
         }
        ]
       }
      },
      "text/json": {
       "schema": {
        "allOf": [
         {
          "$ref": "#/components/schemas/DeleteAdditionalFieldDefinitionRequest"
         }
        ]
       }
      },
      "application/*+json": {
       "schema": {
        "allOf": [
         {
          "$ref": "#/components/schemas/DeleteAdditionalFieldDefinitionRequest"
         }
        ]
       }
      },
      "application/xml": {
       "schema": {
        "allOf": [
         {
          "$ref": "#/components/schemas/DeleteAdditionalFieldDefinitionRequest"
         }
        ]
       }
      },
      "text/xml": {
       "schema": {
        "allOf": [
         {
          "$ref": "#/components/schemas/DeleteAdditionalFieldDefinitionRequest"
         }
        ]
       }
      },
      "application/*+xml": {
       "schema": {
        "allOf": [
         {
          "$ref": "#/components/schemas/DeleteAdditionalFieldDefinitionRequest"
         }
        ]
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "boolean"
        }
       }
      }
     },
     "500": {
      "description": "Server Error"
     }
    },
    "operationId": "delete-additionalfieldsdefinitions"
   }
  },
  "/api/v2/AdditionalFieldsOwners": {
   "get": {
    "tags": [
     "Właściciele pól"
    ],
    "summary": "Pobierz typy obiektów obsługujące pola",
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/AdditionalFieldOwnerDto"
         }
        }
       }
      }
     },
     "500": {
      "description": "Server Error"
     }
    },
    "operationId": "get-additionalfieldsowners",
    "description": "Zwraca listę typów obiektów (np. zamówienie, klient), do których można przypisywać pola dodatkowe."
   }
  },
  "/api/v2/AdditionalFieldTypes": {
   "get": {
    "tags": [
     "Typy pól"
    ],
    "summary": "Pobierz typy pól dodatkowych",
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/AdditionalFieldTypeDto"
         }
        }
       }
      }
     },
     "500": {
      "description": "Server Error"
     }
    },
    "operationId": "get-additionalfieldtypes",
    "description": "Zwraca dostępne typy danych pól dodatkowych (np. tekst, liczba, plik)."
   }
  }
 },
 "components": {
  "schemas": {
   "AdditionalFieldDefinitionDto": {
    "type": "object",
    "properties": {
     "ownerType": {
      "type": "string",
      "nullable": true
     },
     "name": {
      "type": "string",
      "nullable": true
     },
     "displayName": {
      "type": "string",
      "nullable": true
     },
     "type": {
      "type": "string",
      "nullable": true
     },
     "displayMode": {
      "type": "string",
      "nullable": true
     },
     "id": {
      "type": "integer",
      "format": "int64",
      "nullable": true
     },
     "predefinedValues": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "AdditionalFieldDefinitionWithValueDto": {
    "type": "object",
    "properties": {
     "objectId": {
      "type": "integer",
      "format": "int64"
     },
     "ownerType": {
      "type": "string",
      "nullable": true
     },
     "definitionId": {
      "type": "integer",
      "format": "int64",
      "nullable": true
     },
     "fieldType": {
      "type": "string",
      "nullable": true
     },
     "fieldName": {
      "type": "string",
      "nullable": true
     },
     "fieldDisplayName": {
      "type": "string",
      "nullable": true
     },
     "displayMode": {
      "type": "string",
      "nullable": true
     },
     "fieldValue": {
      "type": "string",
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "AdditionalFieldOwnerDto": {
    "type": "object",
    "properties": {
     "type": {
      "type": "string",
      "nullable": true
     },
     "name": {
      "type": "string",
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "AdditionalFieldTypeDto": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "nullable": true
     },
     "isComplex": {
      "type": "boolean"
     },
     "validationDescription": {
      "type": "string",
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "BadRequestResponse": {
    "type": "object",
    "properties": {
     "error": {
      "type": "string",
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "CreateAdditionalFieldDefinitionRequest": {
    "type": "object",
    "properties": {
     "id": {
      "type": "integer",
      "format": "int64",
      "nullable": true
     },
     "ownerType": {
      "type": "string",
      "nullable": true
     },
     "fieldName": {
      "type": "string",
      "nullable": true
     },
     "fieldDisplayName": {
      "type": "string",
      "nullable": true
     },
     "fieldType": {
      "type": "string",
      "nullable": true
     },
     "displayMode": {
      "type": "string",
      "description": "\"standard\" or \"advanced\". When omitted, derived from FieldName vs FieldDisplayName.",
      "nullable": true
     },
     "predefinedValues": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "CreatedFieldDto": {
    "type": "object",
    "properties": {
     "fieldName": {
      "type": "string",
      "nullable": true
     },
     "fieldValue": {
      "type": "string",
      "nullable": true
     },
     "fieldType": {
      "type": "string",
      "nullable": true
     },
     "outcome": {
      "type": "string",
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "DeleteAdditionalFieldDefinitionRequest": {
    "type": "object",
    "properties": {
     "ownerType": {
      "type": "string",
      "nullable": true
     },
     "fieldName": {
      "type": "string",
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "FileUploadedResponse": {
    "type": "object",
    "properties": {
     "fileUrl": {
      "type": "string",
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "ProblemDetails": {
    "type": "object",
    "properties": {
     "type": {
      "type": "string",
      "nullable": true
     },
     "title": {
      "type": "string",
      "nullable": true
     },
     "status": {
      "type": "integer",
      "format": "int32",
      "nullable": true
     },
     "detail": {
      "type": "string",
      "nullable": true
     },
     "instance": {
      "type": "string",
      "nullable": true
     }
    },
    "additionalProperties": {}
   },
   "UpdateAdditionalFieldDefinitionRequest": {
    "type": "object",
    "properties": {
     "ownerType": {
      "type": "string",
      "nullable": true
     },
     "fieldName": {
      "type": "string",
      "nullable": true
     },
     "fieldDisplayName": {
      "type": "string",
      "nullable": true
     },
     "fieldType": {
      "type": "string",
      "nullable": true
     },
     "displayMode": {
      "type": "string",
      "nullable": true
     },
     "predefinedValues": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "AddFileLinkFieldRequest": {
    "type": "object",
    "properties": {
     "objectId": {
      "type": "integer",
      "format": "int64"
     },
     "ownerType": {
      "type": "string",
      "nullable": true
     },
     "fieldName": {
      "type": "string",
      "nullable": true
     },
     "id": {
      "type": "integer",
      "format": "int64",
      "nullable": true
     },
     "fileUrl": {
      "type": "string",
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "AdditionalFieldDefinitionWithValueDtoV2": {
    "type": "object",
    "properties": {
     "objectId": {
      "type": "integer",
      "format": "int64"
     },
     "ownerType": {
      "type": "string",
      "nullable": true
     },
     "definitionId": {
      "type": "integer",
      "format": "int64",
      "nullable": true
     },
     "fieldType": {
      "type": "string",
      "nullable": true
     },
     "fieldName": {
      "type": "string",
      "nullable": true
     },
     "fieldDisplayName": {
      "type": "string",
      "nullable": true
     },
     "displayMode": {
      "type": "string",
      "nullable": true
     },
     "fieldValue": {
      "type": "string",
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "AdditionalFieldFlattenedHistoryResponse": {
    "type": "object",
    "properties": {
     "id": {
      "type": "integer",
      "format": "int64",
      "nullable": true
     },
     "objectId": {
      "type": "string",
      "nullable": true
     },
     "type": {
      "type": "string",
      "nullable": true
     },
     "operation": {
      "type": "string",
      "nullable": true
     },
     "property": {
      "type": "string",
      "nullable": true
     },
     "prevValue": {
      "allOf": [
       {
        "$ref": "#/components/schemas/JsonNode"
       }
      ],
      "nullable": true
     },
     "value": {
      "allOf": [
       {
        "$ref": "#/components/schemas/JsonNode"
       }
      ],
      "nullable": true
     },
     "createdAtUtc": {
      "type": "string",
      "format": "date-time"
     },
     "createdBy": {
      "type": "string",
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "AdditionalFieldHistoryResponse": {
    "type": "object",
    "properties": {
     "id": {
      "type": "integer",
      "format": "int64",
      "nullable": true
     },
     "objectId": {
      "type": "string",
      "nullable": true
     },
     "type": {
      "type": "string",
      "nullable": true
     },
     "difference": {
      "allOf": [
       {
        "$ref": "#/components/schemas/JsonNode"
       }
      ],
      "nullable": true
     },
     "createdAtUtc": {
      "type": "string",
      "format": "date-time"
     },
     "createdBy": {
      "type": "string",
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "CreateAdditionalFieldsRequestV2": {
    "type": "object",
    "properties": {
     "objectId": {
      "type": "integer",
      "format": "int64"
     },
     "ownerType": {
      "type": "string",
      "nullable": true
     },
     "fields": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/FieldCreationDto"
      },
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "CreateAdditionalFieldsResponseV2": {
    "type": "object",
    "properties": {
     "objectId": {
      "type": "integer",
      "format": "int64"
     },
     "ownerType": {
      "type": "string",
      "nullable": true
     },
     "createdFields": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/CreatedFieldDto"
      },
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "DefinitionCreationDto": {
    "type": "object",
    "properties": {
     "fieldName": {
      "type": "string",
      "nullable": true
     },
     "fieldDisplayName": {
      "type": "string",
      "nullable": true
     },
     "fieldType": {
      "type": "string",
      "nullable": true
     },
     "predefinedValues": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "FieldCreationDto": {
    "type": "object",
    "properties": {
     "fieldName": {
      "type": "string",
      "nullable": true
     },
     "fieldType": {
      "type": "string",
      "nullable": true
     },
     "fieldValue": {
      "type": "string",
      "nullable": true
     },
     "additionalFieldDefinition": {
      "allOf": [
       {
        "$ref": "#/components/schemas/DefinitionCreationDto"
       }
      ],
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "GetMultipleObjectsPageableRequestV2": {
    "type": "object",
    "properties": {
     "ids": {
      "type": "array",
      "items": {
       "type": "integer",
       "format": "int64"
      },
      "nullable": true
     },
     "ownerType": {
      "type": "string",
      "nullable": true
     },
     "pageNumber": {
      "type": "integer",
      "format": "int32"
     }
    },
    "additionalProperties": false
   },
   "GetMultipleObjectsRequestV2": {
    "type": "object",
    "properties": {
     "ids": {
      "type": "array",
      "items": {
       "type": "integer",
       "format": "int64"
      },
      "nullable": true
     },
     "ownerType": {
      "type": "string",
      "nullable": true
     }
    },
    "additionalProperties": false
   },
   "JsonNode": {
    "type": "object",
    "properties": {
     "options": {
      "allOf": [
       {
        "$ref": "#/components/schemas/JsonNodeOptions"
       }
      ],
      "nullable": true,
      "readOnly": true
     },
     "parent": {
      "allOf": [
       {
        "$ref": "#/components/schemas/JsonNode"
       }
      ],
      "nullable": true,
      "readOnly": true
     },
     "root": {
      "allOf": [
       {
        "$ref": "#/components/schemas/JsonNode"
       }
      ],
      "nullable": true,
      "readOnly": true
     }
    },
    "additionalProperties": false
   },
   "JsonNodeOptions": {
    "type": "object",
    "properties": {
     "propertyNameCaseInsensitive": {
      "type": "boolean"
     }
    },
    "additionalProperties": false
   },
   "PageableAdditionalFieldFlattenedHistoryResponse": {
    "type": "object",
    "properties": {
     "results": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/AdditionalFieldFlattenedHistoryResponse"
      },
      "nullable": true
     },
     "totalRecords": {
      "type": "integer",
      "format": "int32"
     },
     "pageNumber": {
      "type": "integer",
      "format": "int32"
     },
     "pageSize": {
      "type": "integer",
      "format": "int32"
     }
    },
    "additionalProperties": false
   },
   "PageableAdditionalFieldHistoryResponse": {
    "type": "object",
    "properties": {
     "results": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/AdditionalFieldHistoryResponse"
      },
      "nullable": true
     },
     "totalRecords": {
      "type": "integer",
      "format": "int32"
     },
     "pageNumber": {
      "type": "integer",
      "format": "int32"
     },
     "pageSize": {
      "type": "integer",
      "format": "int32"
     }
    },
    "additionalProperties": false
   },
   "PageableFieldDefinitionsWithValuesResponseV2": {
    "type": "object",
    "properties": {
     "results": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/AdditionalFieldDefinitionWithValueDtoV2"
      },
      "nullable": true
     },
     "totalRecords": {
      "type": "integer",
      "format": "int32"
     },
     "pageNumber": {
      "type": "integer",
      "format": "int32"
     },
     "pageSize": {
      "type": "integer",
      "format": "int32"
     }
    },
    "additionalProperties": false
   },
   "Int64Page": {
    "type": "object",
    "properties": {
     "list": {
      "type": "array",
      "items": {
       "type": "integer",
       "format": "int64"
      },
      "nullable": true
     },
     "pageNumber": {
      "type": "integer",
      "format": "int32"
     },
     "total": {
      "type": "integer",
      "format": "int32"
     }
    },
    "additionalProperties": false
   },
   "SearchValueInOrdersWithSpecificIdsRequest": {
    "type": "object",
    "properties": {
     "ownerType": {
      "type": "string",
      "nullable": true
     },
     "fieldValue": {
      "type": "string",
      "nullable": true
     },
     "ownerIds": {
      "type": "array",
      "items": {
       "type": "integer",
       "format": "int64"
      },
      "nullable": true
     },
     "offset": {
      "type": "integer",
      "format": "int32"
     },
     "limit": {
      "type": "integer",
      "format": "int32"
     }
    },
    "additionalProperties": false
   }
  },
  "securitySchemes": {
   "Bearer": {
    "type": "http",
    "scheme": "bearer",
    "bearerFormat": "JWT",
    "description": "Token API wygenerowany w panelu Sellrocket."
   }
  }
 },
 "security": [
  {
   "Bearer": []
  }
 ]
}