Reactivate a deleted logistic order line

This page explains how to delete and reactivate a line of a validated logistic order with the admin API, so that a deletion made by mistake can be undone without losing the original line.


Introduction

A line deleted from a validated logistic order stays in the order with the status DELETED, out of the totals. Previously, the only way to fix a mistaken deletion was to add the line again, which created a new line and lost the original one.

You can now reactivate a DELETED line by applying the status ACTIVE to it. The line comes back in the order as an added line would, keeping its identity.


Key concepts

ConceptDescription
status: "DELETED"Removes the line from the totals and keeps it in the order. Unchanged behaviour.
status: "ACTIVE"Reactivates a DELETED line. It is a request value only: an active line is read back without status.
Former valuesWithout quantity, productPriceWithoutTaxes or productTaxRate in the request, the values from before the deletion are kept.
Modifiable orderReactivation, like deletion, requires an order that can still be modified.
All or nothingA refused reactivation leaves the order completely unchanged.

Access: dj-client: OPERATOR or SUPPLIER. The VALIDATED_ORDER_UPDATE permission is required. A supplier user can only reactivate lines of its own orders.


Typical workflow

sequenceDiagram
    participant Client
    participant DJUST as DJUST API

    Client->>DJUST: PATCH /v1/logistic-orders/{orderLogisticId}/lines (status DELETED)
    DJUST-->>Client: 200 OK (line out of the totals)
    Note over Client: Deletion made by mistake
    Client->>DJUST: PATCH /v1/logistic-orders/{orderLogisticId}/lines (status ACTIVE)
    DJUST-->>Client: 200 OK (line back in the order)
  1. Identify the DELETED line and its lineId (DJUST business ID) by reading the logistic order.
  2. Send ADM-ORDER-203 with status: "ACTIVE" for that line. Optionally add a new quantity, productPriceWithoutTaxes and productTaxRate.
  3. On success, check the recalculated totals and shipping fees on the logistic order.
  4. The change does not send the order to export: trigger the export yourself if needed.

What happens on reactivation:

  • The offer stock is decreased by the reactivated quantity.
  • The totals are recalculated.
  • Shipping fees are recalculated, unless they were typed manually.
  • The order history records the reactivation as a line addition. A line deleted then reactivated within the same save generates no entry.

Key endpoints involved

MethodPathOperationId
PATCH/v1/logistic-orders/{orderLogisticId}/linesADM-ORDER-203

idType (DJUST_ID by default, EXTERNAL_ID or REFERENCE) applies to the orderLogisticId path parameter only. Line identifiers in the body are DJUST business IDs.


Best practices

  • Send only the fields you want to change: the others keep their value.
  • Omit quantity, price and tax rate to restore the line exactly as it was before the deletion.
  • Make sure the order is still modifiable before reactivating.
  • Check the available stock of the offer first: reactivation is refused when it is insufficient.
  • A request can contain several lines, each at most once. Either every change is applied or none is.

Common mistakes

MistakeResultFix
Reactivating a line that is already active400Only a DELETED line can be reactivated.
Reactivating a CANCELED or DECLINED_BY_SUPPLIER lineRefused, order unchangedThese lines cannot be reactivated.
Sending a new quantity, price or tax rate along with DELETED400Send them only with ACTIVE.
Reactivating while another active line holds the same offer at the same unit price409, order unchangedChange the unit price of the reactivated line or update the existing line instead.
Reactivating on a non-modifiable order409, order unchangedCheck the order status before the call.
Reactivating with insufficient stock409, order unchangedIncrease the stock or reduce the quantity.
Deleting the last line counted in the totals409Cancel the order instead.

Error / Warning codes


Example scenarios

Undo a mistaken deletion with the former values

PATCH /v1/logistic-orders/LO-2026-000123/lines
dj-client: OPERATOR
dj-api-key: <your-api-key>
Content-Type: application/json
{
  "lines": [
    {
      "lineId": "0009012345",
      "status": "ACTIVE"
    }
  ]
}

The line returns with its quantity, unit price and tax rate from before the deletion.

Reactivate with a new quantity and price

{
  "lines": [
    {
      "lineId": "0009012345",
      "status": "ACTIVE",
      "quantity": 3,
      "productPriceWithoutTaxes": 12.5,
      "productTaxRate": 20
    }
  ]
}
⚠️

Warning: If the shipping fees were typed manually on the order, they are not recalculated by the reactivation.

✅

Tip: Deleting a line still works as before, with "status": "DELETED" and no quantity, price or tax rate on the same line.


Did this page help you?