Skip to main content

Detach multiple nodes

POST 

https://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.

OperatorAttributeDescriptionExample
eqid, 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, descriptionEquals. 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)
likesku, slug, upc_ean, manufacturer_part_num, name, tags, description, external_refLike. Checks if the operand contains the specified string. Wildcards are supported.?filter=like(name,*some-name*)
inid, name, sku, slug, upc_ean, manufacturer_part_num, product_types, parent_id, tags, external_refChecks 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)
gtid, created_at, updated_at, external_refGreater than. Checks if the value of the field is greater than the given value.?filter=gt(updated_at,2024-01-01T00:00:00Z)
geid, created_at, updated_at, external_refGreater 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)
ltid, created_at, updated_at, external_refLess than. Checks if the value of the field is less than the given value.?filter=lt(updated_at,2025-01-01T00:00:00Z)
leid, created_at, updated_at, external_refLess 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.isbnFilters using a nested extension field.?filter=eq(extensions.book.isbn,1765426)

Request

Bodyrequired

    data objectrequired
    filterstringrequired

    You can apply filters to search for the appropriate products to detach. See Detach multiple nodes.

    Example: eq(sku,book)
    node_idsstring[]required

    A list of node unique identifiers that you want to assign to the products.

    Example: ["123"]

Responses

The request dissociates the products that you have selected from multiple hierarchies and their children and returns the following.

Schema
    meta object
    nodes_detachedinteger

    Number of nodes dissociated from the products.

    nodes_not_foundstring[]

    A list of node unique identifiers that could not be identified.

    Example: ["123"]

Authorization: http

name: bearerAuthtype: httpscheme: bearer
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());
Request Collapse all
Base URL
https://euwest.api.elasticpath.com
Auth
Body required
{
  "data": {
    "filter": "eq(sku,book)",
    "node_ids": [
      "123"
    ]
  }
}
ResponseClear

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

We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies.