{
  "openapi": "3.0.1",
  "info": {
    "title": "Store Relationships",
    "description": "Create and administer a collection of store relationships.",
    "version": "9.1.20.0",
    "x-introduced": "9.1.0.0"
  },
  "servers": [
    {
      "url": "https://{hostname}:{port}/rest/admin/v2",
      "variables": {
        "port": {
          "default": "443",
          "enum": [
            "443",
            "8000"
          ]
        },
        "hostname": {
          "default": "localhost",
          "enum": [
            "localhost",
            "test.hcl.com"
          ]
        }
      }
    }
  ],
  "paths": {
    "/store-relationships": {
      "get": {
        "tags": [
          "store-relationships"
        ],
        "description": "Get a collection of store relationships.",
        "operationId": "getStoreRelationships",
        "parameters": [
          {
            "name": "storeRelationshipTypeId",
            "in": "query",
            "description": "The store relationship type ID.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "relatedStoreId",
            "in": "query",
            "description": "The related store ID.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "storeId",
            "in": "query",
            "description": "The store ID.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "sequence",
            "in": "query",
            "description": "The selection sequence number. Used when the store has multiple related stores for the same relationship type.",
            "schema": {
              "type": "number",
              "format": "double"
            }
          },
          {
            "name": "state",
            "in": "query",
            "description": "The state of the relationship. Valid values are as follows, 0 = inactive. 1 = active.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "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"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "The maximum number of records to return.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "The comma-separated set of properties to be returned. If no properties are specified, all properties are returned.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "expand",
            "in": "query",
            "description": "The comma-separated set of related resources referenced in the links to be returned. If no related resources are specified, no related resources are returned.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A collection of store relationships.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoreRelationshipCollection"
                },
                "example": {
                  "href": "https://10.190.66.10:8000/rest/admin/v2/store-relationships?storeId=2",
                  "count": 55,
                  "items": [
                    {
                      "storeRelationshipTypeId": -34,
                      "relatedStoreId": 2,
                      "storeId": 2,
                      "sequence": 0,
                      "state": 1,
                      "links": {
                        "self": {
                          "href": "https://10.190.66.10:8000/rest/admin/v2/store-relationships/storeRelationshipTypeId:-34,relatedStoreId:2,storeId:2"
                        },
                        "store-relationship-type": {
                          "href": "https://10.190.66.10:8000/rest/admin/v2/store-relationship-types/-34"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "There was a client error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "500": {
            "description": "There was a server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "store-relationships"
        ],
        "description": "Create a store relationship.",
        "operationId": "createStoreRelationship",
        "requestBody": {
          "description": "The store relationship.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StoreRelationships"
              },
              "example": {
                "storeRelationshipTypeId": -34,
                "relatedStoreId": 2,
                "storeId": 1,
                "sequence": 0,
                "state": 1
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "The operation was successful.",
            "content": {},
            "headers": {
              "Location": {
                "description": "The URI of the Store Relationships.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "links": {
              "GetStoreRelationshipsByStoreRelationshipTypeIdAndRelatedStoreIdAndStoreId": {
                "operationRef": "#/paths/~1store-relationships~1storeRelationshipTypeId:{storeRelationshipTypeId},relatedStoreId:{relatedStoreId},storeId:{storeId}/get",
                "parameters": {
                  "storeId": "$request.body#/storeId",
                  "storeRelationshipTypeId": "$request.body#/storeRelationshipTypeId",
                  "relatedStoreId": "$request.body#/relatedStoreId"
                },
                "description": "The `storeId` value used in the request body can be used as the `storeId` parameter in `GET /store-relationships/storeRelationshipTypeId:{storeRelationshipTypeId},relatedStoreId:{relatedStoreId},storeId:{storeId}`.\n"
              },
              "DeleteStoreRelationshipsByStoreRelationshipTypeIdAndRelatedStoreIdAndStoreId": {
                "operationRef": "#/paths/~1store-entity-calculation-usages~1storeId:{storeId},calculationUsageId:{calculationUsageId}/delete",
                "parameters": {
                  "storeId": "$request.body#/storeId",
                  "storeRelationshipTypeId": "$request.body#/storeRelationshipTypeId",
                  "relatedStoreId": "$request.body#/relatedStoreId"
                },
                "description": "The `storeId` value used in the request body can be used as the `storeId` parameter in `DELETE /store-relationships/storeRelationshipTypeId:{storeRelationshipTypeId},relatedStoreId:{relatedStoreId},storeId:{storeId}`.\n"
              },
              "UpdateStoreRelationshipsByStoreRelationshipTypeIdAndRelatedStoreIdAndStoreId": {
                "operationRef": "#/paths/~1store-entity-calculation-usages~1storeId:{storeId},calculationUsageId:{calculationUsageId}/patch",
                "parameters": {
                  "storeId": "$request.body#/storeId",
                  "storeRelationshipTypeId": "$request.body#/storeRelationshipTypeId",
                  "relatedStoreId": "$request.body#/relatedStoreId"
                },
                "description": "The `storeid` value used in the request body can be used as the `storeId` parameter in `PATCH /store-relationships/storeRelationshipTypeId:{storeRelationshipTypeId},relatedStoreId:{relatedStoreId},storeId:{storeId}`.\n"
              },
              "GetStoreRelationshipsByStoreRelationshipTypeIdRelatedStoreIdAndStoreId": {
                "operationRef": "#/paths/~1store-relationships~1storeRelationshipTypeId:{storeRelationshipTypeId},relatedStoreId:{relatedStoreId},storeId:{storeId}~1store-relationship-type/get",
                "parameters": {
                  "storeId": "$request.body#/storeId",
                  "storeRelationshipTypeId": "$request.body#/storeRelationshipTypeId",
                  "relatedStoreId": "$request.body#/relatedStoreId"
                },
                "description": "The `storeId` value used in the request body can be used as the `storeId` parameter in `GET /store-relationships/storeRelationshipTypeId:{storeRelationshipTypeId},relatedStoreId:{relatedStoreId},storeId:{storeId}/store-relationship-type`.\n"
              }
            }
          },
          "400": {
            "description": "There was a client error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "500": {
            "description": "There was a server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          }
        },
        "x-codegen-request-body-name": "StoreRelationship"
      }
    },
    "/store-relationships/storeRelationshipTypeId:{storeRelationshipTypeId},relatedStoreId:{relatedStoreId},storeId:{storeId}": {
      "get": {
        "tags": [
          "store-relationships"
        ],
        "description": "Get a store relationship.",
        "operationId": "getStoreRelationshipById",
        "parameters": [
          {
            "name": "storeRelationshipTypeId",
            "in": "path",
            "description": "The store relationship type ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "relatedStoreId",
            "in": "path",
            "description": "The related store ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "storeId",
            "in": "path",
            "description": "The store ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "The comma-separated set of properties to be returned. If no properties are specified, all properties are returned.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "expand",
            "in": "query",
            "description": "The comma-separated set of related resources referenced in the links to be returned. If no related resources are specified, no related resources are returned.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The store relationship.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoreRelationship"
                },
                "example": {
                  "storeRelationshipTypeId": -34,
                  "relatedStoreId": 2,
                  "storeId\"": 2,
                  "sequence\"": 0,
                  "state\"": 1,
                  "links": {
                    "self": {
                      "href": "https://10.190.66.10:8000/rest/admin/v2/store-relationships/storeRelationshipTypeId:-34,relatedStoreId:2,storeId:2"
                    },
                    "store-relationship-type": {
                      "href": "https://10.190.66.10:8000/rest/admin/v2/store-relationship-types/-34"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "There was a client error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found.",
            "content": {}
          },
          "500": {
            "description": "There was a server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "store-relationships"
        ],
        "description": "Delete a store relationship.",
        "operationId": "deleteStoreRelationshipById",
        "parameters": [
          {
            "name": "storeRelationshipTypeId",
            "in": "path",
            "description": "The store relationship type ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "relatedStoreId",
            "in": "path",
            "description": "The related store ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "storeId",
            "in": "path",
            "description": "The store ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "The operation was successful.",
            "content": {}
          },
          "400": {
            "description": "There was a client error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found.",
            "content": {}
          },
          "500": {
            "description": "There was a server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "store-relationships"
        ],
        "description": "Update a store relationship.",
        "operationId": "updateStoreRelationshipById",
        "parameters": [
          {
            "name": "storeRelationshipTypeId",
            "in": "path",
            "description": "The store relationship type ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "relatedStoreId",
            "in": "path",
            "description": "The related store ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "storeId",
            "in": "path",
            "description": "The store ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "description": "The store relationship.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StoreRelationships"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The operation was successful.",
            "content": {}
          },
          "400": {
            "description": "There was a client error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found.",
            "content": {}
          },
          "500": {
            "description": "There was a server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          }
        },
        "x-codegen-request-body-name": "StoreRelationship"
      }
    },
    "/store-relationships/storeRelationshipTypeId:{storeRelationshipTypeId},relatedStoreId:{relatedStoreId},storeId:{storeId}/store-relationship-type": {
      "get": {
        "tags": [
          "store-relationships"
        ],
        "operationId": "getStoreRelationshipTypeOfStoreRelationship",
        "parameters": [
          {
            "name": "storeRelationshipTypeId",
            "in": "path",
            "description": "The store relationship type ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "relatedStoreId",
            "in": "path",
            "description": "The related store ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "storeId",
            "in": "path",
            "description": "The store ID.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "description": "The comma-separated set of properties to be returned. If no properties are specified, all properties are returned.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "expand",
            "in": "query",
            "description": "The comma-separated set of related resources referenced in the links to be returned. If no related resources are specified, no related resources are returned.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The store relationship Type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoreRelationshipType"
                },
                "example": {
                  "id": -34,
                  "name": "com.ibm.commerce.search.price",
                  "links": {
                    "self": {
                      "href": "https://10.190.66.10:8000/rest/admin/v2/store-relationship-types/-34"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "There was a client error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found.",
            "content": {}
          },
          "500": {
            "description": "There was a server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseContainer"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Link": {
        "type": "object",
        "properties": {
          "href": {
            "type": "string",
            "description": "The URL of the link.",
            "format": "uri"
          }
        },
        "description": "Links to related resources."
      },
      "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."
      },
      "ErrorResponseContainer": {
        "type": "object",
        "properties": {
          "requestId": {
            "type": "string",
            "description": "The request identifier."
          },
          "errors": {
            "type": "array",
            "description": "The errors.",
            "items": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "The error message model."
      },
      "StoreRelationship": {
        "type": "object",
        "properties": {
          "storeRelationshipTypeId": {
            "type": "integer",
            "description": "The store relationship type ID.",
            "format": "int32"
          },
          "relatedStoreId": {
            "type": "integer",
            "description": "The related store ID.",
            "format": "int32"
          },
          "storeId": {
            "type": "integer",
            "description": "The store ID.",
            "format": "int32"
          },
          "sequence": {
            "type": "number",
            "description": "The selection sequence number. Used when the store has multiple related stores for the same relationship type.",
            "format": "double"
          },
          "state": {
            "type": "integer",
            "description": "The state of the relationship. Valid values are as follows, 0 = inactive. 1 = active.",
            "format": "int32"
          }
        },
        "description": "The store relationship."
      },
      "StoreRelationships": {
        "type": "object",
        "properties": {
          "storeRelationshipTypeId": {
            "type": "integer",
            "description": "The store relationship type ID.",
            "format": "int32"
          },
          "relatedStoreId": {
            "type": "integer",
            "description": "The related store ID.",
            "format": "int32"
          },
          "storeId": {
            "type": "integer",
            "description": "The store ID.",
            "format": "int32"
          },
          "sequence": {
            "type": "number",
            "description": "The selection sequence number. Used when the store has multiple related stores for the same relationship type.",
            "format": "double"
          },
          "state": {
            "type": "integer",
            "description": "The state of the relationship. Valid values are as follows, 0 = inactive. 1 = active.",
            "format": "int32"
          }
        }
      },
      "StoreRelationshipCollection": {
        "type": "object",
        "properties": {
          "href": {
            "type": "string"
          },
          "count": {
            "type": "integer",
            "description": "The total number of items.",
            "format": "int64"
          },
          "items": {
            "type": "array",
            "description": "The items.",
            "items": {
              "$ref": "#/components/schemas/StoreRelationship"
            }
          }
        },
        "description": "A collection of store relationships."
      },
      "StoreRelationshipType": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "A unique numeric store relationship type ID.",
            "format": "int32"
          },
          "name": {
            "type": "string",
            "description": "The name of store relationship type."
          },
          "links": {
            "type": "object",
            "properties": {
              "self": {
                "type": "object",
                "properties": {
                  "href": {
                    "type": "string",
                    "description": "The URL of the link."
                  }
                },
                "description": "The self link."
              }
            }
          }
        },
        "description": "The store relationship Type."
      }
    },
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "security": [
    {
      "basicAuth": []
    }
  ],
  "x-components": {}
}
