Detach multiple nodes
POSThttps://euwest.api.elasticpath.com/pcm/products/detach_nodes
Dissociates products from multiple hierarchies and their children nodes. You can apply filters to search for the appropriate products to detach. For general filtering syntax, see Filtering.
The following attributes and operators are supported.
Operator | Attribute | Description | Example |
---|---|---|---|
eq | id , sku , slug , upc_ean , manufacturer_part_num , name , templates , commodity_type , owner , product_types , parent_id , tags , status , has_nodes (false only) , created_at , updated_at , external_ref , description | Equals. Checks if the values of two operands are equal. If they are, the condition is true. For product_types , you can only specify one product type. Note: has_nodes can only be filtered as false . | ?filter=eq(name,some-name) |
like | sku , slug , upc_ean , manufacturer_part_num , name , tags , description , external_ref | Like. Checks if the operand contains the specified string. Wildcards are supported. | ?filter=like(name,*some-name*) |
in | id , name , sku , slug , upc_ean , manufacturer_part_num , product_types , parent_id , tags , external_ref | Checks if the values are included in the specified list. If they are, the condition is true. For product_types , you can specify more than one product type. | ?filter=in(id,some-id) |
gt | id , created_at , updated_at , external_ref | Greater than. Checks if the value of the field is greater than the given value. | ?filter=gt(updated_at,2024-01-01T00:00:00Z) |
ge | id , created_at , updated_at , external_ref | Greater than or equal to. Checks if the value of the field is greater than or equal to the given value. | ?filter=ge(created_at,2023-01-01T00:00:00Z) |
lt | id , created_at , updated_at , external_ref | Less than. Checks if the value of the field is less than the given value. | ?filter=lt(updated_at,2025-01-01T00:00:00Z) |
le | id , created_at , updated_at , external_ref | Less than or equal to. Checks if the value of the field is less than or equal to the given value. | ?filter=le(created_at,2022-01-01T00:00:00Z) |
eq (extensions) | extensions.book.isbn | Filters using a nested extension field. | ?filter=eq(extensions.book.isbn,1765426) |
Request
- application/json
Bodyrequired
data objectrequired
Responses
- 200
- 400
- 422
- 500
The request dissociates the products that you have selected from multiple hierarchies and their children and returns the following.
- application/json
- Schema
- Example (auto)
- created-product
Schema
meta object
{
"meta": {
"nodes_detached": 0,
"nodes_not_found": [
"123"
]
}
}
Detach multiple nodes
{
"meta": {
"nodes_detached": 1,
"nodes_not_found": []
}
}
Bad request. The request failed validation.
- application/json
- Schema
- Example (auto)
- bad-request
Schema
errors undefined[]required
{
"errors": [
{
"status": "500",
"title": "Internal server error",
"detail": "An internal error has occurred.",
"request_id": "00000000-0000-0000-0000-000000000000",
"meta": {
"missing_ids": [
"e7d50bd5-1833-43c0-9848-f9d325b08be8"
]
}
}
]
}
{
"errors": [
{
"title": "Bad Request",
"detail": "Could not parse the supplied filter",
"status": "400"
}
]
}
Bad request. The request failed validation.
- application/json
- Schema
- Example (auto)
- failed-validation
Schema
errors undefined[]required
{
"errors": [
{
"status": "500",
"title": "Internal server error",
"detail": "An internal error has occurred.",
"request_id": "00000000-0000-0000-0000-000000000000",
"meta": {
"missing_ids": [
"e7d50bd5-1833-43c0-9848-f9d325b08be8"
]
}
}
]
}
{
"errors": [
{
"title": "Failed Validation",
"status": "422",
"detail": "<XYZ> can not be empty"
}
]
}
Internal server error. There was a system failure in the platform.
- application/json
- Schema
- Example (auto)
- internal-server-error
Schema
errors undefined[]required
{
"errors": [
{
"status": "500",
"title": "Internal server error",
"detail": "An internal error has occurred.",
"request_id": "00000000-0000-0000-0000-000000000000",
"meta": {
"missing_ids": [
"e7d50bd5-1833-43c0-9848-f9d325b08be8"
]
}
}
]
}
{
"errors": [
{
"status": "500",
"title": "Internal Server Error",
"detail": "There was an internal server error, you can report with your request id.",
"request_id": "635da56d-75a1-43cd-b696-7ab119756b3a"
}
]
}
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/products/detach_nodes");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("{\n \"data\": {\n \"filter\": \"eq(sku,book)\",\n \"node_ids\": [\n \"123\"\n ]\n }\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
ResponseClear