---
title: Posts the node entry relation.
slug: commerce-connect-15/service-api/x0pH-posts-the-node-entry-relation
docTags: 
createdAt: 2026-10-09T17:33:31.916Z
---

{
  "id": "YgY-TgurFRpSbZB7cgtLE",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "http://localhost:64424/episerverapi/commerce/entries/{entryCode}/nodeentryrelations",
    "servers": [
      {
        "url": "http://localhost:64424/episerverapi/commerce/entries/{entryCode}/nodeentryrelations"
      },
      {
        "url": "https://localhost:64424/episerverapi/commerce/entries/{entryCode}/nodeentryrelations"
      }
    ],
    "name": "Posts the node entry relation.",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "entryCode",
          "type": "string",
          "description": "The entry code."
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "The relation.",
          "customType": "EPiServer.ServiceApi.Commerce.Models.Catalog.NodeEntryRelation",
          "schema": [
            {
              "name": "SortOrder",
              "kind": "optional",
              "type": "integer<int32>",
              "description": "Gets or sets the sort order.",
              "format": "int32"
            },
            {
              "name": "NodeCode",
              "kind": "optional",
              "type": "string",
              "description": "Gets or sets the parent node code."
            },
            {
              "name": "EntryCode",
              "kind": "optional",
              "type": "string",
              "description": "Gets or sets the child node code."
            },
            {
              "name": "IsPrimary",
              "kind": "optional",
              "type": "boolean",
              "description": "<p>Gets or sets whether this relation is the primary relation for the entry\r\n(the home category).</p>"
            }
          ],
          "modelRef": "#/components/schemas/EPiServer.ServiceApi.Commerce.Models.Catalog.NodeEntryRelation",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "The node entry relation is saved.",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "EPiServer.ServiceApi.Commerce.Models.Catalog.NodeEntryRelation",
            "schema": [
              {
                "name": "SortOrder",
                "kind": "optional",
                "type": "integer<int32>",
                "description": "Gets or sets the sort order.",
                "format": "int32"
              },
              {
                "name": "NodeCode",
                "kind": "optional",
                "type": "string",
                "description": "Gets or sets the parent node code."
              },
              {
                "name": "EntryCode",
                "kind": "optional",
                "type": "string",
                "description": "Gets or sets the child node code."
              },
              {
                "name": "IsPrimary",
                "kind": "optional",
                "type": "boolean",
                "description": "<p>Gets or sets whether this relation is the primary relation for the entry\r\n(the home category).</p>"
              }
            ],
            "modelRef": "#/components/schemas/EPiServer.ServiceApi.Commerce.Models.Catalog.NodeEntryRelation",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "If the catalog 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": "<p>If entry, node or node-entry relation does not exist.</p>",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "31kZH5cS3ph5U4Ud84N9Y",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url http://localhost:64424/episerverapi/commerce/entries/{entryCode}/nodeentryrelations \\\n     --header 'accept: application/json'"
        },
        {
          "id": "fFqLK9Oo2dQMoPrp2yMsu",
          "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: 'POST',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"http://localhost:64424/episerverapi/commerce/entries/{entryCode}/nodeentryrelations\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "mjrTaGwfcOmR__AW5r0BM",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"http://localhost:64424/episerverapi/commerce/entries/{entryCode}/nodeentryrelations\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "YqshcUzRNNxo5t4_uqQV5",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"http://localhost:64424/episerverapi/commerce/entries/{entryCode}/nodeentryrelations\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "31kZH5cS3ph5U4Ud84N9Y"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// The node entry relation is saved.\n{\n  \"SortOrder\": \"\",\n  \"NodeCode\": \"\",\n  \"EntryCode\": \"\",\n  \"IsPrimary\": false\n}"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// If the catalog relation model is not valid.\n"
        },
        {
          "id": "response-2-401",
          "language": "401",
          "code": "// If user does not have enough permission for this request.\n"
        },
        {
          "id": "response-3-404",
          "language": "404",
          "code": "// If entry, node or node-entry relation does not exist.\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}