---
title: Update a product
slug: docs/demo/update-a-product
description: Learn how to make a PATCH request to an API endpoint using curl. This document provides a code example that demonstrates the proper usage of headers to accept and specify JSON content. The request data is presented as a JSON body with detailed key-value p
createdAt: 2022-03-21T20:12:45.000Z
---

{
  "id": "djTL5eSZ3UWwymHtw84K5",
  "data": {
    "url": "https://api.fictive.com/REST/api/products/{productReference}",
    "name": "Update a product",
    "method": "PATCH",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "productReference",
          "type": "string"
        }
      ],
      "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.Products.ProductPatchModel]",
          "customType": "Microsoft.AspNet.JsonPatch.JsonPatchDocument[FictiveGlobal.Api.Rest.Dtos.v1.Patch.Products.ProductPatchModel]",
          "isExpanded": true
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "schema": [
          {
            "kind": "optional",
            "type": {
              "type": "string",
              "example": ""
            },
            "schema": [
              {
                "kind": "optional",
                "name": "productReference",
                "type": "string",
                "example": ""
              },
              {
                "kind": "optional",
                "name": "name",
                "type": "string",
                "example": ""
              },
              {
                "kind": "optional",
                "name": "description",
                "type": "string",
                "example": ""
              },
              {
                "kind": "optional",
                "name": "type",
                "type": "string",
                "example": ""
              },
              {
                "kind": "optional",
                "name": "status",
                "type": "string",
                "example": ""
              },
              {
                "kind": "optional",
                "name": "productListReferences",
                "type": "array",
                "example": [],
                "itemType": "string",
                "customType": "string[]",
                "itemExample": ""
              },
              {
                "kind": "optional",
                "name": "createdDate",
                "type": "string<date-time>",
                "example": "2021-09-21T05:33:23.2761237"
              },
              {
                "kind": "optional",
                "name": "lastUpdatedDate",
                "type": "string<date-time>",
                "example": "2021-09-21T05:33:23.2761237"
              },
              {
                "kind": "optional",
                "name": "productParameters",
                "type": "object",
                "schema": [],
                "example": {}
              },
              {
                "kind": "optional",
                "name": "pricing",
                "type": "array",
                "schema": [
                  {
                    "kind": "optional",
                    "name": "role",
                    "type": "string",
                    "example": "",
                    "description": "Gets or sets the Role name"
                  },
                  {
                    "kind": "optional",
                    "name": "amount",
                    "type": "number<double>",
                    "example": "",
                    "description": "Gets or sets the Amount"
                  },
                  {
                    "kind": "optional",
                    "name": "isGross",
                    "type": "boolean",
                    "example": "",
                    "description": "Specify whether is gross amount"
                  },
                  {
                    "kind": "optional",
                    "name": "priceReference",
                    "type": "string",
                    "example": "",
                    "description": "Unique price reference"
                  },
                  {
                    "kind": "optional",
                    "name": "taxCategory",
                    "type": "string",
                    "example": "",
                    "description": "Tax category name"
                  },
                  {
                    "kind": "optional",
                    "name": "paymentMethod",
                    "type": "string",
                    "example": "",
                    "description": "Payment method name"
                  },
                  {
                    "kind": "optional",
                    "name": "currency",
                    "type": "string",
                    "example": "",
                    "description": "Three letter currency ISO code"
                  }
                ],
                "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.PricePointResponse",
                "customType": "FictiveGlobal.Api.Rest.Dtos.v1.PricePointResponse[]",
                "description": "Response DTO V1 for the Product Price Point."
              },
              {
                "kind": "optional",
                "name": "images",
                "type": "array",
                "schema": [
                  {
                    "kind": "optional",
                    "name": "imageReference",
                    "type": "string",
                    "example": ""
                  },
                  {
                    "kind": "optional",
                    "name": "displayName",
                    "type": "string",
                    "example": ""
                  },
                  {
                    "kind": "optional",
                    "name": "fileLocation",
                    "type": "string",
                    "example": ""
                  },
                  {
                    "kind": "optional",
                    "name": "defaultImage",
                    "type": "boolean",
                    "example": ""
                  }
                ],
                "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.ImageResponse",
                "customType": "FictiveGlobal.Api.Rest.Dtos.v1.ImageResponse[]",
                "description": "Response dto for Images."
              },
              {
                "kind": "optional",
                "name": "credits",
                "type": "array",
                "schema": [
                  {
                    "kind": "optional",
                    "name": "creditsReference",
                    "type": "string",
                    "example": ""
                  },
                  {
                    "kind": "optional",
                    "name": "currency",
                    "type": "string",
                    "example": ""
                  },
                  {
                    "kind": "optional",
                    "name": "amount",
                    "type": "number<double>",
                    "example": ""
                  },
                  {
                    "kind": "optional",
                    "name": "expiryDate",
                    "type": "string<date-time>",
                    "example": ""
                  },
                  {
                    "kind": "optional",
                    "name": "expiryDays",
                    "type": "integer<int32>",
                    "example": 0
                  }
                ],
                "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.CreditResponse",
                "customType": "FictiveGlobal.Api.Rest.Dtos.v1.CreditResponse[]",
                "description": "Response dto for Credits."
              },
              {
                "kind": "optional",
                "name": "contractPricing",
                "type": "array",
                "schema": [
                  {
                    "kind": "optional",
                    "name": "contractReference",
                    "type": "string",
                    "example": "",
                    "description": "The contract reference"
                  },
                  {
                    "kind": "optional",
                    "name": "pricing",
                    "type": "array",
                    "schema": [
                      {
                        "kind": "optional",
                        "name": "productContractPriceReference",
                        "type": "string",
                        "example": "",
                        "description": "The identifier of the price"
                      },
                      {
                        "kind": "optional",
                        "name": "taxCategory",
                        "type": "object",
                        "schema": [
                          {
                            "kind": "optional",
                            "name": "taxCategoryReference",
                            "type": "string",
                            "example": "",
                            "description": "Tax category reference"
                          },
                          {
                            "kind": "optional",
                            "name": "taxCategoryName",
                            "type": "string",
                            "example": "",
                            "description": "Tax category name"
                          },
                          {
                            "kind": "optional",
                            "name": "displayName",
                            "type": "string",
                            "example": "",
                            "description": "Tax category name to display"
                          }
                        ],
                        "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.TaxCategory",
                        "customType": "FictiveGlobal.Api.Rest.Dtos.v1.TaxCategory",
                        "description": "Tax category information"
                      },
                      {
                        "kind": "optional",
                        "name": "amount",
                        "type": "object",
                        "schema": [
                          {
                            "kind": "optional",
                            "name": "grossAmount",
                            "type": "number<double>",
                            "example": "",
                            "description": "Gross Amount"
                          },
                          {
                            "kind": "optional",
                            "name": "netAmount",
                            "type": "number<double>",
                            "example": "",
                            "description": "Net Amount"
                          },
                          {
                            "kind": "optional",
                            "name": "taxAmount",
                            "type": "number<double>",
                            "example": "",
                            "description": "Tax Amount"
                          },
                          {
                            "kind": "optional",
                            "name": "currency",
                            "type": "string",
                            "example": "",
                            "description": "Currency"
                          },
                          {
                            "kind": "optional",
                            "name": "priceReference",
                            "type": "string",
                            "example": "",
                            "description": "Product Price Reference"
                          }
                        ],
                        "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v3.CartLineItems.PricePoint",
                        "customType": "FictiveGlobal.Api.Rest.Dtos.v3.CartLineItems.PricePoint",
                        "description": "Pricing information"
                      },
                      {
                        "kind": "optional",
                        "name": "active",
                        "type": "boolean",
                        "example": ""
                      }
                    ],
                    "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.ProductServicePricing",
                    "customType": "FictiveGlobal.Api.Rest.Dtos.v1.ProductServicePricing[]",
                    "description": "Pricing information"
                  }
                ],
                "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.ProductService",
                "customType": "FictiveGlobal.Api.Rest.Dtos.v1.ProductService[]",
                "description": "ProductService is a link between a product and a contract(service)"
              }
            ],
            "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.ProductResponse",
            "customType": "FictiveGlobal.Api.Rest.Dtos.v1.ProductResponse",
            "isExpanded": true,
            "description": "Response dto for Products."
          }
        ],
        "isExpanded": true,
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "[\n  {\n    \"productReference\": \"0010BBLEC8GZAZA853\",\n    \"name\": \"Product A\",\n    \"description\": \"Product A Description\",\n    \"type\": \"Physical\",\n    \"status\": \"Active\",\n    \"productListReferences\": [\n      \"001PLYVMOL3WIA13S1\"\n    ],\n    \"createdDate\": \"2021-09-21T05:33:24.6198965\",\n    \"lastUpdatedDate\": \"2021-09-21T05:33:24.6198965\",\n    \"productParameters\": {\n      \"ParameterName1\": \"ParameterValue1\",\n      \"ParameterName2\": \"ParameterValue2\",\n      \"ParameterName3\": \"ParameterValue3\"\n    },\n    \"pricing\": [\n      {\n        \"role\": \"Default\",\n        \"amount\": 22,\n        \"isGross\": true,\n        \"priceReference\": \"0010FN2NS2K63HEHC0\",\n        \"taxCategory\": \"Standard\",\n        \"paymentMethod\": \"ServiceCredits\",\n        \"currency\": \"GBP\"\n      }\n    ],\n    \"images\": [\n      {\n        \"imageReference\": \"001IMALAKTOTN3DGB2\",\n        \"displayName\": \"Image1\",\n        \"fileLocation\": \"https://www.ImageLocation.co.uk/ImageFolder/Image1.jpg\",\n        \"defaultImage\": true\n      }\n    ],\n    \"credits\": [\n      {\n        \"creditsReference\": \"001PCHCHYYG8VN4632\",\n        \"currency\": \"GBP\",\n        \"amount\": 10,\n        \"expiryDate\": \"2021-10-21T05:33:24.6198965\"\n      }\n    ],\n    \"contractPricing\": [\n      {\n        \"contractReference\": \"0010GH2NS3K63HEHC4\",\n        \"pricing\": [\n          {\n            \"productContractPriceReference\": \"0580HH2NS3K63HFGC5\",\n            \"amount\": {\n              \"grossAmount\": 10,\n              \"netAmount\": 8,\n              \"taxAmount\": 2,\n              \"currency\": \"GBP\"\n            },\n            \"active\": false\n          }\n        ]\n      }\n    ]\n  },\n  {\n    \"productReference\": \"0010BZURPNZ3LJEM22\",\n    \"name\": \"Product B\",\n    \"description\": \"Product B Description\",\n    \"type\": \"Digital\",\n    \"status\": \"Active\",\n    \"productListReferences\": [\n      \"001PLYVMOL3WIA13S1\"\n    ],\n    \"createdDate\": \"2021-09-21T05:33:24.6198965\",\n    \"lastUpdatedDate\": \"2021-09-21T05:33:24.6198965\",\n    \"productParameters\": {\n      \"ParameterName1\": \"ParameterValue1\",\n      \"ParameterName2\": \"ParameterValue2\",\n      \"ParameterName3\": \"ParameterValue3\"\n    },\n    \"pricing\": [\n      {\n        \"role\": \"Default\",\n        \"amount\": 33,\n        \"isGross\": true,\n        \"priceReference\": \"0010FF2HSPDM3LZBP0\",\n        \"taxCategory\": \"Standard\",\n        \"paymentMethod\": \"ServiceCredits\",\n        \"currency\": \"GBP\"\n      }\n    ],\n    \"images\": [\n      {\n        \"imageReference\": \"001IMX81QIY5VFSZI0\",\n        \"displayName\": \"Image1\",\n        \"fileLocation\": \"https://www.ImageLocation.co.uk/ImageFolder/Image2.jpg\",\n        \"defaultImage\": true\n      }\n    ],\n    \"credits\": [\n      {\n        \"creditsReference\": \"001PCPFIR6GWGF2XD0\",\n        \"currency\": \"USD\",\n        \"amount\": 20,\n        \"expiryDate\": \"2021-10-21T05:33:24.6198965\"\n      }\n    ],\n    \"contractPricing\": [\n      {\n        \"contractReference\": \"009PSYVMOL3WIA13R8\",\n        \"pricing\": [\n          {\n            \"productContractPriceReference\": \"0010FS2T1F9AXORST1\",\n            \"taxCategory\": {\n              \"taxCategoryReference\": \"0010TC2T1F9AXORAAA\",\n              \"taxCategoryName\": \"Standard\",\n              \"displayName\": \"Standard\"\n            },\n            \"amount\": {\n              \"grossAmount\": 16,\n              \"netAmount\": 10,\n              \"taxAmount\": 6,\n              \"currency\": \"USD\"\n            },\n            \"active\": false\n          }\n        ]\n      }\n    ]\n  }\n]"
      },
      {
        "isExpanded": true,
        "statusCode": "400",
        "description": "Bad Request\r\n            <br />Product names cannot exceed 128 characters\r\n            <br />Product descriptions cannot exceed 850 characters\r\n            <br />Invalid product type provided, please provide either Digital or Physical\r\n            <br />Invalid status provided. Please provide a status of Active or Inactive\r\n            <br />Invalid PATCH operation\r\n            <br />Invalid PATCH path\r\n            <br />Invalid Contract type provided",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "401",
        "description": "Not Authorized",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "404",
        "description": "Not Found\r\n            <br />Product cannot be found\r\n            <br />Product list cannot be found\r\n            <br />Product list is not associated to the product\r\n            <br />Contract cannot be found",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "409",
        "description": "Conflict\r\n            <br />A product already exists with the name provided\r\n            <br />Contract {ContractReference} is already associated with product\r\n            <br />Duplicate Contract reference provided",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "500",
        "description": "Internal Server Error",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "description": "Calling this endpoint will allow you to amend core attributes of the products via API. The attributes that can be amended are: name, description, type, productListReference, and contractReferences.",
    "examples": {
      "languages": [
        {
          "id": "example-0-curl",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request PATCH \\\n     --url https://api.fictive.com/REST/api/products/{productReference} \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --header 'x-version: string' \\\n     --data '[\n     {}\n     ]'"
        },
        {
          "id": "example-1-javascript",
          "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/products/{productReference}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "example-2-ruby",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.fictive.com/REST/api/products/{productReference}\")\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": "example-3-python",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.fictive.com/REST/api/products/{productReference}\"\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": "example-0-curl"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "[\n  {\n    \"productReference\": \"0010BBLEC8GZAZA853\",\n    \"name\": \"Product A\",\n    \"description\": \"Product A Description\",\n    \"type\": \"Physical\",\n    \"status\": \"Active\",\n    \"productListReferences\": [\n      \"001PLYVMOL3WIA13S1\"\n    ],\n    \"createdDate\": \"2021-09-21T05:33:24.6198965\",\n    \"lastUpdatedDate\": \"2021-09-21T05:33:24.6198965\",\n    \"productParameters\": {\n      \"ParameterName1\": \"ParameterValue1\",\n      \"ParameterName2\": \"ParameterValue2\",\n      \"ParameterName3\": \"ParameterValue3\"\n    },\n    \"pricing\": [\n      {\n        \"role\": \"Default\",\n        \"amount\": 22,\n        \"isGross\": true,\n        \"priceReference\": \"0010FN2NS2K63HEHC0\",\n        \"taxCategory\": \"Standard\",\n        \"paymentMethod\": \"ServiceCredits\",\n        \"currency\": \"GBP\"\n      }\n    ],\n    \"images\": [\n      {\n        \"imageReference\": \"001IMALAKTOTN3DGB2\",\n        \"displayName\": \"Image1\",\n        \"fileLocation\": \"https://www.ImageLocation.co.uk/ImageFolder/Image1.jpg\",\n        \"defaultImage\": true\n      }\n    ],\n    \"credits\": [\n      {\n        \"creditsReference\": \"001PCHCHYYG8VN4632\",\n        \"currency\": \"GBP\",\n        \"amount\": 10,\n        \"expiryDate\": \"2021-10-21T05:33:24.6198965\"\n      }\n    ],\n    \"contractPricing\": [\n      {\n        \"contractReference\": \"0010GH2NS3K63HEHC4\",\n        \"pricing\": [\n          {\n            \"productContractPriceReference\": \"0580HH2NS3K63HFGC5\",\n            \"amount\": {\n              \"grossAmount\": 10,\n              \"netAmount\": 8,\n              \"taxAmount\": 2,\n              \"currency\": \"GBP\"\n            },\n            \"active\": false\n          }\n        ]\n      }\n    ]\n  },\n  {\n    \"productReference\": \"0010BZURPNZ3LJEM22\",\n    \"name\": \"Product B\",\n    \"description\": \"Product B Description\",\n    \"type\": \"Digital\",\n    \"status\": \"Active\",\n    \"productListReferences\": [\n      \"001PLYVMOL3WIA13S1\"\n    ],\n    \"createdDate\": \"2021-09-21T05:33:24.6198965\",\n    \"lastUpdatedDate\": \"2021-09-21T05:33:24.6198965\",\n    \"productParameters\": {\n      \"ParameterName1\": \"ParameterValue1\",\n      \"ParameterName2\": \"ParameterValue2\",\n      \"ParameterName3\": \"ParameterValue3\"\n    },\n    \"pricing\": [\n      {\n        \"role\": \"Default\",\n        \"amount\": 33,\n        \"isGross\": true,\n        \"priceReference\": \"0010FF2HSPDM3LZBP0\",\n        \"taxCategory\": \"Standard\",\n        \"paymentMethod\": \"ServiceCredits\",\n        \"currency\": \"GBP\"\n      }\n    ],\n    \"images\": [\n      {\n        \"imageReference\": \"001IMX81QIY5VFSZI0\",\n        \"displayName\": \"Image1\",\n        \"fileLocation\": \"https://www.ImageLocation.co.uk/ImageFolder/Image2.jpg\",\n        \"defaultImage\": true\n      }\n    ],\n    \"credits\": [\n      {\n        \"creditsReference\": \"001PCPFIR6GWGF2XD0\",\n        \"currency\": \"USD\",\n        \"amount\": 20,\n        \"expiryDate\": \"2021-10-21T05:33:24.6198965\"\n      }\n    ],\n    \"contractPricing\": [\n      {\n        \"contractReference\": \"009PSYVMOL3WIA13R8\",\n        \"pricing\": [\n          {\n            \"productContractPriceReference\": \"0010FS2T1F9AXORST1\",\n            \"taxCategory\": {\n              \"taxCategoryReference\": \"0010TC2T1F9AXORAAA\",\n              \"taxCategoryName\": \"Standard\",\n              \"displayName\": \"Standard\"\n            },\n            \"amount\": {\n              \"grossAmount\": 16,\n              \"netAmount\": 10,\n              \"taxAmount\": 6,\n              \"currency\": \"USD\"\n            },\n            \"active\": false\n          }\n        ]\n      }\n    ]\n  }\n]"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Bad Request\r\n            Product names cannot exceed 128 characters\r\n            Product descriptions cannot exceed 850 characters\r\n            Invalid product type provided, please provide either Digital or Physical\r\n            Invalid status provided. Please provide a status of Active or Inactive\r\n            Invalid PATCH operation\r\n            Invalid PATCH path\r\n            Invalid Contract type provided\n"
        },
        {
          "id": "response-2-401",
          "language": "401",
          "code": "// Not Authorized\n"
        },
        {
          "id": "response-3-404",
          "language": "404",
          "code": "// Not Found\r\n            Product cannot be found\r\n            Product list cannot be found\r\n            Product list is not associated to the product\r\n            Contract cannot be found\n"
        },
        {
          "id": "response-4-409",
          "language": "409",
          "code": "// Conflict\r\n            A product already exists with the name provided\r\n            Contract {ContractReference} is already associated with product\r\n            Duplicate Contract reference provided\n"
        },
        {
          "id": "response-5-500",
          "language": "500",
          "code": "// Internal Server Error\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}