Create a node's product relationships
POSThttps://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
- 201
- 403
- 404
- 422
- 500
Successfully returns the updated node
Forbidden
Bad Request. Not Found.
Bad request. The request failed validation.
Internal server error. There was a system failure in the platform.
Authorization: http
name: bearerAuthtype: httpscheme: bearer
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
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());
ResponseClear