---
title: Updates the pricing for a product in a bundle
slug: docs/demo/updates-the-pricing-for-a-product-in-a-bundle
description: Learn how to send a PATCH request to a desired API endpoint using the curl command. This code example demonstrates how to set headers for accepting and sending JSON data, along with a payload containing an array of objects with specific properties. Improv
docTags: 
createdAt: 2022-03-21T20:12:45.000Z
---

{
  "id": "mxLZ9etTWxiwsv3ynPoo-",
  "data": {
    "url": "https://api.fictive.com/REST/api/bundles/{bundleReference}/carts/{cartReference}/products/{productReference}",
    "name": "Updates the pricing for a product in a bundle",
    "method": "PATCH",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "bundleReference",
          "type": "string",
          "description": "Reference of the bundle containing the product to be patched."
        },
        {
          "kind": "required",
          "name": "cartReference",
          "type": "string",
          "description": "Reference of the cart containing the product to be patched."
        },
        {
          "kind": "required",
          "name": "productReference",
          "type": "string",
          "description": "Reference of the product to be patched."
        }
      ],
      "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": "patchRequests",
          "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.Bundle.BundleProductPatch]",
          "customType": "Microsoft.AspNet.JsonPatch.JsonPatchDocument[FictiveGlobal.Api.Rest.Dtos.v1.Bundle.BundleProductPatch]",
          "isExpanded": true
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "schema": [
              {
                "kind": "optional",
                "name": "name",
                "type": "string",
                "example": "",
                "description": "The bundle name"
              },
              {
                "kind": "optional",
                "name": "description",
                "type": "string",
                "example": "",
                "description": "The bundle description"
              },
              {
                "kind": "optional",
                "name": "tag",
                "type": "string",
                "example": "",
                "description": "The optional bundle tag"
              },
              {
                "kind": "optional",
                "name": "status",
                "type": "string<Active | Inactive | Archived>",
                "example": "",
                "description": "The bundle's status"
              }
            ],
            "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.Bundle.Bundle",
            "customType": "FictiveGlobal.Api.Rest.Dtos.v1.Bundle.Bundle",
            "isExpanded": true,
            "description": "The Dto of a bundle"
          }
        ],
        "isExpanded": true,
        "statusCode": "200",
        "description": "Ok",
        "jsonExample": "{\n  \"bundleReference\": \"001PB4PI6KTXCYR8R4\",\n  \"carts\": [\n    {\n      \"cartReference\": \"0010K4PI6KTXCYFT82\",\n      \"active\": true,\n      \"contractReference\": \"0010C4PI6KTXCYB8R9\",\n      \"lineItems\": [\n        {\n          \"lineItemReference\": \"0010I4PI6KTEVRY8R2\",\n          \"description\": \"The first line item in the cart\",\n          \"pricing\": {\n            \"grossAmount\": 10,\n            \"netAmount\": 8,\n            \"taxAmount\": 2,\n            \"currency\": \"GBP\"\n          },\n          \"quantity\": 1,\n          \"productInfo\": {\n            \"title\": \"Example Product\",\n            \"productReference\": \"0010B4PI6KTXCYR8R4\"\n          },\n          \"customLineItemParameters\": {}\n        }\n      ]\n    }\n  ],\n  \"name\": \"Third Bundle (With Tag & Cart)\",\n  \"description\": \"The third bundle, featuring a tag & single cart\",\n  \"tag\": \"A002\",\n  \"status\": \"Active\"\n}"
      },
      {
        "isExpanded": true,
        "statusCode": "400",
        "description": "Bad Request\r\n            <br />• No provided PATCH data\r\n            <br />• Invalid PATCH operation\r\n            <br />• Invalid PATCH path",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "404",
        "description": "Not found\r\n            <br />• Bundle cannot be found.\r\n            <br />• Cart cannot be found.\r\n            <br />• Product cannot be found.",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "description": "This endpoint will allow you the ability to update a product prive in a bundle within the eSuite platform",
    "examples": {
      "languages": [
        {
          "id": "bbL46SIJVKeag0BtYlLvo",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request PATCH \\\n     --url https://api.fictive.com/REST/api/bundles/{bundleReference}/carts/{cartReference}/products/{productReference} \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --header 'x-version: string' \\\n     --data '[\n     {}\n     ]'"
        },
        {
          "id": "0Mk8dcU0V71JetUBY8CfG",
          "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/bundles/{bundleReference}/carts/{cartReference}/products/{productReference}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "HHNwN5_vcqPpWC98IquEF",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.fictive.com/REST/api/bundles/{bundleReference}/carts/{cartReference}/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": "KoDwMczOeZ5PWJFLarPXQ",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.fictive.com/REST/api/bundles/{bundleReference}/carts/{cartReference}/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": "bbL46SIJVKeag0BtYlLvo"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "{\n  \"bundleReference\": \"001PB4PI6KTXCYR8R4\",\n  \"carts\": [\n    {\n      \"cartReference\": \"0010K4PI6KTXCYFT82\",\n      \"active\": true,\n      \"contractReference\": \"0010C4PI6KTXCYB8R9\",\n      \"lineItems\": [\n        {\n          \"lineItemReference\": \"0010I4PI6KTEVRY8R2\",\n          \"description\": \"The first line item in the cart\",\n          \"pricing\": {\n            \"grossAmount\": 10,\n            \"netAmount\": 8,\n            \"taxAmount\": 2,\n            \"currency\": \"GBP\"\n          },\n          \"quantity\": 1,\n          \"productInfo\": {\n            \"title\": \"Example Product\",\n            \"productReference\": \"0010B4PI6KTXCYR8R4\"\n          },\n          \"customLineItemParameters\": {}\n        }\n      ]\n    }\n  ],\n  \"name\": \"Third Bundle (With Tag & Cart)\",\n  \"description\": \"The third bundle, featuring a tag & single cart\",\n  \"tag\": \"A002\",\n  \"status\": \"Active\"\n}"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Bad Request\r\n            • No provided PATCH data\r\n            • Invalid PATCH operation\r\n            • Invalid PATCH path\n"
        },
        {
          "id": "response-2-404",
          "language": "404",
          "code": "// Not found\r\n            • Bundle cannot be found.\r\n            • Cart cannot be found.\r\n            • Product cannot be found.\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}