POST
Reroute goods in transit
Company space For: Stock keeper · Permission: transfer_lines.reroute Conditions
  • The transfer must be visible to the current company and must be running.
  • The company must own the transfer or be the company that created the line.
  • The line must already have left: its withdrawn stock must match its quantity, and no destination reception may be recorded.
  • The line’s remaining quantity must still equal its base quantity.
  • reroute_quantity must be at least 1 and strictly less than the line’s base quantity, so some goods stay on the original destination.
  • The original destination step must still be upcoming; the new step must belong to the transfer, be upcoming and come after the original destination.
  • When sources are sent they must match the original dispatch intent: the asset (and group) must have been dispatched and the quantity cannot exceed what was dispatched.
  • Item, unit, remaining quantity, dispatches, stock withdrawals and cost fields are refused.
What else happens
  • Creates a new line on the reroute segment carrying reroute_quantity, with the matching share of withdrawn stock, and reduces the original line to the quantity that remains.
  • Reuses the segment from the same source step to the new step, or creates it with its start time set to now.
  • Moves the share of the original segment’s route costs that belongs to the rerouted goods to the reroute segment.
  • Splits the planned dispatches between the two lines.
  • This action keeps its own response shape (original_line, rerouted_line, reroute_segment).
Part of Load goods and handle losses in transit.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

transfer
string
required

Identifier of the transfer.

segment
string
required

Identifier of the transfer segment (27-character KSUID).

line
string
required

Identifier of the transfer line (27-character KSUID).

Body

application/json
reroute_quantity
integer
required

Quantity of the line to send to the new destination, in the line's unit. Required, at least 1 and strictly less than the line's base quantity.

Required range: x >= 1
reroute_to_step_id
string
required

Identifier of the transfer step (27-character KSUID) that receives the rerouted goods. Required; it must belong to the transfer, still be upcoming and come after the line's current destination.

Required string length: 27
stockable_id
string

Not accepted: the rerouted line keeps the item of the original line.

stockable_unit_id
string

Not accepted: the rerouted line keeps the unit of the original line.

remaining_quantity
string

Not accepted: the server computes the remaining quantities of both lines from reroute_quantity.

stock_sources
string

Not accepted: use sources to choose where the rerouted goods come from.

dispatches
string

Not accepted: the planned dispatches are split by the server between the original and the rerouted line.

stock_withdrawals
string

Not accepted: the withdrawals come from the stock already withdrawn for the original line.

cost_minor
string

Not accepted: route costs are moved by the server in proportion to the goods rerouted.

cost_remainder_minor
string

Not accepted: route costs are moved by the server in proportion to the goods rerouted.

sources
object[] | null

Optional choice of the dispatched sources the rerouted quantity is taken from. Each entry must match a source of the original dispatch plan; when omitted the server picks the withdrawn stock itself.

Minimum array length: 1

Response

TransferLineRerouteResource

original_line
TransferLineResource · object
required

The original line after the reroute, reduced to the quantity that stays on its destination.

rerouted_line
TransferLineResource · object
required

The new line carrying the rerouted quantity to the new destination step.

reroute_segment
TransferSegmentResource · object
required

The segment from the original source step to the new destination step that carries the rerouted line; created by the call when none existed.