{
  "openapi": "3.0.1",
  "info": {
    "title": "Price Constant",
    "description": "Create and administer price constant.",
    "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"
          ]
        }
      }
    }
  ],
  "tags": [
    {
      "name": "Price Constant",
      "description": "Provide RESTful services to manage Price Constant."
    }
  ],
  "paths": {
    "/price-constants": {
      "get": {
        "tags": [
          "Price Constant"
        ],
        "summary": "Get the price constants in a store.",
        "parameters": [
          {
            "name": "storeId",
            "in": "query",
            "description": "The unique numeric ID for identifying the store.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-context-data": "storeId"
            },
            "x-context-data": "storeId"
          },
          {
            "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",
              "x-entity-path": "dataArea/get/recordSetStartNumber"
            },
            "x-entity-path": "dataArea/get/recordSetStartNumber"
          },
          {
            "name": "limit",
            "in": "query",
            "description": "The maximum number of records to return.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-entity-path": "dataArea/get/maxItems"
            },
            "x-entity-path": "dataArea/get/maxItems"
          }
        ],
        "responses": {
          "200": {
            "description": "The operation is successful.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceConstantCollection"
                }
              }
            },
            "x-entity-path": "dataArea/priceConstant"
          }
        },
        "x-expression-template": "{_wcf.ap='IBM_Admin_Summary'}/PriceConstant",
        "x-facade-client-class": "com.ibm.commerce.price.facade.client.PriceFacadeClient",
        "x-facade-client-method": "getPriceConstant",
        "x-request-bod-class": "com.ibm.commerce.price.facade.datatypes.GetPriceConstantType"
      },
      "post": {
        "tags": [
          "Price Constant"
        ],
        "summary": "Create a price constant.",
        "parameters": [
          {
            "name": "storeId",
            "in": "query",
            "description": "The unique numeric ID for identifying the store.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-context-data": "storeId",
              "x-entity-path": "dataArea/priceConstant[1]/priceConstantIdentifier/externalIdentifier/storeIdentifier/uniqueID"
            },
            "x-context-data": "storeId",
            "x-entity-path": "dataArea/priceConstant[1]/priceConstantIdentifier/externalIdentifier/storeIdentifier/uniqueID"
          }
        ],
        "requestBody": {
          "description": "The request body.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PriceConstant"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "The operation is successful.",
            "headers": {
              "Location": {
                "description": "The URI of the price constant.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {},
            "x-entity-path": "dataArea/priceConstant[1]/priceConstantIdentifier/uniqueID",
            "links": {
              "GetPriceConstantsById": {
                "operationRef": "#/paths/~1price-constants~1{id}/get",
                "parameters": {
                  "id": "$request.body#/id",
                  "storeId": "$request.query.storeId"
                },
                "description": "The `id`,`storeId`value used in the request body can be used as the `id`,`storeId`  parameter in `GET /price-constants/{id}`.\n"
              },
              "DeletePriceConstantsById": {
                "operationRef": "#/paths/~1price-constants~1{id}/delete",
                "parameters": {
                  "id": "$request.body#/id"
                },
                "description": "The `id`value used in the request body can be used as the The `id` parameter in `DELETE /price-constants/{id}`.\n"
              },
              "UpdatePriceConstantsById": {
                "operationRef": "#/paths/~1price-constants~1{id}/patch",
                "parameters": {
                  "id": "$request.body#/id"
                },
                "description": "The `id`value used in the request body can be used as the `id` parameter in `PATCH /price-constants/{id}`.\n"
              },
              "GatePriceConstantsByNameorDescription": {
                "operationRef": "#/paths/~1/price-constants~1by-name-or-description/patch",
                "parameters": {
                  "storeId": "$request.query.storeId",
                  "searchText ": "$request.body#/name"
                },
                "description": "The `id`,`searchText`value used in the request body can be used as the `id` parameter in `PATCH /price-constants/by-name-or-description`.\n"
              },
              "CreatePriceConstantsCurrencyValues": {
                "operationRef": "#/paths/~1price-constants~1{id}~1currency-values/patch",
                "parameters": {
                  "id": "$request.body#/id"
                },
                "description": "The `id`value used in the request body can be used as the `id` parameter in `POST /price-constants/{id}/currency-values`.\n"
              }
            }
          }
        },
        "x-action-code": "Create",
        "x-expression-template": "/PriceConstant[1]",
        "x-facade-client-class": "com.ibm.commerce.price.facade.client.PriceFacadeClient",
        "x-facade-client-method": "processPriceConstant",
        "x-request-bod-class": "com.ibm.commerce.price.facade.datatypes.ProcessPriceConstantType",
        "x-codegen-request-body-name": "body"
      }
    },
    "/price-constants/by-name-or-description": {
      "get": {
        "tags": [
          "Price Constant"
        ],
        "summary": "Search price rules by name or description.",
        "parameters": [
          {
            "name": "storeId",
            "in": "query",
            "description": "The unique numeric ID for identifying the store.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-context-data": "storeId"
            },
            "x-context-data": "storeId"
          },
          {
            "name": "searchText",
            "in": "query",
            "description": "The name pattern to search.",
            "required": true,
            "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",
              "x-entity-path": "dataArea/get/recordSetStartNumber"
            },
            "x-entity-path": "dataArea/get/recordSetStartNumber"
          },
          {
            "name": "limit",
            "in": "query",
            "description": "The maximum number of records to return.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-entity-path": "dataArea/get/maxItems"
            },
            "x-entity-path": "dataArea/get/maxItems"
          }
        ],
        "responses": {
          "200": {
            "description": "The operation is successful.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceConstantCollection"
                }
              }
            },
            "x-entity-path": "dataArea/priceConstant"
          }
        },
        "x-expression-builder-class": "com.ibm.commerce.foundation.internal.client.taglib.util.SearchExpressionBuilder",
        "x-expression-builder-method": "formatExpression",
        "x-facade-client-class": "com.ibm.commerce.price.facade.client.PriceFacadeClient",
        "x-facade-client-method": "getPriceConstant",
        "x-parameters": {
          "accessProfile": "IBM_Admin_Summary",
          "template": "/PriceConstant[search(PriceConstantIdentifier/ExternalIdentifier/Name='$searchText$' or Description='$searchText$')]"
        },
        "x-request-bod-class": "com.ibm.commerce.price.facade.datatypes.GetPriceConstantType"
      }
    },
    "/price-constants/{id}": {
      "get": {
        "tags": [
          "Price Constant"
        ],
        "summary": "Get a price constant.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The unique numeric ID for identifying the price constant.",
            "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": "int32",
              "x-context-data": "storeId"
            },
            "x-context-data": "storeId"
          }
        ],
        "responses": {
          "200": {
            "description": "The operation is successful.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceConstant"
                }
              }
            },
            "x-entity-path": "dataArea/priceConstant[1]"
          }
        },
        "x-expression-template": "{_wcf.ap='IBM_Admin_Details'}/PriceConstant/PriceConstantIdentifier[(UniqueID='{id}')]",
        "x-facade-client-class": "com.ibm.commerce.price.facade.client.PriceFacadeClient",
        "x-facade-client-method": "getPriceConstant",
        "x-request-bod-class": "com.ibm.commerce.price.facade.datatypes.GetPriceConstantType"
      },
      "delete": {
        "tags": [
          "Price Constant"
        ],
        "summary": "Delete a price constant.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The unique numeric ID for identifying the price constant.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "x-entity-path": "dataArea/priceConstant[1]/priceConstantIdentifier/uniqueID"
            },
            "x-entity-path": "dataArea/priceConstant[1]/priceConstantIdentifier/uniqueID"
          }
        ],
        "responses": {
          "204": {
            "description": "The operation is successful.",
            "content": {}
          }
        },
        "x-action-code": "Delete",
        "x-expression-template": "/PriceConstant[1]",
        "x-facade-client-class": "com.ibm.commerce.price.facade.client.PriceFacadeClient",
        "x-facade-client-method": "processPriceConstant",
        "x-request-bod-class": "com.ibm.commerce.price.facade.datatypes.ProcessPriceConstantType"
      },
      "patch": {
        "tags": [
          "Price Constant"
        ],
        "summary": "Update a price constant.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The unique numeric ID for identifying the price constant.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "x-entity-path": "dataArea/priceConstant[1]/priceConstantIdentifier/uniqueID"
            },
            "x-entity-path": "dataArea/priceConstant[1]/priceConstantIdentifier/uniqueID"
          }
        ],
        "requestBody": {
          "description": "The request body.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PriceConstant"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The operation is successful.",
            "content": {}
          }
        },
        "x-action-code": "Change",
        "x-expression-template": "/PriceConstant[1]",
        "x-facade-client-class": "com.ibm.commerce.price.facade.client.PriceFacadeClient",
        "x-facade-client-method": "changePriceConstant",
        "x-request-bod-class": "com.ibm.commerce.price.facade.datatypes.ChangePriceConstantType",
        "x-codegen-request-body-name": "body"
      }
    },
    "/price-constants/{id}/currency-values": {
      "post": {
        "tags": [
          "Price Constant"
        ],
        "summary": "Add a currency value to a price constant.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The unique numeric ID for identifying the price constant.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "x-entity-path": "dataArea/priceConstant[1]/priceConstantIdentifier/uniqueID"
            },
            "x-entity-path": "dataArea/priceConstant[1]/priceConstantIdentifier/uniqueID"
          }
        ],
        "requestBody": {
          "description": "The request body.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MonetaryAmount"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "The operation is successful.",
            "headers": {
              "Location": {
                "description": "The URI of the price constant.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {},
            "x-entity-path": "dataArea/priceConstant[1]//priceConstantIdentifier/uniqueID",
            "links": {
              "UpdatePriceConstantsCurrencyValues": {
                "operationRef": "#/paths/~1price-constants~1{id}~1currency-values/patch",
                "parameters": {
                  "id": "$request.path.id"
                },
                "description": "The `id`value used in the request body can be used as the `id` parameter in `PATCH /price-constants/{id}/currency-values`.\n"
              }
            }
          }
        },
        "x-action-code": "Add",
        "x-expression-template": "/PriceConstant[1]/Values/MonetaryValue/AlternativeCurrencyValue[1]",
        "x-facade-client-class": "com.ibm.commerce.price.facade.client.PriceFacadeClient",
        "x-facade-client-method": "changePriceConstant",
        "x-request-bod-class": "com.ibm.commerce.price.facade.datatypes.ChangePriceConstantType",
        "x-request-verb": "change",
        "x-response-verb": "respond",
        "x-codegen-request-body-name": "body"
      },
      "patch": {
        "tags": [
          "Price Constant"
        ],
        "summary": "Update a currency value of a price constant.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The unique numeric ID for identifying the price constant.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "x-entity-path": "dataArea/priceConstant[1]/priceConstantIdentifier/uniqueID"
            },
            "x-entity-path": "dataArea/priceConstant[1]/priceConstantIdentifier/uniqueID"
          }
        ],
        "requestBody": {
          "description": "The request body.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MonetaryAmount"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The operation is successful.",
            "content": {}
          }
        },
        "x-action-code": "Change",
        "x-expression-template": "/PriceConstant[1]/Values/MonetaryValue/AlternativeCurrencyValue[1]",
        "x-facade-client-class": "com.ibm.commerce.price.facade.client.PriceFacadeClient",
        "x-facade-client-method": "changePriceConstant",
        "x-request-bod-class": "com.ibm.commerce.price.facade.datatypes.ChangePriceConstantType",
        "x-request-verb": "change",
        "x-response-verb": "respond",
        "x-codegen-request-body-name": "body"
      }
    }
  },
  "components": {
    "schemas": {
      "MonetaryAmount": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string",
            "description": "The currency of the monetary amount.",
            "x-entity-path": "currency"
          },
          "value": {
            "type": "number",
            "description": "The value of the monetary amount.",
            "format": "double",
            "x-entity-path": "value"
          }
        },
        "description": "The monetary value of the constant entry.",
        "x-entity-class": "com.ibm.commerce.foundation.common.datatypes.MonetaryAmountType"
      },
      "MonetaryValue": {
        "type": "object",
        "properties": {
          "alternativeCurrencyValues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MonetaryAmount"
            },
            "x-entity-path": "alternativeCurrencyValue"
          },
          "defaultCurrencyValue": {
            "$ref": "#/components/schemas/MonetaryAmount"
          }
        },
        "description": "The monetary value of the constant entry.",
        "x-entity-class": "com.ibm.commerce.price.facade.datatypes.MonetaryValueType"
      },
      "PriceConstant": {
        "type": "object",
        "required": [
          "id",
          "name",
          "storeId"
        ],
        "properties": {
          "createdDate": {
            "type": "string",
            "description": "Created time.",
            "format": "date-time",
            "x-entity-path": "createdTime"
          },
          "description": {
            "type": "string",
            "description": "A description of the price constant, suitable for display to business users.",
            "x-entity-path": "description"
          },
          "format": {
            "type": "string",
            "description": "Indicates the type of the constant:Percent, Number or MonetaryAmount",
            "x-entity-path": "format"
          },
          "id": {
            "type": "integer",
            "description": "The unique numeric ID for identifying the price constant.",
            "format": "int64",
            "x-entity-path": "priceConstantIdentifier/uniqueID"
          },
          "name": {
            "type": "string",
            "description": "The name of the price constant.",
            "x-entity-path": "priceConstantIdentifier/externalIdentifier/name"
          },
          "storeId": {
            "type": "integer",
            "description": "The unique numeric ID for identifying the store.",
            "format": "int64",
            "x-entity-path": "priceConstantIdentifier/externalIdentifier/storeIdentifier/uniqueID"
          },
          "updatedDate": {
            "type": "string",
            "description": "Last updated time.",
            "format": "date-time",
            "x-entity-path": "lastUpdateTime"
          },
          "values": {
            "$ref": "#/components/schemas/PriceConstantValue"
          }
        },
        "description": "A price constant.",
        "x-entity-class": "com.ibm.commerce.price.facade.datatypes.PriceConstantType"
      },
      "PriceConstantCollection": {
        "type": "object",
        "required": [
          "count"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "format": "int64"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PriceConstant"
            }
          }
        },
        "description": "A collection of price constants."
      },
      "PriceConstantValue": {
        "type": "object",
        "properties": {
          "monetaryValue": {
            "$ref": "#/components/schemas/MonetaryValue"
          },
          "numberValue": {
            "type": "number",
            "description": "The value of the price constant.",
            "format": "double",
            "x-entity-path": "numberValue"
          }
        },
        "description": "A price constant value.",
        "x-entity-class": "com.ibm.commerce.price.facade.datatypes.PriceConstantValueType"
      },
      "PriceConstantValueCollection": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer",
            "format": "int64"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PriceConstantValue"
            }
          }
        },
        "description": "A collection of price constant values."
      }
    },
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "security": [
    {
      "basicAuth": []
    }
  ],
  "x-components": {}
}
