{
  "openapi": "3.0.1",
  "info": {
    "title": "Returns",
    "version": "9.1.12.0",
    "description": "Create and administer a collection of returns."
  },
  "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": "Return Items",
      "description": "This class provides RESTful service to manage return items."
    }
  ],
  "paths": {
    "/return-items": {
      "post": {
        "tags": [
          "Return Items"
        ],
        "summary": "Create a new return item.",
        "description": "Create a new return item.",
        "operationId": "Return-Item-post",
        "parameters": [
          {
            "name": "storeId",
            "in": "query",
            "description": "The unique numeric ID for identifying the store.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "description": "Request body.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReturnItem"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "The requested resource has been created.",
            "headers": {
              "Location": {
                "description": "Link to the newly created resource.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {},
            "links": {
              "GetReturnItemById": {
                "operationRef": "#/paths/~1return-items~1{id}/get",
                "parameters": {
                  "id": "$request.body#/orderItemId",
                  "storeId": "$request.query.storeId"
                },
                "description": "The `id`,`storeId`value used in the request body can be used as the `id`,`storeId` parameter in `GET/return-items/{id}`.\n"
              },
              "DeleteReturnItemById": {
                "operationRef": "#/paths/~1return-items~1{id}/delete",
                "parameters": {
                  "id": "$request.body#/orderItemId",
                  "storeId": "$request.query.storeId"
                },
                "description": "The `id`,`storeId` value used in the request body can be used as the `id`,`storeId` parameter in `DELETE /return-items/{id}`.\n"
              },
              "UpdateReturnItemById": {
                "operationRef": "#/paths/~1return-items~1{id}/patch",
                "parameters": {
                  "id": "$request.body#/orderItemId",
                  "storeId": "$request.query.storeId"
                },
                "description": "The `id`,`storeId` value used in the request body can be used as the `id`,`storeId` parameter in `PATCH /return-items/{id}`.\n"
              }
            }
          },
          "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": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          }
        },
        "x-codegen-request-body-name": "body"
      }
    },
    "/return-items/{id}": {
      "get": {
        "tags": [
          "Return Items"
        ],
        "summary": "Get a return item by ID.",
        "description": "Get a return item by ID.",
        "operationId": "ReturnItem-getById",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The unique numeric ID for identifying the return item.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "description": "The unique numeric ID for identifying the store.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The requested completed successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReturnItemDetails"
                }
              }
            }
          },
          "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": {}
          }
        }
      },
      "delete": {
        "tags": [
          "Return Items"
        ],
        "summary": "Delete a return item by ID.",
        "description": "Delete a return item by ID",
        "operationId": "Return-Item-delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The unique numeric ID for identifying the return item.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "description": "The unique numeric ID for identifying the store.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "The requested resource has been deleted.",
            "content": {}
          },
          "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": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Return Items"
        ],
        "summary": "Update an existing return item.",
        "description": "Update an existing return item by its ID.",
        "operationId": "Return-Item-update",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The unique numeric ID for identifying the return item.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "description": "The unique numeric ID for identifying the store.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "requestBody": {
          "description": "The request body for updating a return item.",
          "content": {
            "*/*": {
              "schema": {
                "$ref": "#/components/schemas/ReturnItemUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The requested completed successfully.",
            "content": {}
          },
          "400": {
            "description": "Bad request. The request could not be understood by the server due to malformed syntax.",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated. The user session is not valid.",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "403": {
            "description": "The user is not authorized to perform the specified request.",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "404": {
            "description": "The specified resource could not be found.",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error. For details, see the server log files.",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          }
        },
        "x-codegen-request-body-name": "body"
      }
    }
  },
  "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": {
          "code": {
            "type": "string",
            "description": "The error message code."
          },
          "correlationId": {
            "type": "string",
            "description": "The unique identifier for the request."
          },
          "locale": {
            "type": "string",
            "description": "The locale of the error message."
          },
          "message": {
            "type": "string",
            "description": "The error message."
          },
          "messageArguments": {
            "type": "array",
            "description": "The arguments used to construct the error message.",
            "items": {
              "type": "object",
              "properties": {}
            }
          },
          "messageKey": {
            "type": "string",
            "description": "The error message key."
          }
        },
        "description": "The error message item model."
      },
      "ReturnItem": {
        "type": "object",
        "properties": {
          "customerId": {
            "type": "integer",
            "description": "The unique numeric ID for identifying the customer who created the return item",
            "format": "int64"
          },
          "orderItemId": {
            "type": "integer",
            "description": "The unique numeric ID for identifying the order item associated with this return item.",
            "format": "int64"
          },
          "returnId": {
            "type": "integer",
            "description": "The unique numeric ID for identifying the return of which this return item is a part.",
            "format": "int64"
          },
          "returnQuantity": {
            "type": "number",
            "description": "The quantity being purchased."
          }
        }
      },
      "ReturnItemUpdate": {
        "type": "object",
        "properties": {
          "adjustment": {
            "type": "number",
            "description": "Any adjustment to be made to the credit amount by a Customer Service Representative."
          },
          "comment": {
            "type": "string",
            "description": "Comment that applies to the return item."
          },
          "customerId": {
            "type": "integer",
            "description": "The unique numeric ID for identifying the customer who created the return item",
            "format": "int64"
          },
          "reasonForReturnCode": {
            "type": "string",
            "description": "The reason for the item to be returned."
          },
          "returnQuantity": {
            "type": "number",
            "description": "The quantity being purchased."
          },
          "shouldReceive": {
            "type": "string",
            "description": "A flag that indicates whether this component will actually be received by the seller. \n* 'Y' - Expected to be received.\n* 'N' - Will not be received.\n* 'S' - System forced. Will not be received.\n",
            "enum": [
              "Y",
              "N",
              "S"
            ]
          }
        }
      },
      "ReturnItemDetails": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "The unique numeric ID for identifying the return item.",
            "format": "int64"
          },
          "adjustment": {
            "type": "number",
            "description": "Any adjustment to be made to the credit amount by a Customer Service Representative."
          },
          "adjustmentCredit": {
            "type": "number",
            "description": "The adjustment, from the original order, to be credited."
          },
          "catalogEntryId": {
            "type": "integer",
            "description": "The unique numeric ID for identifying the catalog entry associated with this return item.",
            "format": "int64"
          },
          "comment": {
            "type": "string",
            "description": "Comment that applies to the return item."
          },
          "creditDateTime": {
            "type": "string",
            "description": "The date and time that the credit was initiated.",
            "format": "date-time"
          },
          "customerId": {
            "type": "integer",
            "description": "The unique numeric ID for identifying the customer who created the return item",
            "format": "int64"
          },
          "inventoryQuantity": {
            "type": "number",
            "description": "Quantity in inventory units of this component"
          },
          "orderItemId": {
            "type": "integer",
            "description": "The unique numeric ID for identifying the order item associated with this return item.",
            "format": "int64"
          },
          "reasonForReturnCode": {
            "type": "string",
            "description": "The reason for the item to be returned."
          },
          "returnId": {
            "type": "integer",
            "description": "The unique numeric ID for identifying the return of which this return item is a part.",
            "format": "int64"
          },
          "returnQuantity": {
            "type": "number",
            "description": "The quantity being purchased."
          },
          "shouldReceive": {
            "type": "string",
            "description": "A flag that indicates whether this component will actually be received by the seller. \n* 'Y' - Expected to be received.\n* 'N' - Will not be received.\n* 'S' - System forced. Will not be received.\n",
            "enum": [
              "Y",
              "N",
              "S"
            ]
          },
          "status": {
            "type": "string",
            "description": "The status of the RMAItem.\n* 'PND' - pending\n* 'APP' - automatically approved\n* 'MAN' - manually approved\n",
            "enum": [
              "PND",
              "APP",
              "MAN"
            ]
          },
          "totalCredit": {
            "type": "number",
            "description": "Total credit for the return Item."
          },
          "updatedDateTime": {
            "type": "string",
            "description": "The date and time that the return item was last updated.",
            "format": "date-time"
          }
        }
      }
    },
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "security": [
    {
      "basicAuth": []
    }
  ],
  "x-components": {}
}
