---
title: Update a product list
slug: docs/demo/update-a-product-list
description: Learn how to perform a PATCH request using cURL command in this code example. Update a particular product list item on the Fictive API by sending a request with headers for JSON data. Find all the required parameters for the update operation in the data s
docTags: 
createdAt: 2022-03-21T20:12:45.000Z
---

{
  "id": "ZVaxzQlEGrDidExdtfTGn",
  "data": {
    "url": "https://api.fictive.com/REST/api/product-lists/{productListReference}",
    "name": "Update a product list",
    "method": "PATCH",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "productListReference",
          "type": "string",
          "description": "Product list reference"
        }
      ],
      "queryParameters": [],
      "headerParameters": [
        {
          "kind": "optional",
          "name": "X-TokenId",
          "type": "string",
          "description": "The eSuite Token Id"
        },
        {
          "kind": "optional",
          "name": "X-SessionId",
          "type": "string",
          "description": "The eSuite Session Id"
        },
        {
          "kind": "required",
          "name": "X-Version",
          "type": "string",
          "description": "The eSuite Version"
        },
        {
          "kind": "optional",
          "name": "Origin",
          "type": "string",
          "description": "The eSuite Origin"
        }
      ],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "patchRequest",
          "type": "array",
          "schema": [
            {
              "kind": "optional",
              "name": "value",
              "type": "object",
              "schema": [],
              "modelRef": "#/definitions/System.Object",
              "customType": "System.Object"
            },
            {
              "kind": "optional",
              "name": "path",
              "type": "string",
              "example": ""
            },
            {
              "kind": "optional",
              "name": "op",
              "type": "string",
              "example": ""
            },
            {
              "kind": "optional",
              "name": "from",
              "type": "string",
              "example": ""
            }
          ],
          "modelRef": "#/definitions/Microsoft.AspNet.JsonPatch.JsonPatchDocument[FictiveGlobal.Api.Rest.Dtos.v1.Patch.ProductList.ProductListPatchModel]",
          "customType": "Microsoft.AspNet.JsonPatch.JsonPatchDocument[FictiveGlobal.Api.Rest.Dtos.v1.Patch.ProductList.ProductListPatchModel]",
          "isExpanded": true
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "schema": [
              {
                "kind": "optional",
                "name": "productListReference",
                "type": "string",
                "example": "",
                "description": "Product list reference."
              },
              {
                "kind": "optional",
                "name": "name",
                "type": "string",
                "example": "",
                "description": "product list name."
              },
              {
                "kind": "optional",
                "name": "associatedProducts",
                "type": "array",
                "example": [],
                "itemType": "string",
                "customType": "string[]",
                "description": "Associated products with the product list.",
                "itemExample": ""
              },
              {
                "kind": "optional",
                "name": "createdDate",
                "type": "string<date-time>",
                "example": "2021-09-21T05:33:22.9636152",
                "description": "Created date."
              },
              {
                "kind": "optional",
                "name": "lastUpdatedDate",
                "type": "string<date-time>",
                "example": "2021-09-21T05:33:22.9636152",
                "description": "Last updated date."
              }
            ],
            "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.ProductListResponse",
            "customType": "FictiveGlobal.Api.Rest.Dtos.v1.ProductListResponse",
            "isExpanded": true,
            "description": "Product list response wrapper."
          }
        ],
        "isExpanded": true,
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "{\n  \"productListReference\": \"001PLTRFD456544FD\",\n  \"name\": \"A list\",\n  \"associatedProducts\": [\n    \"0010BBLEC8GZAZA853\",\n    \"0010BZURPNZ3LJEM22\"\n  ],\n  \"createdDate\": \"2021-09-21T05:33:23.2761237\",\n  \"lastUpdatedDate\": \"2021-09-21T05:33:23.2761237\"\n}"
      },
      {
        "isExpanded": true,
        "statusCode": "400",
        "description": "Request is invalid.\r\n            <br />Product list name cannot exceed 64 characters.",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "404",
        "description": "Product cannot be found.\r\n            <br />Product cannot be found against the product list.",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "409",
        "description": "Product list with the specified name already exists.",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "500",
        "description": "Internal Server Error.",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "description": "This endpoint will allow you to update the details of a product list. It is possible to change the name and the products associated to the list via this endpoint.",
    "examples": {
      "languages": [
        {
          "id": "pDznuihZc86MUsojgZSo2",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request PATCH \\\n     --url https://api.fictive.com/REST/api/product-lists/{productListReference} \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --header 'x-version: string' \\\n     --data '[\n     {}\n     ]'"
        },
        {
          "id": "yOAhvIpEJ-PFoBnKoCgDw",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\nmyHeaders.append(\"x-version\", \"string\");\n\nvar raw = JSON.stringify([\n   {}\n]);\n\nvar requestOptions = {\n   method: 'PATCH',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.fictive.com/REST/api/product-lists/{productListReference}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "QRmrSJ4gQ4qKbw2YOh8kL",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.fictive.com/REST/api/product-lists/{productListReference}\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Patch.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest[\"x-version\"] = \"string\"\nrequest.body = JSON.dump([\n   {}\n])\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "9lLq3_SOxqjnKvNpBIuhd",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.fictive.com/REST/api/product-lists/{productListReference}\"\n\npayload = json.dumps([\n   {}\n])\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json',\n   'x-version': 'string'\n}\n\nresponse = requests.request(\"PATCH\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "pDznuihZc86MUsojgZSo2"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "{\n  \"productListReference\": \"001PLTRFD456544FD\",\n  \"name\": \"A list\",\n  \"associatedProducts\": [\n    \"0010BBLEC8GZAZA853\",\n    \"0010BZURPNZ3LJEM22\"\n  ],\n  \"createdDate\": \"2021-09-21T05:33:23.2761237\",\n  \"lastUpdatedDate\": \"2021-09-21T05:33:23.2761237\"\n}"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Request is invalid.\r\n            Product list name cannot exceed 64 characters.\n"
        },
        {
          "id": "response-2-404",
          "language": "404",
          "code": "// Product cannot be found.\r\n            Product cannot be found against the product list.\n"
        },
        {
          "id": "response-3-409",
          "language": "409",
          "code": "// Product list with the specified name already exists.\n"
        },
        {
          "id": "response-4-500",
          "language": "500",
          "code": "// Internal Server Error.\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}