---
title: Puts the entry relation.
slug: commerce-connect-15/service-api/5Rr9-puts-the-entry-relation
docTags: 
createdAt: 2026-10-09T17:33:32.660Z
---

{
  "id": "cnQ7x77JkZKZNfjLnx9OQ",
  "type": "api-oas-v2",
  "data": {
    "method": "PUT",
    "url": "/episerverapi/commerce/entries/{entryCode}/entryrelations/{childCode}/{relationType}",
    "servers": [],
    "name": "Puts the entry relation.",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "childCode",
          "type": "string",
          "description": "The child code."
        },
        {
          "kind": "required",
          "name": "relationType",
          "type": "string",
          "description": "Type of the relation."
        },
        {
          "kind": "required",
          "name": "entryCode",
          "type": "string",
          "description": ""
        }
      ],
      "headerParameters": [],
      "queryParameters": [
        {
          "kind": "optional",
          "name": "entryCode",
          "type": "string",
          "description": "The entry code."
        }
      ],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "object",
          "description": "The relation.",
          "customType": "EntryRelation",
          "schema": [
            {
              "name": "sortOrder",
              "kind": "optional",
              "type": "integer<int32>",
              "description": "Gets or sets the sort order.",
              "format": "int32"
            },
            {
              "name": "quantity",
              "kind": "optional",
              "type": "number<double>",
              "description": "Gets or sets the quantity.",
              "format": "double"
            },
            {
              "name": "relationType",
              "kind": "optional",
              "type": "string",
              "nullable": true,
              "description": "Gets or sets the type of the relation."
            },
            {
              "name": "groupName",
              "kind": "optional",
              "type": "string",
              "nullable": true,
              "description": "Gets or sets the name of the group."
            },
            {
              "name": "parentEntryCode",
              "kind": "optional",
              "type": "string",
              "nullable": true,
              "description": "Gets or sets the parent entry code."
            },
            {
              "name": "childEntryCode",
              "kind": "optional",
              "type": "string",
              "nullable": true,
              "description": "Gets or sets the child entry code."
            }
          ],
          "modelRef": "#/components/schemas/EntryRelation",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Success",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "204",
        "description": "The entry relation is saved.",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "400",
        "description": "If the entry relation model is not valid.",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "401",
        "description": "If user does not have enough permission for this request.",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "404",
        "description": "If entry or entry relation does not exist.",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "9fRVmgT2_nDYR0xuN_PVZ",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request PUT \\\n     --url /episerverapi/commerce/entries/{entryCode}/entryrelations/{childCode}/{relationType} \\\n     --header 'accept: application/json'"
        },
        {
          "id": "wiCbuvgTzfn_9zl385Jze",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'PUT',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"/episerverapi/commerce/entries/{entryCode}/entryrelations/{childCode}/{relationType}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "apVHcDuhol7rei-RcLgd6",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"/episerverapi/commerce/entries/{entryCode}/entryrelations/{childCode}/{relationType}\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Put.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "4uUPV7bAJ-htdA3C-0upo",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"/episerverapi/commerce/entries/{entryCode}/entryrelations/{childCode}/{relationType}\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"PUT\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "9fRVmgT2_nDYR0xuN_PVZ"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// Success\n"
        },
        {
          "id": "response-1-204",
          "language": "204",
          "code": "// The entry relation is saved.\n"
        },
        {
          "id": "response-2-400",
          "language": "400",
          "code": "// If the entry relation model is not valid.\n"
        },
        {
          "id": "response-3-401",
          "language": "401",
          "code": "// If user does not have enough permission for this request.\n"
        },
        {
          "id": "response-4-404",
          "language": "404",
          "code": "// If entry or entry relation does not exist.\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}