---
title: Deletes the warehouse.
slug: commerce-connect-15/service-api/deletes-the-warehouse
docTags: 
createdAt: 2026-10-09T17:33:29.599Z
---

{
  "id": "xiOKQSWH2QDGFbgzDl4nP",
  "type": "api-oas-v2",
  "data": {
    "method": "DELETE",
    "url": "/episerverapi/commerce/warehouses/{warehouseCode}",
    "servers": [],
    "name": "Deletes the warehouse.",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "warehouseCode",
          "type": "string",
          "description": "The warehouse code."
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "text/plain",
            "application/json",
            "text/json"
          ],
          "default": "text/plain"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "The warehouse is deleted.",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "Warehouse",
            "schema": [
              {
                "name": "name",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "Gets or sets the name."
              },
              {
                "name": "isActive",
                "kind": "optional",
                "type": "boolean",
                "description": "Gets or sets a value indicating whether this instance is active."
              },
              {
                "name": "isPrimary",
                "kind": "optional",
                "type": "boolean",
                "description": "Gets or sets a value indicating whether this instance is primary."
              },
              {
                "name": "sortOrder",
                "kind": "optional",
                "type": "integer<int32>",
                "description": "Gets or sets the sort order.",
                "format": "int32"
              },
              {
                "name": "code",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "Gets or sets the code."
              },
              {
                "name": "fulfillmentPriorityOrder",
                "kind": "optional",
                "type": "integer<int32>",
                "description": "Gets or sets the fulfillment priority order.",
                "format": "int32"
              },
              {
                "name": "isFulfillmentCenter",
                "kind": "optional",
                "type": "boolean",
                "description": "Gets or sets a value indicating whether this instance is fulfillment center."
              },
              {
                "name": "isPickupLocation",
                "kind": "optional",
                "type": "boolean",
                "description": "Gets or sets a value indicating whether this instance is pickup location."
              },
              {
                "name": "isDeliveryLocation",
                "kind": "optional",
                "type": "boolean",
                "description": "Gets or sets a value indicating whether this instance is delivery location."
              },
              {
                "name": "firstName",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "Gets or sets the first name."
              },
              {
                "name": "lastName",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "Gets or sets the last name."
              },
              {
                "name": "organization",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "Gets or sets the organization."
              },
              {
                "name": "line1",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "Gets or sets the line1."
              },
              {
                "name": "line2",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "Gets or sets the line2."
              },
              {
                "name": "city",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "Gets or sets the city."
              },
              {
                "name": "state",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "Gets or sets the state."
              },
              {
                "name": "countryCode",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "Gets or sets the country code."
              },
              {
                "name": "countryName",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "Gets or sets the name of the country."
              },
              {
                "name": "postalCode",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "Gets or sets the postal code."
              },
              {
                "name": "regionCode",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "Gets or sets the region code."
              },
              {
                "name": "regionName",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "Gets or sets the name of the region."
              },
              {
                "name": "daytimePhoneNumber",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "Gets or sets the daytime phone number."
              },
              {
                "name": "eveningPhoneNumber",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "Gets or sets the evening phone number."
              },
              {
                "name": "faxNumber",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "Gets or sets the fax number."
              },
              {
                "name": "email",
                "kind": "optional",
                "type": "string",
                "nullable": true,
                "description": "Gets or sets the email."
              }
            ],
            "modelRef": "#/components/schemas/Warehouse",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "401",
        "description": "If user does not have enough permission for this request.",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "404",
        "description": "If warehouse does not exist.",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "LZOkafTEVCcpSeQg7sg3t",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request DELETE \\\n     --url /episerverapi/commerce/warehouses/{warehouseCode} \\\n     --header 'accept: text/plain'"
        },
        {
          "id": "nheqSYL0nJ1uvjvpy-i6c",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"text/plain\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'DELETE',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"/episerverapi/commerce/warehouses/{warehouseCode}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "whOjfClWJOOyEt_9nZWmr",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"/episerverapi/commerce/warehouses/{warehouseCode}\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Delete.new(url)\nrequest[\"accept\"] = \"text/plain\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "-rBmFQIELC5-yhxfwlm_v",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"/episerverapi/commerce/warehouses/{warehouseCode}\"\n\npayload = {}\nheaders = {\n   'accept': 'text/plain',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"DELETE\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "LZOkafTEVCcpSeQg7sg3t"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// The warehouse is deleted.\n{\n  \"name\": \"\",\n  \"isActive\": false,\n  \"isPrimary\": false,\n  \"sortOrder\": \"\",\n  \"code\": \"\",\n  \"fulfillmentPriorityOrder\": \"\",\n  \"isFulfillmentCenter\": false,\n  \"isPickupLocation\": false,\n  \"isDeliveryLocation\": false,\n  \"firstName\": \"\",\n  \"lastName\": \"\",\n  \"organization\": \"\",\n  \"line1\": \"\",\n  \"line2\": \"\",\n  \"city\": \"\",\n  \"state\": \"\",\n  \"countryCode\": \"\",\n  \"countryName\": \"\",\n  \"postalCode\": \"\",\n  \"regionCode\": \"\",\n  \"regionName\": \"\",\n  \"daytimePhoneNumber\": \"\",\n  \"eveningPhoneNumber\": \"\",\n  \"faxNumber\": \"\",\n  \"email\": \"\"\n}"
        },
        {
          "id": "response-1-401",
          "language": "401",
          "code": "// If user does not have enough permission for this request.\n"
        },
        {
          "id": "response-2-404",
          "language": "404",
          "code": "// If warehouse does not exist.\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}