Skip to main content

Create a node's product relationships

POST 

https://euwest.api.elasticpath.com/pcm/hierarchies/:hierarchyID/nodes/:nodeID/relationships/products

Creates relationships between the specified node and one or more products in a specified hierarchy.

Request

Responses

Successfully returns the updated node

Authorization: http

name: bearerAuthtype: httpscheme: bearer
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://euwest.api.elasticpath.com/pcm/hierarchies/:hierarchyID/nodes/:nodeID/relationships/products");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("{\n \"data\": [\n {\n \"id\": \"00000000-0000-0000-0000-000000000000\",\n \"type\": \"product\"\n }\n ]\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Request Collapse all
Base URL
https://euwest.api.elasticpath.com
Auth
Parameters
— pathrequired
— pathrequired
Body
{
  "data": [
    {
      "id": "00000000-0000-0000-0000-000000000000",
      "type": "product"
    }
  ]
}
ResponseClear

Click the Send API Request button above and see the response here!