{
  "openapi": "3.0.1",
  "info": {
    "title": "Order Comments",
    "version": "9.1.20.0",
    "description": "Fetches a collection of order comments.",
    "x-introduced": "9.1.13.0"
  },
  "servers": [
    {
      "url": "https://{hostname}:{port}/rest/admin/v2",
      "variables": {
        "port": {
          "default": "443",
          "enum": [
            "443",
            "8000"
          ]
        },
        "hostname": {
          "default": "localhost",
          "enum": [
            "localhost",
            "test.hcl.com"
          ]
        }
      }
    }
  ],
  "tags": [
    {
      "name": "Order Comments",
      "description": "Provides RESTful service to fetch order comments."
    }
  ],
  "paths": {
    "/order-comments": {
      "get": {
        "tags": [
          "Order Comments"
        ],
        "summary": "Get order comments based on provided parameters.",
        "description": "Get all the order comments based on provided parameters",
        "operationId": "getAllOrderComments",
        "parameters": [
          {
            "name": "storeId",
            "in": "query",
            "description": "The unique numeric ID for identifying the store.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "orderId",
            "in": "query",
            "description": "The unique numeric ID for identifying the order.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "csrId",
            "in": "query",
            "description": "The unique numeric ID for identifying the customer service representative.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "userId",
            "in": "query",
            "description": "The unique numeric ID for identifying the Shopper.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "auto",
            "in": "query",
            "description": "Filter comments to also include auto generated comments. By default auto is assumed to be false when it is not specified, and in this case only the manual comments will be queried. When auto is set to true, both manual and auto comments will be queried.",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "component",
            "in": "query",
            "description": "Filter comments belonging to the specified component.<br>Available values: <br> <ul><li> ORD - Order</li> <li> ORDI - Order Item </li> <li> APP - Appeasement </li> <li> APPI - Appeasement Item </li> <li> RTN - Order Return </li> <li>RTNI - Order Return Item </li> </ul>",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "ORD",
                "ORDI",
                "APP",
                "APPI",
                "RTN",
                "RTNI"
              ]
            }
          },
          {
            "name": "reasonId",
            "in": "query",
            "description": "Filter comments belonging to the specified order change reason code.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "The position within the resulting dataset where the query begins returning item records. If the offset is \"5\", the records that returned begin with the sixth record that matches the query parameters. If the offset is \"0\", the records that are returned begin with the first record that matches the query parameters.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "The maximum number of records to return.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The request completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderCommentsCollection"
                }
              }
            }
          },
          "400": {
            "description": "Bad request. The request could not be understood by the server due to malformed syntax.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated. The user session is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "403": {
            "description": "The user is not authorized to perform the specified request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error. For details, see the server log files.",
            "content": {}
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ErrorResponseContainer": {
        "type": "object",
        "properties": {
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Error"
            }
          },
          "requestId": {
            "type": "string",
            "description": "The request identifier."
          }
        },
        "description": "The error message model."
      },
      "Error": {
        "type": "object",
        "properties": {
          "errorCode": {
            "type": "string",
            "description": "The error message code."
          },
          "errorMessage": {
            "type": "string",
            "description": "The error message."
          },
          "errorKey": {
            "type": "string",
            "description": "The error message key."
          },
          "errorParameters": {
            "type": "array",
            "description": "The arguments used to construct the error message.",
            "items": {
              "type": "object",
              "properties": {}
            }
          },
          "errorLevel": {
            "type": "string",
            "description": "The error level."
          },
          "errorHref": {
            "type": "string",
            "description": "The error hypertext reference."
          }
        },
        "description": "The error message item model."
      },
      "OrderCommentsCollection": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "description": "The count shows total number of Comments.",
            "format": "int32"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderComments"
            }
          }
        }
      },
      "OrderComments": {
        "type": "object",
        "properties": {
          "commentId": {
            "type": "string",
            "description": "The unique numeric ID for identifying the Order Comment."
          },
          "orderId": {
            "type": "string",
            "description": "The unique numeric ID for identifying the Order which the comment is associated with."
          },
          "orderVersion": {
            "type": "integer",
            "format": "int32",
            "nullable": true,
            "description": "The order version the comment is associated to."
          },
          "csrLogonId": {
            "type": "string",
            "nullable": true,
            "description": "The logon id of the CSR user who created the comment."
          },
          "auto": {
            "type": "boolean",
            "description": "Flag to indicate if a comment is automatically generated."
          },
          "comment": {
            "type": "string",
            "description": "The content of the order comment."
          },
          "changeReasonId": {
            "type": "integer",
            "format": "int32",
            "description": "The unique numeric ID of the change reason associated to the comment."
          },
          "updatedDateTime": {
            "type": "string",
            "description": "The date and time that the comment was last updated.",
            "format": "timestamp",
            "example": "2023-05-10T05:01:08.877000000Z"
          },
          "component": {
            "type": "string",
            "description": "The belonging component of the comment. <br>Available values: <br> <ul><li> ORD - Order</li> <li> ORDI - Order Item </li> <li> APP - Appeasement </li> <li> APPI - Appeasement Item </li> <li> RTN - Order Return </li> <li>RTNI - Order Return Item </li> </ul>"
          },
          "componentId": {
            "type": "string",
            "description": "A component id like RMA is RMAId, Appeasement is appeasementId."
          }
        }
      }
    },
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "security": [
    {
      "basicAuth": []
    }
  ]
}
