Update a custom relationship
PUThttps://euwest.api.elasticpath.com/pcm/custom-relationships/:customRelationshipSlug
Updates a custom relationship.
A partial update can be performed, where you specify only the fields that need to be changed.
The custom relationship slug cannot be updated.
Request
Responses
- 200
- 403
- 404
- 422
- 500
Successfully returns the updated custom relationship
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.Put, "https://euwest.api.elasticpath.com/pcm/custom-relationships/:customRelationshipSlug");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("{\n \"data\": {\n \"id\": \"00000000-0000-0000-0000-000000000000\",\n \"type\": \"custom-relationship\",\n \"attributes\": {\n \"name\": \"Related Products\",\n \"description\": \"A list of related products shown on the PDP.\",\n \"slug\": \"CRP_related_products\",\n \"sort_order\": 5,\n \"external_name\": \"Similar items to consider\",\n \"external_description\": \"Check out these similar products that may also meet your needs or match your preferences.\",\n \"bi_directional\": false\n }\n }\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
ResponseClear