{
  "openapi": "3.0.4",
  "info": {
    "title": "Contracts API",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.mercadoe.com"
    }
  ],
  "paths": {
    "/v1/contracts/{contractId}/approvers": {
      "get": {
        "tags": [
          "Approvers"
        ],
        "summary": "Get Contract approvers by ContractId",
        "description": "Get a list of all contract approvers with the given `contractId`.",
        "parameters": [
          {
            "name": "contractId",
            "in": "path",
            "description": "The contract Id in ME",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageNumber",
            "in": "query",
            "description": "",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetApproversResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/contracts/{contractId}/attachments": {
      "get": {
        "tags": [
          "Contracts"
        ],
        "summary": "Get the attachment IDs linked to a contract",
        "description": "Retrieves the attachment IDs for a specific contract using the given contract ID.",
        "parameters": [
          {
            "name": "contractId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageNumber",
            "in": "query",
            "description": "The page number must be an integer greater than or equal to 1. Default is 1.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "The page size must be an integer greater than or equal to 1. Default is 10.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetAttachmentsResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      },
      "post": {
        "tags": [
          "Contracts"
        ],
        "summary": "Add an attachment to the contract",
        "description": "Add a new attachment to a specific contract by providing the contract ID and the attachment file.",
        "parameters": [
          {
            "name": "contractId",
            "in": "path",
            "description": "The contract id",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "X-ME-CORRELATION-ID",
            "in": "header",
            "description": "Internal client code to be identified in the webhook. It can be, for example, a product code in your ERP, an order number, etc.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "required": [
                  "File"
                ],
                "type": "object",
                "properties": {
                  "ContractId": {
                    "type": "integer",
                    "description": "ME Contract Id",
                    "format": "int32"
                  },
                  "ItemId": {
                    "type": "integer",
                    "description": "Contract item Id",
                    "format": "int32"
                  },
                  "File": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              },
              "encoding": {
                "ContractId": {
                  "style": "form"
                },
                "ItemId": {
                  "style": "form"
                },
                "File": {
                  "style": "form"
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddAttachmentResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/contracts": {
      "get": {
        "tags": [
          "Contracts"
        ],
        "summary": "Get all contracts by query parameters",
        "description": "Returns a list of all contracts available to the connected user, filtered according to the specified query parameters.",
        "parameters": [
          {
            "name": "clientContractId",
            "in": "query",
            "description": "the client order id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageNumber",
            "in": "query",
            "description": "the page number must be an integer greater than or equal to 1",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "the page size must be an integer greater than or equal to 1",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetManyResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Contracts"
        ],
        "summary": "Create a contract",
        "description": "Creates a new Contract by providing the Description, Status, and other details.",
        "parameters": [
          {
            "name": "X-ME-CORRELATION-ID",
            "in": "header",
            "description": "Internal client code to be identified in the webhook. It can be, for example, a product code in your ERP, an order number, etc.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCommand"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/contracts/{contractId}": {
      "get": {
        "tags": [
          "Contracts"
        ],
        "summary": "Get a Contract by Id",
        "description": "Get information about a specific contract with the given `contractId`.",
        "parameters": [
          {
            "name": "contractId",
            "in": "path",
            "description": "The contract Id in ME",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetByIdResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Contracts"
        ],
        "summary": "Update a contract based on the contractId",
        "description": "Change a specific contract field with a provided value.",
        "parameters": [
          {
            "name": "contractId",
            "in": "path",
            "description": "The contract Id in ME",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCommand"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/contracts/{contractId}/status": {
      "put": {
        "tags": [
          "Contracts"
        ],
        "summary": "Update a contract status based on the contractId",
        "description": "Change a specific contract status field with a provided value.",
        "parameters": [
          {
            "name": "contractId",
            "in": "path",
            "description": "The contract Id in ME",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "X-ME-CORRELATION-ID",
            "in": "header",
            "description": "Internal client code to be identified in the webhook. It can be, for example, a product code in your ERP, an order number, etc.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateStatusCommand"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateStatusResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/contracts/{contractId}/business-organizations": {
      "get": {
        "tags": [
          "Contracts"
        ],
        "summary": "Get the business organizations in a contract by ContractId",
        "description": "Get a list of all business organizations assigned to a specific contract.",
        "parameters": [
          {
            "name": "contractId",
            "in": "path",
            "description": "The contract Id in ME",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageNumber",
            "in": "query",
            "description": "",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetBusinessOrganizationsResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/contracts/{contractId}/attachments/{attachmentId}": {
      "delete": {
        "tags": [
          "Contracts"
        ],
        "summary": "Delete an attachment from a contract",
        "description": "Deletes an attachment document from a specific contract by providing the contract ID and the attachment ID.",
        "parameters": [
          {
            "name": "contractId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "attachmentId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "X-ME-CORRELATION-ID",
            "in": "header",
            "description": "Internal client code to be identified in the webhook. It can be, for example, a product code in your ERP, an order number, etc.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteAttachmentDocumentResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/contracts/{contractId}/attachments/{attachmentId}/download": {
      "get": {
        "tags": [
          "Contracts"
        ],
        "summary": "Redirection link to download the contract attachment",
        "description": "This endpoint redirects directly to the client’s contract attachment download by entering the contractId, attachmentId, and cancellationToken",
        "parameters": [
          {
            "name": "contractId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "attachmentId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/contracts/{contractId}/items/{itemId}/attachments": {
      "get": {
        "tags": [
          "Items"
        ],
        "summary": "Get the attachment IDs linked to a contract item",
        "description": "Retrieves the attachment IDs associated with a specific contract item, identified by the given contract ID and contract item ID.",
        "parameters": [
          {
            "name": "contractId",
            "in": "path",
            "description": "The contract id",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "itemId",
            "in": "path",
            "description": "The contract item id",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageNumber",
            "in": "query",
            "description": "The page number must be an integer greater than or equal to 1. Default is 1.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "The page size must be an integer greater than or equal to 1. Default is 10.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetAttachmentsResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/v1/contracts/{contractId}/items": {
      "get": {
        "tags": [
          "Items"
        ],
        "summary": "Get Contract items by ContractId",
        "description": "Gets a paginated list of items for a contract.\nTax reform fields are included only for enabled tenants.",
        "parameters": [
          {
            "name": "contractId",
            "in": "path",
            "description": "The contract Id in ME",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageNumber",
            "in": "query",
            "description": "",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetItemsResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/contracts/{contractId}/items/business-organizations": {
      "get": {
        "tags": [
          "Items"
        ],
        "summary": "Get the business organizations of the items in a contract by ContractId",
        "description": "Get a list of the business organizations of the items assigned to a specific contract.",
        "parameters": [
          {
            "name": "contractId",
            "in": "path",
            "description": "The contract Id in ME",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageNumber",
            "in": "query",
            "description": "",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetBusinessOrganizationsResponse2"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/contracts/{contractId}/items/{contractItemId}/attachments/{attachmentId}": {
      "delete": {
        "tags": [
          "Items"
        ],
        "summary": "Delete an attachment from a contract item",
        "description": "Deletes an attachment document from a specific contract item by providing the contract ID, contract item ID, and the attachment ID.",
        "parameters": [
          {
            "name": "contractId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "contractItemId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "attachmentId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "X-ME-CORRELATION-ID",
            "in": "header",
            "description": "Internal client code to be identified in the webhook. It can be, for example, a product code in your ERP, an order number, etc.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteAttachmentDocumentResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/contracts/{contractId}/items/{contractItemId}/attachments/{attachmentId}/download": {
      "get": {
        "tags": [
          "Items"
        ],
        "summary": "Redirection link to download the contract item attachment",
        "description": "This endpoint redirects directly to the client's contract item attachment download by entering the contractId, contractItemId, attachmentId, and cancellationToken.",
        "parameters": [
          {
            "name": "contractId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "contractItemId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "attachmentId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/contracts/{contractId}/items/{contractItemId}/attachments": {
      "post": {
        "tags": [
          "Items"
        ],
        "summary": "Add an attachment to the contract item",
        "description": "Add a new attachment to a specific contract item by providing the contractId,contractItemId, and attachmentId.",
        "parameters": [
          {
            "name": "contractId",
            "in": "path",
            "description": "The contract id",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "contractItemId",
            "in": "path",
            "description": "The contract item id",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "X-ME-CORRELATION-ID",
            "in": "header",
            "description": "Internal client code to be identified in the webhook. It can be, for example, a product code in your ERP, an order number, etc.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "required": [
                  "File"
                ],
                "type": "object",
                "properties": {
                  "ContractId": {
                    "type": "integer",
                    "description": "ME Contract Id",
                    "format": "int32"
                  },
                  "ItemId": {
                    "type": "integer",
                    "description": "Contract item Id",
                    "format": "int32"
                  },
                  "File": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              },
              "encoding": {
                "ContractId": {
                  "style": "form"
                },
                "ItemId": {
                  "style": "form"
                },
                "File": {
                  "style": "form"
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddAttachmentResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/contracts/{contractId}/items/{itemId}/requests": {
      "get": {
        "tags": [
          "Items"
        ],
        "summary": "Get a list of Requests associated with a specific item",
        "description": "Get a list of all requests assigned to a specific item and based on the contract id.",
        "parameters": [
          {
            "name": "contractId",
            "in": "path",
            "description": "the contractId",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "itemId",
            "in": "path",
            "description": "the contractItemId",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageNumber",
            "in": "query",
            "description": "the page number must be an integer greater than or equal to 1",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "the page size must be an integer greater than or equal to 1",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetRequestsResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/contracts/{contractId}/partner-suppliers": {
      "get": {
        "tags": [
          "Partner Suppliers"
        ],
        "summary": "Get partner suppliers by ContractId",
        "description": "Get a list of all partner suppliers linked to a specific contract.",
        "parameters": [
          {
            "name": "contractId",
            "in": "path",
            "description": "The contract Id in ME",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageNumber",
            "in": "query",
            "description": "",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetPartnerSuppliersResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/v1/contracts/{contractId}/watchers": {
      "get": {
        "tags": [
          "Watchers"
        ],
        "summary": "Get monitoring users by ContractId",
        "description": "Returns a paginated list of monitoring users (watchers) associated with the specified contract.",
        "parameters": [
          {
            "name": "contractId",
            "in": "path",
            "description": "The contract Id in ME",
            "required": true,
            "schema": {
              "maximum": 2147483647,
              "minimum": 1,
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "pageNumber",
            "in": "query",
            "description": "Page number (default: 1)",
            "schema": {
              "maximum": 2147483647,
              "minimum": 1,
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Number of items per page, between 1 and 100 (default: 10)",
            "schema": {
              "maximum": 100,
              "minimum": 1,
              "type": "integer",
              "format": "int32",
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagingResult`1"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AddAttachmentResponse": {
        "type": "object",
        "properties": {
          "correlationId": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "AttributeDto": {
        "type": "object",
        "properties": {
          "name": {
            "maxLength": 256,
            "type": "string",
            "nullable": true
          },
          "value": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "AttributeItemDto": {
        "type": "object",
        "properties": {
          "name": {
            "maxLength": 256,
            "type": "string",
            "nullable": true
          },
          "value": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Attributes": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "value": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "BalanceControl": {
        "enum": [
          "NoBalanceControl",
          "Quantity",
          "Value",
          "ItemValue"
        ],
        "type": "string"
      },
      "BusinessOrganizationDto": {
        "required": [
          "code",
          "entityType"
        ],
        "type": "object",
        "properties": {
          "code": {
            "maxLength": 20,
            "minLength": 1,
            "type": "string"
          },
          "entityType": {
            "maxLength": 50,
            "minLength": 1,
            "type": "string"
          },
          "description": {
            "maxLength": 100,
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ContractItemDto": {
        "required": [
          "clientProductId",
          "clientProductReferenceId",
          "itemId",
          "measurementUnit"
        ],
        "type": "object",
        "properties": {
          "itemId": {
            "minimum": 0,
            "type": "integer",
            "description": "Sequential number of the item in the ME.",
            "format": "int32"
          },
          "clientProductId": {
            "minLength": 1,
            "type": "string",
            "description": "Product id in client's ERP"
          },
          "clientProductReferenceId": {
            "minLength": 1,
            "type": "string",
            "description": "Product reference id in client's ERP"
          },
          "price": {
            "type": "number",
            "description": "Item price. Kept for all existing clients; may lose precision for very large values as System.Single.",
            "format": "float",
            "deprecated": true
          },
          "priceValue": {
            "type": "number",
            "description": "Item price.",
            "format": "double",
            "nullable": true
          },
          "measurementUnit": {
            "minLength": 1,
            "type": "string",
            "description": "Item measurement unit"
          },
          "deliveryDeadline": {
            "minimum": 0,
            "type": "integer",
            "description": "The delivery deadline in days",
            "format": "int32",
            "nullable": true
          },
          "netValue": {
            "type": "number",
            "description": "Item net value. Kept for all existing clients; may lose precision for very large values as System.Single.",
            "format": "float",
            "deprecated": true
          },
          "netPriceValue": {
            "type": "number",
            "description": "Item net value.",
            "format": "double",
            "nullable": true
          },
          "note": {
            "type": "string",
            "description": "Item note",
            "nullable": true
          },
          "quantity": {
            "minimum": 0,
            "type": "number",
            "description": "Item quantity",
            "format": "float",
            "nullable": true
          },
          "manufacturer": {
            "maxLength": 100,
            "type": "string",
            "description": "Manufacturer of the item",
            "nullable": true
          },
          "materialApplication": {
            "type": "string",
            "description": "Material usage in the ERP.",
            "nullable": true
          },
          "isCanceled": {
            "type": "boolean",
            "description": "Cancelado",
            "nullable": true
          },
          "productIdentification": {
            "$ref": "#/components/schemas/ProductIdentification"
          },
          "ibscbsCalculationBasis": {
            "type": "number",
            "description": "Calculation basis in value used to calculate the tax (same basis for IBS and CBS).",
            "format": "float",
            "nullable": true
          },
          "taxInformation": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaxInformationDto"
            },
            "description": "A list of the taxes applied in the country."
          },
          "fullPrice": {
            "type": "number",
            "description": "Full price of the item.",
            "format": "double",
            "nullable": true
          },
          "materialOrigin": {
            "type": "integer",
            "description": "Identifier of the material's origin (e.g., domestic, imported) used in tax calculations. \nPossible values: \n- 1 = Domestic origin \n- 2 = Foreign origin",
            "format": "int32",
            "nullable": true
          },
          "attributes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AttributeItemDto"
            },
            "description": "Attributes of the contract item, consisting of a name and a value."
          },
          "sapNetValue": {
            "type": "number",
            "description": "Field corresponding to SAP's Net Value, used to calculate \"POR\".",
            "format": "double",
            "nullable": true
          },
          "ivaCode": {
            "type": "string",
            "description": "Iva Code",
            "nullable": true
          },
          "priceConversionFactor": {
            "type": "integer",
            "description": "Price conversion factor that represents the pricing unit scale.\nThis field corresponds to the SAP \"POR\" and defines\nthe number of units to which the net price applies (e.g., price per 1, 100, or 1000 units).\nIt is used to calculate the effective unit price by dividing the net price\nby this factor. This mechanism is essential for low unit-value items, where\npricing per single unit would cause rounding issues when limited to two decimal places.",
            "format": "int32",
            "nullable": true
          },
          "businessOrganizations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BusinessOrganizationDto"
            },
            "description": "Business Organizations is a list consisting of the Company Code, Delivery Center/Location Code and their descriptions."
          },
          "subItems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SubItem"
            },
            "description": "List of sub-items within the contract item, containing detailed product and tax information.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CreateCommand": {
        "required": [
          "currencyCode",
          "description",
          "endDate",
          "integrationTag",
          "startDate",
          "status",
          "totalValue"
        ],
        "type": "object",
        "properties": {
          "clientContractId": {
            "maxLength": 20,
            "type": "string",
            "description": "Contract Id in client's ERP",
            "nullable": true
          },
          "description": {
            "maxLength": 50,
            "minLength": 1,
            "type": "string",
            "description": "Contract brief description"
          },
          "category": {
            "maxLength": 20,
            "type": "string",
            "description": "Contract category",
            "nullable": true
          },
          "supplierId": {
            "type": "integer",
            "description": "Supplier Id in ME",
            "format": "int32",
            "nullable": true
          },
          "clientSupplierId": {
            "type": "string",
            "description": "Supplier Id in client's ERP",
            "nullable": true
          },
          "integrationTag": {
            "minLength": 1,
            "type": "string",
            "description": "Identification of the ME user used in the integration."
          },
          "startDate": {
            "minLength": 1,
            "type": "string",
            "description": "Contract start date",
            "format": "date-time"
          },
          "endDate": {
            "minLength": 1,
            "type": "string",
            "description": "Contract end date",
            "format": "date-time"
          },
          "clientPaymentConditionId": {
            "maxLength": 100,
            "type": "string",
            "description": "Payment condition code",
            "nullable": true
          },
          "incoTerms": {
            "maxLength": 100,
            "type": "string",
            "description": "Freight code (Incoterms - International Commercial Terms)",
            "nullable": true
          },
          "currencyCode": {
            "maxLength": 20,
            "minLength": 1,
            "type": "string",
            "description": "Currency in alphabetic code (for more information, please refer to: https://www.iso.org/iso-4217-currency-codes.html)."
          },
          "deliveryDeadline": {
            "minimum": 0,
            "type": "integer",
            "description": "Delivery deadline",
            "format": "int32",
            "nullable": true
          },
          "status": {
            "minimum": 0,
            "type": "integer",
            "description": "Contract status",
            "format": "int32"
          },
          "totalValue": {
            "minimum": 0,
            "type": "number",
            "description": "Contract total value",
            "format": "float"
          },
          "fixedValue": {
            "minimum": 0,
            "type": "number",
            "description": "Contract fixed value",
            "format": "float",
            "nullable": true
          },
          "usedValue": {
            "minimum": 0,
            "type": "number",
            "description": "Contract used value",
            "format": "float",
            "nullable": true
          },
          "note": {
            "type": "string",
            "description": "Contract notes",
            "nullable": true
          },
          "isPreOrderCreatedAutomatically": {
            "type": "boolean",
            "description": "This flag indicates if the pre-order is generated automatically.",
            "nullable": true
          },
          "isControlledByBalance": {
            "type": "boolean",
            "description": "This flag indicates if the contract balance is controlled by workflow.",
            "nullable": true
          },
          "isRequestEstimatedPriceUsedInPreOrder": {
            "type": "boolean",
            "description": "This flag indicates if the request estimated price is used in pre-order creation.",
            "nullable": true
          },
          "isPreOrderBlockedIfEstimatedRequestDateGreaterThanContractEndDate": {
            "type": "boolean",
            "description": "This flag indicates if the pre-order is blocked if the request estimated date is greather than contract end date.",
            "nullable": true
          },
          "purchasingGroup": {
            "maxLength": 20,
            "type": "string",
            "description": "Purchasing Group",
            "nullable": true
          },
          "attributes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AttributeDto"
            },
            "description": "Attributes of the contract, consisting of a name, a value and a description.",
            "nullable": true
          },
          "businessOrganizations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BusinessOrganizationDto"
            },
            "description": "List with the Business Organizations comprising the Company Code, the Entity Type and their Descriptions.",
            "nullable": true
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContractItemDto"
            },
            "description": "List with the contract items",
            "nullable": true
          },
          "balanceControl": {
            "$ref": "#/components/schemas/BalanceControl"
          }
        },
        "additionalProperties": false
      },
      "CreateResponse": {
        "type": "object",
        "properties": {
          "correlationId": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "DeleteAttachmentDocumentResponse": {
        "type": "object",
        "properties": {
          "correlationId": {
            "type": "string",
            "description": ""
          }
        },
        "additionalProperties": false,
        "description": "It is a response to deleting an attachment document."
      },
      "Document": {
        "type": "object",
        "properties": {
          "number": {
            "type": "string",
            "description": "Document identification number as stored in database",
            "nullable": true
          },
          "type": {
            "type": "string",
            "description": "Type of legal document. Ex: CNPJ",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "GetApproversResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetApproversResponseData"
            }
          },
          "hits": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "next": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "GetApproversResponseData": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Approver's name"
          },
          "integrationTag": {
            "type": "string",
            "description": "Identification of the ME user used in the integration."
          },
          "substitutedIntegrationTag": {
            "type": "string",
            "description": "Login of the substituted approver."
          },
          "initialStatus": {
            "type": "integer",
            "description": "Initial document status code.",
            "format": "int32"
          },
          "endStatus": {
            "type": "integer",
            "description": "Final document status code.",
            "format": "int32"
          },
          "initialStatusDescription": {
            "type": "string",
            "description": "Initial document status description."
          },
          "endStatusDescription": {
            "type": "string",
            "description": "Final document status description."
          },
          "approvalDate": {
            "type": "string",
            "description": "Approval date",
            "format": "date-time"
          },
          "approverId": {
            "type": "integer",
            "description": "User approver Id",
            "format": "int32",
            "nullable": true
          },
          "substitutedApproverId": {
            "type": "integer",
            "description": "Id of the substituted approver.\nIf the field is blank it means that there was no substitution.",
            "format": "int32",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "GetAttachmentResponseData": {
        "type": "object",
        "properties": {
          "attachmentId": {
            "type": "integer",
            "description": "ID of the attachment linked to a contract.",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "GetAttachmentsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetAttachmentResponseData"
            }
          },
          "hits": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "next": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "GetBusinessOrganizationsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetBusinessOrganizationsResponseData"
            }
          },
          "hits": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "next": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "GetBusinessOrganizationsResponse2": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetBusinessOrganizationsResponseData2"
            }
          },
          "hits": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "next": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "GetBusinessOrganizationsResponseData": {
        "type": "object",
        "properties": {
          "contractId": {
            "type": "integer",
            "description": "ME contract Id",
            "format": "int32"
          },
          "businessOrganizationId": {
            "type": "integer",
            "description": "ME business organization id",
            "format": "int32"
          },
          "clientBusinessOrganizationId": {
            "type": "string",
            "description": "Business organization code in the client's ERP",
            "nullable": true
          },
          "description": {
            "type": "string",
            "description": "Description of the business organization",
            "nullable": true
          },
          "entityType": {
            "type": "string",
            "description": "Type of organizational structure. Example: Company, branch, department.",
            "nullable": true
          },
          "entityDescription": {
            "type": "string",
            "description": "Description of the organizational structure",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "GetBusinessOrganizationsResponseData2": {
        "type": "object",
        "properties": {
          "contractId": {
            "type": "integer",
            "description": "ME contract Id",
            "format": "int32"
          },
          "itemId": {
            "type": "integer",
            "description": "Sequential number of the item in the ME.",
            "format": "int32"
          },
          "businessOrganizationId": {
            "type": "integer",
            "description": "ME business organization id",
            "format": "int32"
          },
          "clientBusinessOrganizationId": {
            "type": "string",
            "description": "Business organization code in the client's ERP",
            "nullable": true
          },
          "description": {
            "type": "string",
            "description": "Description of the business organization",
            "nullable": true
          },
          "entityType": {
            "type": "string",
            "description": "Type of organizational structure. Example: Company, branch, department.",
            "nullable": true
          },
          "entityDescription": {
            "type": "string",
            "description": "Description of the organizational structure",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "GetByIdResponse": {
        "type": "object",
        "properties": {
          "contractId": {
            "type": "integer",
            "description": "ME contract Id",
            "format": "int32"
          },
          "description": {
            "type": "string",
            "description": "Contract brief description"
          },
          "category": {
            "type": "string",
            "description": "Contract category"
          },
          "supplierClientId": {
            "type": "string",
            "description": "Supplier Id in client's ERP"
          },
          "integrationTag": {
            "type": "string",
            "description": "Identification of the ME user used in the integration."
          },
          "startDate": {
            "type": "string",
            "description": "Contract start date",
            "format": "date-time"
          },
          "endDate": {
            "type": "string",
            "description": "Contract end date",
            "format": "date-time"
          },
          "clientPaymentConditionId": {
            "type": "string",
            "description": "Payment condition code"
          },
          "freightValue": {
            "type": "number",
            "description": "Freight value",
            "format": "double",
            "nullable": true
          },
          "currency": {
            "type": "string",
            "description": "Currency in alphabetic code (for more information, please refer to: https://www.iso.org/iso-4217-currency-codes.html)."
          },
          "deliveryDeadline": {
            "type": "integer",
            "description": "Delivery deadline",
            "format": "int32",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "description": "Contract status",
            "format": "int32",
            "nullable": true
          },
          "totalValue": {
            "type": "number",
            "description": "Contract total value",
            "format": "double",
            "nullable": true
          },
          "fixedValue": {
            "type": "number",
            "description": "Contract fixed value",
            "format": "double",
            "nullable": true
          },
          "usedValue": {
            "type": "number",
            "description": "Contract used value",
            "format": "double",
            "nullable": true
          },
          "contractCode": {
            "type": "integer",
            "description": "Contract type code",
            "format": "int32",
            "nullable": true
          },
          "documentDate": {
            "type": "string",
            "description": "Document date",
            "format": "date-time"
          },
          "note": {
            "type": "string",
            "description": "Contract notes"
          },
          "isCreatedPreOrderAutomatically": {
            "type": "boolean",
            "description": "This flag indicates if the pre-order is generated automatically.",
            "nullable": true
          },
          "isControlsBalance": {
            "type": "boolean",
            "description": "This flag indicates if the contract balance is controlled by workflow.",
            "nullable": true
          },
          "isRequestEstimatedPriceInPreOrder": {
            "type": "boolean",
            "description": "This flag indicates if the request estimated price is used in pre-order creation.",
            "nullable": true
          },
          "quotationId": {
            "type": "integer",
            "description": "Quotation Id associated with the contract.",
            "format": "int32",
            "nullable": true
          },
          "isActive": {
            "type": "boolean",
            "description": "This flag indicates if the contract is active.",
            "nullable": true
          },
          "supplierId": {
            "type": "integer",
            "description": "Supplier Id in ME",
            "format": "int32",
            "nullable": true
          },
          "buyerId": {
            "type": "integer",
            "description": "Buyer Id in ME",
            "format": "int32",
            "nullable": true
          },
          "purchasingGroup": {
            "type": "string",
            "description": "Purchasing Group",
            "nullable": true
          },
          "incoterms": {
            "type": "string",
            "description": "Freight code (Incoterms - International Commercial Terms)",
            "nullable": true
          },
          "attributes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Attributes"
            },
            "description": "Attributes of the contract, consisting of a name and a value."
          },
          "balanceControl": {
            "$ref": "#/components/schemas/BalanceControl"
          },
          "clientContractId": {
            "type": "string",
            "description": "Contract Id in client's ERP",
            "nullable": true
          },
          "parentContractId": {
            "type": "integer",
            "description": "Related original contract",
            "format": "int32",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "GetItemsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetItemsResponseData"
            }
          },
          "hits": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "next": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "GetItemsResponseData": {
        "type": "object",
        "properties": {
          "itemId": {
            "type": "integer",
            "description": "Sequential number of the item in the ME.",
            "format": "int32"
          },
          "contractId": {
            "type": "integer",
            "description": "Sequential number of the contract in the ME.",
            "format": "int32"
          },
          "productCode": {
            "type": "string",
            "description": "Product code"
          },
          "materialCode": {
            "type": "string",
            "description": "Material code"
          },
          "description": {
            "type": "string",
            "description": "Small description of the item."
          },
          "productGroupCode": {
            "type": "string",
            "description": "The client code for the material group."
          },
          "price": {
            "type": "number",
            "description": "Item price",
            "format": "double",
            "nullable": true,
            "deprecated": true
          },
          "priceValue": {
            "type": "number",
            "description": "Item price.",
            "format": "double",
            "nullable": true
          },
          "measurementUnit": {
            "type": "string",
            "description": "Item measurement unit"
          },
          "deliveryDeadline": {
            "type": "integer",
            "description": "Delivery deadline",
            "format": "int32",
            "nullable": true
          },
          "quantity": {
            "type": "number",
            "description": "Item quantity",
            "format": "double",
            "nullable": true
          },
          "netPrice": {
            "type": "number",
            "description": "Net price",
            "format": "double",
            "nullable": true,
            "deprecated": true
          },
          "netPriceValue": {
            "type": "number",
            "description": "Net price.",
            "format": "double",
            "nullable": true
          },
          "materialApplication": {
            "type": "string",
            "description": "Material usage in the ERP."
          },
          "isCanceled": {
            "type": "boolean",
            "description": "Cancelado",
            "nullable": true
          },
          "materialCategory": {
            "type": "string",
            "description": "Material category"
          },
          "itemQuantityBalance": {
            "type": "number",
            "description": "Item quantity balance",
            "format": "double",
            "nullable": true
          },
          "rfqItemId": {
            "type": "integer",
            "description": "Quotation item number",
            "format": "int32",
            "nullable": true
          },
          "rfqId": {
            "type": "integer",
            "description": "Quotation Id",
            "format": "int32",
            "nullable": true
          },
          "groupID": {
            "type": "integer",
            "description": "ME Product Group ID",
            "format": "int32",
            "nullable": true
          },
          "clientGroupDescription": {
            "type": "string",
            "description": "Product group description",
            "nullable": true
          },
          "incoTerms": {
            "type": "string",
            "description": "Freight code (Incoterms)",
            "nullable": true
          },
          "freightValue": {
            "type": "number",
            "description": "Freight value (Incoterms)",
            "format": "double",
            "nullable": true
          },
          "ivaCode": {
            "type": "string",
            "description": "IVA Code",
            "nullable": true
          },
          "vatRounding": {
            "type": "number",
            "description": "IVA rounding value",
            "format": "double",
            "nullable": true
          },
          "requestID": {
            "type": "integer",
            "description": "ME Request ID",
            "format": "int32",
            "nullable": true
          },
          "requestItemId": {
            "type": "integer",
            "description": "It is the sequential number of the request item.",
            "format": "int32",
            "nullable": true
          },
          "complement": {
            "type": "string",
            "description": "Product complement description",
            "nullable": true
          },
          "productIdentification": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductIdentification"
            },
            "description": "Product identification code is a list with a type and a value (in Brazil the \"Mercosul Common Nomenclature (NCM)\" is used).",
            "nullable": true,
            "deprecated": true
          },
          "taxClassification": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaxClassification"
            },
            "description": "Fiscal classification codes as type/value pairs: the same NBM/NCM entries as productIdentification,\nplus the 2027 tax reform codes NBS, CST-CBSIBS, cClassTribCBSIBS, CST-IS and cClassTribIS.",
            "nullable": true
          },
          "ibscbsCalculationBasis": {
            "type": "number",
            "description": "Calculation basis in value used to calculate the tax (same basis for IBS and CBS).\nObsolete: use taxInformation.taxableAmount, which carries the same value.",
            "format": "double",
            "nullable": true,
            "deprecated": true
          },
          "fullPrice": {
            "type": "number",
            "description": "Full price of the item",
            "format": "double",
            "nullable": true
          },
          "materialOrigin": {
            "type": "integer",
            "description": "Identifier of the material's origin (e.g., domestic, imported) used in tax calculations. \nPossible values: \n- 1 = Domestic origin\n- 2 = Foreign origin",
            "format": "int32",
            "nullable": true
          },
          "taxInformation": {
            "$ref": "#/components/schemas/TaxInformation"
          },
          "attributes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Attributes"
            },
            "description": "Attributes of the item, consisting of a name and a value.",
            "nullable": true
          },
          "sapNetValue": {
            "type": "number",
            "description": "Field corresponding to SAP's Net Value, used to calculate \"POR\".",
            "format": "double",
            "nullable": true
          },
          "subItems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SubItem"
            },
            "description": "List of sub-items within the contract item, containing detailed product and tax information.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "GetManyResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetByIdResponse"
            }
          },
          "hits": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "next": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "GetPartnerSuppliersResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetPartnerSuppliersResponseData"
            }
          },
          "hits": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "next": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "GetPartnerSuppliersResponseData": {
        "type": "object",
        "properties": {
          "supplierId": {
            "type": "integer",
            "description": "ME Supplier ID",
            "format": "int32"
          },
          "clientSupplierId": {
            "type": "string",
            "description": "Supplier code in the ERP",
            "nullable": true
          },
          "tradingName": {
            "type": "string",
            "description": "Supplier's trade name",
            "nullable": true
          },
          "companyName": {
            "type": "string",
            "description": "Supplier's company name",
            "nullable": true
          },
          "stateRegistrationNumber": {
            "type": "string",
            "description": "Supplier state registration number",
            "nullable": true
          },
          "documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Document"
            },
            "description": "Data related to the company national registration documents",
            "nullable": true
          },
          "address": {
            "type": "string",
            "description": "Supplier address",
            "nullable": true
          },
          "city": {
            "type": "string",
            "description": "Supplier city",
            "nullable": true
          },
          "state": {
            "type": "string",
            "description": "Supplier state",
            "nullable": true
          },
          "postalCode": {
            "type": "string",
            "description": "Supplier postal code",
            "nullable": true
          },
          "country": {
            "type": "string",
            "description": "Supplier country",
            "nullable": true
          },
          "contact": {
            "type": "string",
            "description": "Supplier contact name",
            "nullable": true
          },
          "email": {
            "type": "string",
            "description": "Supplier email",
            "nullable": true
          },
          "phoneNumber": {
            "type": "string",
            "description": "Supplier phone number",
            "nullable": true
          },
          "partnerTypeCode": {
            "type": "string",
            "description": "Partner type code in the contract",
            "nullable": true
          },
          "partnerTypeDescription": {
            "type": "string",
            "description": "Partner role description in the contract",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "GetRequestsResponse": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetRequestsResponseData"
            }
          },
          "hits": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "next": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "GetRequestsResponseData": {
        "type": "object",
        "properties": {
          "requestId": {
            "type": "integer",
            "description": "Identifier of the request specified in the contract.",
            "format": "int32"
          },
          "requestItemId": {
            "type": "integer",
            "description": "It is the sequential number of the request item.",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "PagingResult`1": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WatcherResponseData"
            }
          },
          "hits": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "next": {
            "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": {}
      },
      "ProductIdentification": {
        "required": [
          "type",
          "value"
        ],
        "type": "object",
        "properties": {
          "type": {
            "minLength": 1,
            "type": "string",
            "description": "Product type (in Brazil the \"Mercosul Common Nomenclature (NCM)\" is used)."
          },
          "value": {
            "minLength": 1,
            "type": "string",
            "description": "Product value (in Brazil the \"Mercosul Common Nomenclature (NCM)\" is used)."
          }
        },
        "additionalProperties": false
      },
      "SubItem": {
        "type": "object",
        "properties": {
          "subItemNumber": {
            "type": "integer",
            "description": "Sequential number of the subitem in the ME (within the contract item).",
            "format": "int32"
          },
          "clientProductId": {
            "type": "string",
            "description": "Product code in the client's ERP system.",
            "nullable": true
          },
          "estimatedDeadline": {
            "type": "integer",
            "description": "Estimated delivery deadline in days.",
            "format": "int32",
            "nullable": true
          },
          "manufacturer": {
            "type": "string",
            "description": "Manufacturers of the product.",
            "nullable": true
          },
          "productGroupId": {
            "type": "integer",
            "description": "Product group identifier in ME",
            "format": "int32",
            "nullable": true
          },
          "isGeneric": {
            "type": "boolean",
            "description": "Indicates if the product is generic. Set this flag as follows:\n- True = Product without a code\n- False = Product with a code",
            "nullable": true
          },
          "applicationType": {
            "type": "string",
            "description": "Material application code.",
            "nullable": true
          },
          "quantity": {
            "type": "number",
            "description": "Quantity of the sub-item.",
            "format": "double"
          },
          "unitPrice": {
            "type": "number",
            "description": "Unit price of the sub-item.",
            "format": "double",
            "nullable": true
          },
          "description": {
            "type": "string",
            "description": "Description of the sub-item.",
            "nullable": true
          },
          "complement": {
            "type": "string",
            "description": "Additional complement information for the sub-item.",
            "nullable": true
          },
          "measurementUnit": {
            "type": "string",
            "description": "Measurement unit for the sub-item (e.g., \"UN\", \"KG\", \"M\").",
            "nullable": true
          },
          "isCanceled": {
            "type": "boolean",
            "description": "Indicates if the sub-item is canceled.",
            "nullable": true
          },
          "taxInformation": {
            "$ref": "#/components/schemas/SubItemTaxInformation"
          }
        },
        "additionalProperties": false,
        "description": "Represents a sub-item within a contract item, containing detailed product and tax information."
      },
      "SubItemTax": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "This field informs the tax name used in the country. The options are:\n\"ICMS\"\n\"IPI\"\n\"ISS\""
          },
          "taxRate": {
            "type": "number",
            "description": "Value of the tax.",
            "format": "double",
            "nullable": true
          },
          "taxApplication": {
            "$ref": "#/components/schemas/SubitemTaxApplication"
          }
        },
        "additionalProperties": false
      },
      "SubItemTaxInformation": {
        "type": "object",
        "properties": {
          "taxes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SubItemTax"
            },
            "description": "List of taxes applied to the sub-item."
          }
        },
        "additionalProperties": false,
        "description": "Taxes information."
      },
      "SubitemTaxApplication": {
        "enum": [
          "Free",
          "Included",
          "NotIncluded",
          "NotInformed"
        ],
        "type": "string",
        "description": "This field informs if any tax will be applied. The options are:\n\"Free\" = No tax applied.\n\"Included\" = Included in the price.\n\"NotIncluded\" = Not included in the price.\n\"NotInformed\" = No fee was informed."
      },
      "Tax": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Tax name used in the country.",
            "nullable": true
          },
          "aliquot": {
            "type": "number",
            "description": "Percentage rate for regular taxes; monetary amount per unit of taxable quantity (ad rem rate) for monophasic taxes.",
            "format": "double",
            "nullable": true
          },
          "reducedAliquot": {
            "type": "number",
            "description": "Reduced Tax rate",
            "format": "double",
            "nullable": true
          },
          "taxApplication": {
            "$ref": "#/components/schemas/TaxApplication"
          },
          "taxAmount": {
            "type": "number",
            "description": "The tax amount for the item, as provided by the upstream service (not calculated here).\n`null` when not provided; an explicit zero is kept. A 2027 tax reform field: omitted\nfrom every entry for tenants that haven't opted in.",
            "format": "double",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "TaxApplication": {
        "enum": [
          "Free",
          "Included",
          "NotIncluded",
          "NotInformed",
          "ZeroRate",
          "NotApplicable"
        ],
        "type": "string",
        "description": "This field informs if any tax will be applied. The options are:"
      },
      "TaxClassification": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "Classification type: \"NBM\"/\"NCM\" and the 2027 tax reform types \"NBS\", \"CST-CBSIBS\",\n\"cClassTribCBSIBS\", \"CST-IS\" and \"cClassTribIS\"."
          },
          "value": {
            "type": "string",
            "description": "Classification code, as a string so leading zeros are kept."
          }
        },
        "additionalProperties": false,
        "description": "A fiscal classification of the item: a classification type and its code."
      },
      "TaxInformation": {
        "type": "object",
        "properties": {
          "calculationBasis": {
            "type": "number",
            "description": "Calcultation basis (0 to 100 (percentage))",
            "format": "double",
            "nullable": true
          },
          "calculationBasisWithTax": {
            "type": "string",
            "description": "Calcultation basis with tax:\n\"S\": tax applied.\n\"N\": no tax applied.",
            "nullable": true
          },
          "taxableAmount": {
            "type": "number",
            "description": "The monetary amount used as the calculation basis for IBS and CBS.\nReplaces the item-level `ibscbsCalculationBasis` and carries the same value.\nReturned regardless of the tax reform flag.",
            "format": "double",
            "nullable": true
          },
          "taxableAmountIS": {
            "type": "number",
            "description": "Taxable amount used as the calculation basis for the Selective Tax (IS).\nOnly sent when the workflow parameter \"EnviaCamposReformaTributaria2027\" is enabled.",
            "format": "double",
            "nullable": true
          },
          "monophasicIBSCBSTaxableQuantity": {
            "type": "number",
            "description": "Calculation basis of the monophasic IBS/CBS. Under the monophasic regime the\nbasis is the quantity of the item, not a value, it is what the ad rem rate multiplies.\nOnly sent when the workflow parameter \"EnviaCamposReformaTributaria2027\" is enabled.",
            "format": "double",
            "nullable": true
          },
          "monophasicTaxableQuantityIS": {
            "type": "number",
            "description": "Calculation basis of the monophasic selective tax. Under the monophasic regime the\nbasis is the quantity of the item, not a value.\nOnly sent when the workflow parameter \"EnviaCamposReformaTributaria2027\" is enabled.",
            "format": "double",
            "nullable": true
          },
          "taxes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Tax"
            },
            "description": "A list of the taxes applied in the country.",
            "nullable": true
          },
          "taxSubstitutions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaxSubstitution"
            },
            "description": "A list of the tax substitutions applied in the country.\nDefinition note: Substitution in the responsibility of paying taxes (“ST” or “Substitução Tributária“, in Portuguese).",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Tax information"
      },
      "TaxInformationDto": {
        "type": "object",
        "properties": {
          "name": {
            "$ref": "#/components/schemas/TaxName"
          },
          "aliquot": {
            "minimum": 0,
            "type": "number",
            "description": "Tax rate",
            "format": "float",
            "nullable": true
          },
          "reducedAliquot": {
            "type": "number",
            "description": "Reduced Tax rate",
            "format": "float",
            "nullable": true
          },
          "taxApplication": {
            "$ref": "#/components/schemas/TaxApplication"
          }
        },
        "additionalProperties": false
      },
      "TaxName": {
        "enum": [
          "ICMS",
          "IPI",
          "ISS",
          "CIDE",
          "IRRF",
          "IBS",
          "CBS",
          "MunicipalIBS",
          "PIS",
          "COFINS"
        ],
        "type": "string",
        "description": "This field informs the tax name used in the country. The options are:"
      },
      "TaxSubstitution": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "Tax substitution type"
          },
          "aliquot": {
            "type": "number",
            "description": "Tax rate",
            "format": "double",
            "nullable": true
          },
          "value": {
            "type": "number",
            "description": "Tax substitution value",
            "format": "double",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "UpdateCommand": {
        "type": "object",
        "properties": {
          "clientContractId": {
            "maxLength": 20,
            "type": "string",
            "description": "Contract Id in client's ERP",
            "nullable": true
          },
          "description": {
            "maxLength": 50,
            "type": "string",
            "description": "Contract brief description",
            "nullable": true
          },
          "category": {
            "maxLength": 20,
            "type": "string",
            "description": "Contract category",
            "nullable": true
          },
          "supplierId": {
            "type": "integer",
            "description": "Supplier Id in ME",
            "format": "int32",
            "nullable": true
          },
          "clientSupplierId": {
            "type": "string",
            "description": "Supplier Id in client's ERP",
            "nullable": true
          },
          "integrationTag": {
            "type": "string",
            "description": "Identification of the ME user used in the integration.",
            "nullable": true
          },
          "startDate": {
            "type": "string",
            "description": "Contract start date",
            "format": "date-time",
            "nullable": true
          },
          "endDate": {
            "type": "string",
            "description": "Contract end date",
            "format": "date-time",
            "nullable": true
          },
          "clientPaymentConditionId": {
            "maxLength": 100,
            "type": "string",
            "description": "Payment condition code",
            "nullable": true
          },
          "incoTerms": {
            "maxLength": 100,
            "type": "string",
            "description": "Freight code (Incoterms - International Commercial Terms)",
            "nullable": true
          },
          "currencyCode": {
            "maxLength": 20,
            "type": "string",
            "description": "Currency in alphabetic code (for more information, please refer to: https://www.iso.org/iso-4217-currency-codes.html).",
            "nullable": true
          },
          "deliveryDeadline": {
            "minimum": 0,
            "type": "integer",
            "description": "Delivery deadline",
            "format": "int32",
            "nullable": true
          },
          "status": {
            "minimum": 0,
            "type": "integer",
            "description": "Contract status",
            "format": "int32",
            "nullable": true
          },
          "totalValue": {
            "minimum": 0,
            "type": "number",
            "description": "Contract total value",
            "format": "float",
            "nullable": true
          },
          "fixedValue": {
            "minimum": 0,
            "type": "number",
            "description": "Contract fixed value",
            "format": "float",
            "nullable": true
          },
          "usedValue": {
            "minimum": 0,
            "type": "number",
            "description": "Contract used value",
            "format": "float",
            "nullable": true
          },
          "note": {
            "type": "string",
            "description": "Contract notes",
            "nullable": true
          },
          "isPreOrderCreatedAutomatically": {
            "type": "boolean",
            "description": "This flag indicates if the pre-order is generated automatically.",
            "nullable": true
          },
          "isControlledByBalance": {
            "type": "boolean",
            "description": "This flag indicates if the contract balance is controlled by workflow.",
            "nullable": true
          },
          "isRequestEstimatedPriceUsedInPreOrder": {
            "type": "boolean",
            "description": "This flag indicates if the request estimated price is used in pre-order creation.",
            "nullable": true
          },
          "isPreOrderBlockedIfEstimatedRequestDateGreaterThanContractEndDate": {
            "type": "boolean",
            "description": "This flag indicates if the pre-order is blocked if the request estimated date is greather than contract end date.",
            "nullable": true
          },
          "purchasingGroup": {
            "maxLength": 20,
            "type": "string",
            "description": "Purchasing Group",
            "nullable": true
          },
          "refusalNote": {
            "type": "string",
            "description": "Reason for contract refusal",
            "nullable": true
          },
          "attributes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AttributeDto"
            },
            "description": "Attributes of the contract, consisting of a name, a value and a description.",
            "nullable": true
          },
          "businessOrganizations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BusinessOrganizationDto"
            },
            "description": "List with the Business Organizations comprising the Company Code, the Entity Type and their Descriptions.",
            "nullable": true
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContractItemDto"
            },
            "description": "List with the contract items",
            "nullable": true
          },
          "balanceControl": {
            "$ref": "#/components/schemas/BalanceControl"
          },
          "freightValue": {
            "type": "number",
            "description": "Freight Value",
            "format": "double",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "UpdateResponse": {
        "type": "object",
        "properties": {
          "correlationId": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "UpdateStatusCommand": {
        "required": [
          "status"
        ],
        "type": "object",
        "properties": {
          "clientContractId": {
            "type": "string",
            "description": "Contract Id in the client's ERP"
          },
          "status": {
            "type": "integer",
            "description": "Contract status",
            "format": "int32"
          },
          "clientSupplierId": {
            "type": "string",
            "description": "Supplier code in the client's ERP"
          },
          "approvalDate": {
            "type": "string",
            "description": "Contract confirmation date",
            "format": "date-time"
          },
          "statusDocument": {
            "type": "integer",
            "description": "Document status for pending acceptance/rejection. The possible values are:\n- 1 = Confirmed\n- 2 = Rejected",
            "format": "int32",
            "nullable": true
          },
          "note": {
            "type": "string",
            "description": "Contract Notes"
          },
          "freightValue": {
            "type": "number",
            "description": "Freight Value",
            "format": "double",
            "nullable": true
          },
          "incoTerms": {
            "type": "string",
            "description": "Freight code (Incoterms - International Commercial Terms)",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "UpdateStatusResponse": {
        "type": "object",
        "properties": {
          "correlationId": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "WatcherResponseData": {
        "type": "object",
        "properties": {
          "userId": {
            "type": "integer",
            "description": "Internal ME user identifier",
            "format": "int32"
          },
          "name": {
            "type": "string",
            "description": "Full name of the user",
            "nullable": true
          },
          "login": {
            "type": "string",
            "description": "User login",
            "nullable": true
          },
          "integrationTag": {
            "type": "string",
            "description": "Identification of the ME user used in the integration",
            "nullable": true
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "description": "Please enter your JWT (Without the 'Bearer' word in the beginning).",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "security": [
    {
      "bearer": []
    }
  ],
  "tags": [
    {
      "name": "Approvers"
    },
    {
      "name": "Contracts"
    },
    {
      "name": "Items"
    },
    {
      "name": "Partner Suppliers"
    },
    {
      "name": "Watchers"
    }
  ]
}