POST
Add a route leg
Company space For: Stock keeper, Manager · Permission: transfer_route_legs.create Conditions
  • Only the company that owns the transfer can add a leg.
  • The transfer must be draft or running.
  • Each end must be given either as a step id or as a step position (1 or more); both ends are required, and the id wins when both forms are sent.
  • Both steps must belong to the transfer and the end must sit exactly one position after the start.
  • Only one leg can join a given pair of steps in a transfer.
  • When costs are sent, each needs a label (up to 255 characters) and an amount in major units, non-negative with at most currency_exponent decimals; amount_minor is refused.
  • After the change every transfer segment must still be covered by a complete, continuous chain of legs, otherwise the call is refused.
What else happens
  • The route-leg links of the transfer segments are recomputed.
  • When costs are sent they are recorded on the new leg for the current company and user.
Part of Transport legs, vehicles and costs.

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.

Body

application/json
from_step_id
string | null

Identifier of the step where the leg starts (27 characters). Required unless from_step_position is sent; when both are sent the id is used.

Required string length: 27
from_step_position
integer | null

Position (1 or more) of the step where the leg starts. Required unless from_step_id is sent.

Required range: x >= 1
to_step_id
string | null

Identifier of the step where the leg ends. Required unless to_step_position is sent. The end step must come right after the start step.

Required string length: 27
to_step_position
integer | null

Position of the step where the leg ends; it must equal the start position plus one. Required unless to_step_id is sent.

Required range: x >= 1
costs
object[] | null

Costs to record on the new leg at creation. Not accepted on update; use the route leg cost endpoints instead.

Response

TransferRouteLegResource

id
string
required

Identifier of the route leg.

transfer_id
string
required

Identifier of the transfer.

from_step_id
string
required

Step the leg starts from.

to_step_id
string
required

Step the leg arrives at; always the next step in order.

created_at
string<date-time>
required

Date and time the record was created (ISO 8601, UTC).

updated_at
string<date-time>
required

Date and time the record was last changed (ISO 8601, UTC).

cost_total_minor
integer

Total of the leg's costs in minor units (divide by 10 to the power currency_exponent). Present only when costs are loaded.

costs
TransferRouteLegCostResource · object[]

Cost lines of the leg (label and amount); shown to the owner company only.

from_step
TransferStepResource · object

Starting step, when included.

to_step
TransferStepResource · object

Arrival step, when included.