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
| Concept | Description |
|---|---|
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 values | Without quantity, productPriceWithoutTaxes or productTaxRate in the request, the values from before the deletion are kept. |
| Modifiable order | Reactivation, like deletion, requires an order that can still be modified. |
| All or nothing | A 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)
- Identify the
DELETEDline and itslineId(DJUST business ID) by reading the logistic order. - Send ADM-ORDER-203 with
status: "ACTIVE"for that line. Optionally add a newquantity,productPriceWithoutTaxesandproductTaxRate. - On success, check the recalculated totals and shipping fees on the logistic order.
- 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
| Method | Path | OperationId |
|---|---|---|
| PATCH | /v1/logistic-orders/{orderLogisticId}/lines | ADM-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
| Mistake | Result | Fix |
|---|---|---|
| Reactivating a line that is already active | 400 | Only a DELETED line can be reactivated. |
Reactivating a CANCELED or DECLINED_BY_SUPPLIER line | Refused, order unchanged | These lines cannot be reactivated. |
Sending a new quantity, price or tax rate along with DELETED | 400 | Send them only with ACTIVE. |
| Reactivating while another active line holds the same offer at the same unit price | 409, order unchanged | Change the unit price of the reactivated line or update the existing line instead. |
| Reactivating on a non-modifiable order | 409, order unchanged | Check the order status before the call. |
| Reactivating with insufficient stock | 409, order unchanged | Increase the stock or reduce the quantity. |
| Deleting the last line counted in the totals | 409 | Cancel the order instead. |
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.
Updated 8 days ago

