---
title: "POST /api/cascade-tracing/transactions/detach-existing-order"
method: POST
path: "/api/cascade-tracing/transactions/detach-existing-order"
tags: ["OrderTracing - Transactions"]
---

# POST /api/cascade-tracing/transactions/detach-existing-order

`POST /api/cascade-tracing/transactions/detach-existing-order`

## Request

- Base URL: `https://api.retraced.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.retraced.com/api/cascade-tracing/transactions/detach-existing-order`
- Auth: none declared

Undoes attaching a purchase order to a trace: the purchase order (any company's) is unlinked from the sales order at the end of `tracingLinkId` — a link the caller created — its own link reconnected and the attaching link disconnected, in one transaction. Answers the trace graph of `initialOrderId`, one of the caller's orders. 404 `not_found` when the purchase or sales order is missing; 400 `unable_to_unlink` when the link is missing or not the caller's, the purchase order has no link of its own, the initial order is not the caller's, or no sales order sits at the link's end.

## Request body

- object
  - `tracingLinkId` string, required
  - `purchaseOrderId` string, required
  - `salesOrderId` string, required
  - `tracingType` 'PURCHASE_ORDER' | 'SALES_ORDER', required
  - `initialOrderId` string, required

## Response `200`

Default Response

- object
  - `metadata` object, required
    - `success` boolean, required: True when the request succeeded.
  - `data` object, required
    - `layers` object[], nullable
      - `id` union, required
        - string
        - number
      - `position` number, nullable
      - `productionProcess` union
        - string
        - object
          - `id` string, required
          - `name` string
          - `position` number
      - `nodes` object[], nullable
        - `id` string, required
        - `assetCountry` string, nullable
        - `assetId` string, nullable
        - `assetType` string, nullable
        - `facilityProcesses` union[], nullable
          - union
            - string
            - object
              - …
        - `featuredFacilityProcess` union
          - string
          - object
            - `id` string, required
            - `name` string
            - `position` number
        - `productionProcess` union
          - string
          - object
            - `id` string, required
            - `name` string
            - `position` number
        - `hasSupplier` boolean, nullable
        - `canTransformProduct` boolean, nullable
        - `producingProducts` object[], nullable
          - `id` string, required
          - `name` string, nullable
          - `sku` string, nullable
          - `unit` string, nullable
          - `quantity` number, nullable
          - `lineId` string, nullable
    - `links` object[], nullable
      - `id` string, required
      - `originTracingNodeId` string, nullable
      - `destinationTracingNodeId` string, nullable
      - `isOriginCountry` union
        - boolean
        - number
      - `isInternal` union
        - boolean
        - number
      - `isConnected` union
        - boolean
        - number
    - `meta` object, nullable
      - `orderId` string, nullable
      - `type` string, nullable
      - `attachmentTemplateId` string, nullable
      - `traceType` string, nullable
      - `order` object, nullable
        - `id` string, required
        - `deliveryDate` string, date-time, nullable
        - `orderType` string, nullable
        - `tracingOrderTags` unknown
        - `orderNumber` string, nullable
        - `orderDate` string, date-time, nullable
        - `tracingOrderId` string, nullable
        - `companyId` string, nullable
        - `originTracingNodeId` string, nullable
        - `destinationTracingNodeId` string, nullable
        - `receiverTracingNodeId` string, nullable
        - `status` string, nullable
        - `agreedDeliveryDate` string, date-time, nullable
        - `tracingSalesOrderNumber` string, nullable
        - `buyerCompanyId` string, nullable
        - `supplierCompanyId` string, nullable
        - `receiverCompanyId` string, nullable
        - `tracingAttachmentTemplateId` string, nullable
        - `scDocCompletionPercentage` number, nullable
        - `docCompletionPercentage` number, nullable
        - `lastProductionProcessId` string, nullable
        - `totalUploadedDocumentTypes` number, nullable
        - `totalRequiredDocumentTypes` number, nullable
        - `lastProductionProcessName` string, nullable
        - `isInternal` union
          - boolean
          - number
        - `color` string, nullable
        - `depthLevel` number, nullable
        - `attachmentTemplate` object, nullable
          - `id` string, required
          - `name` string, nullable
          - `tracingType` string, nullable
          - `description` string, nullable
          - `companyId` string, nullable
          - `isActive` union
            - boolean
            - number
        - `lines` unknown[], nullable
          - unknown
        - `salesOrder` object, nullable
          - `id` string, required
          - `orderNumber` string, nullable
          - `orderDate` string, date-time, nullable
          - `deliveryDate` string, date-time, nullable
          - `buyerCompanyId` string, nullable
          - `supplierCompanyId` string, nullable
          - `receiverCompanyId` string, nullable
          - `tracingOrderId` string, nullable
          - `companyId` string, nullable
          - `originTracingNodeId` string, nullable
          - `destinationTracingNodeId` string, nullable
          - `receiverTracingNodeId` string, nullable
          - `status` string, nullable
          - `agreedDeliveryDate` string, date-time, nullable
          - `tracingPurchaseOrderNumber` string, nullable
        - `linkedSalesOrders` object[], nullable
          - `id` string, required
          - `destinationTracingNodeId` string, nullable
          - `originTracingNodeId` string, nullable
          - `receiverTracingNodeId` string, nullable
          - `tracingSalesOrderId` string, nullable
          - `tracingPurchaseOrderId` string, nullable
          - `isInternal` union
            - boolean
            - number
          - `buyerCompanyId` string, nullable
          - `supplierCompanyId` string, nullable
          - `receiverCompanyId` string, nullable
        - `buyerCompany` object, nullable
          - `id` string, required
          - `name` string, nullable
          - `officialName` string, nullable
          - `country` string, nullable
          - `countryName` string, nullable
          - `facilityProcesses` union
            - string
            - unknown[]
              - …
        - `supplierCompany` object, nullable
          - `id` string, required
          - `name` string, nullable
          - `officialName` string, nullable
          - `country` string, nullable
          - `countryName` string, nullable
          - `facilityProcesses` union
            - string
            - unknown[]
              - …
        - `receiverCompany` object, nullable
          - `id` string, required
          - `name` string, nullable
          - `officialName` string, nullable
          - `country` string, nullable
          - `countryName` string, nullable
          - `facilityProcesses` union
            - string
            - unknown[]
              - …
        - `purchaseOrderResponsibleUsers` unknown[], nullable
          - unknown
        - `salesOrderResponsibleUsers` unknown[], nullable
          - unknown
        - `aiSummary` unknown
    - `order` object, nullable
      - `id` string, required
      - `deliveryDate` string, date-time, nullable
      - `orderType` string, nullable
      - `tracingOrderTags` unknown
      - `orderNumber` string, nullable
      - `orderDate` string, date-time, nullable
      - `tracingOrderId` string, nullable
      - `companyId` string, nullable
      - `originTracingNodeId` string, nullable
      - `destinationTracingNodeId` string, nullable
      - `receiverTracingNodeId` string, nullable
      - `status` string, nullable
      - `agreedDeliveryDate` string, date-time, nullable
      - `tracingSalesOrderNumber` string, nullable
      - `buyerCompanyId` string, nullable
      - `supplierCompanyId` string, nullable
      - `receiverCompanyId` string, nullable
      - `tracingAttachmentTemplateId` string, nullable
      - `scDocCompletionPercentage` number, nullable
      - `docCompletionPercentage` number, nullable
      - `lastProductionProcessId` string, nullable
      - `totalUploadedDocumentTypes` number, nullable
      - `totalRequiredDocumentTypes` number, nullable
      - `lastProductionProcessName` string, nullable
      - `isInternal` union
        - boolean
        - number
      - `color` string, nullable
      - `depthLevel` number, nullable
      - `attachmentTemplate` object, nullable
        - `id` string, required
        - `name` string, nullable
        - `tracingType` string, nullable
        - `description` string, nullable
        - `companyId` string, nullable
        - `isActive` union
          - boolean
          - number
      - `lines` unknown[], nullable
        - unknown
      - `salesOrder` object, nullable
        - `id` string, required
        - `orderNumber` string, nullable
        - `orderDate` string, date-time, nullable
        - `deliveryDate` string, date-time, nullable
        - `buyerCompanyId` string, nullable
        - `supplierCompanyId` string, nullable
        - `receiverCompanyId` string, nullable
        - `tracingOrderId` string, nullable
        - `companyId` string, nullable
        - `originTracingNodeId` string, nullable
        - `destinationTracingNodeId` string, nullable
        - `receiverTracingNodeId` string, nullable
        - `status` string, nullable
        - `agreedDeliveryDate` string, date-time, nullable
        - `tracingPurchaseOrderNumber` string, nullable
      - `linkedSalesOrders` object[], nullable
        - `id` string, required
        - `destinationTracingNodeId` string, nullable
        - `originTracingNodeId` string, nullable
        - `receiverTracingNodeId` string, nullable
        - `tracingSalesOrderId` string, nullable
        - `tracingPurchaseOrderId` string, nullable
        - `isInternal` union
          - boolean
          - number
        - `buyerCompanyId` string, nullable
        - `supplierCompanyId` string, nullable
        - `receiverCompanyId` string, nullable
      - `buyerCompany` object, nullable
        - `id` string, required
        - `name` string, nullable
        - `officialName` string, nullable
        - `country` string, nullable
        - `countryName` string, nullable
        - `facilityProcesses` union
          - string
          - unknown[]
            - unknown
      - `supplierCompany` object, nullable
        - `id` string, required
        - `name` string, nullable
        - `officialName` string, nullable
        - `country` string, nullable
        - `countryName` string, nullable
        - `facilityProcesses` union
          - string
          - unknown[]
            - unknown
      - `receiverCompany` object, nullable
        - `id` string, required
        - `name` string, nullable
        - `officialName` string, nullable
        - `country` string, nullable
        - `countryName` string, nullable
        - `facilityProcesses` union
          - string
          - unknown[]
            - unknown
      - `purchaseOrderResponsibleUsers` unknown[], nullable
        - unknown
      - `salesOrderResponsibleUsers` unknown[], nullable
        - unknown
      - `aiSummary` unknown

## Other responses

- `400`: Default Response
- `401`: Default Response
- `403`: Default Response
- `404`: Default Response

## Changes

> 108 revisions in range; 2 not diffed.

- **2026-10-11** `363dc33b9509`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/retraced/apis/api-reference/changes/api/cascade-tracing/transactions/detach-existing-order/post.md)

---

[API](https://skmtc.dev/retraced/apis/api-reference.md) - [All operations](https://skmtc.dev/retraced/apis/api-reference/llms.txt) - [OpenAPI document](https://skmtc.dev/retraced/apis/api-reference/revisions/83309c4abd20?raw)
