Charter whole or part of a transport - Affrètement
Operations you have to perform to handle chartering.
Tip: it is easier to deal with many transports when you store their Dashdoc uid in you system. Transport uid is given in the reponse of the transport creation endoint.
Creating chartered transports (no break, A→B)
create the transport with no information about chartering first
POST on /api/v4/transports/
call the charter API to charter the transport or the segment (equivalent for a simple transport)
POST on /api/v4/transports/<transport_uid>/charter/
or POST on /api/v4/segments/charter/?uid__in=<segment_uid>
Not possible, use chartering instructions which will be saved in the child transport general instructions.
Deleting/cancelling chartered transports
Cancel the parent transport.
POST on /api/v4/transports/<transport_uid>/cancel/
This will also cancel all chartered (children) transports.
Updating chartered transports
Update non-structural information (date, times, loading/unloading addresses, instructions, loads)
PATCH on /api/v4/transports/<transport_uid>/
or PATCH on /api/v4/segments/<segment_uid>/
The updated information flows down to the child transport
Update the license plates
PATCH on /api/v4/transports/<transport_uid>/charter/
or PATCH on /api/v4/segments/<segment_uid>/charter
with
Change the structure of the transport (e.g. A→B to A→B→C)
Cancel the transport (this will also cancel the child transport) and re-create a new transport, then charter it according to the new transport structure.
If structure is changed on a chartered transport, Dashdoc API returns an error.
Changing the chartered carrier
Changing the chartered carrier
on chartered transport
DELETE on /api/v4/transport/<transport_uid>/charter/ No payload required.
This will cancel the child transport.
POST on /api/v4/transports/<transports_uid>/charter/ with the new carrier information. This will create a new chartered transport.
on chartered segment
DELETE on /api/v4/segments/charter/?uid__in=<segment_uid> No payload required.
This will cancel the child transport.
POST on /api/v4/segments/charter/?uid__in=<segment_uid> with the new carrier information. This will create a new chartered transport.
Go from a chartered transport to a transport carried by you
On chartered transport
DELETE on /api/v4/transport/<transport_uid>/charter/ No payload required.
This will cancel the child transport.
Call POST on /api/v4/transports/<transport_uid>/assign/ with the id of the trucker.
On chartered segment
DELETE on /api/v4/segments/charter/?uid__in=<segment_uid> No payload required.
This will cancel the child transport.
Call PATCH on /api/v4/segments/<segment_uid>/ with trucker info.
Go from a transport carried by you to a chartered transport
POST on /api/v4/transports/<transport_uid>/charter/ with the id of the carrier.
or POST on /api/v4/segments/charter/?uid__in=<segment_uid> with the id of the carrier.
It will unassign your truckers from the chartered segments.
Complex transports
Create a transport with one part with a trucker and the second part chartered
Create a complex transport with 2 segments.
Call PATCH on /api/v4/segments/<segment_1_uid>/ with trucker info
Call POST on /api/v4/segments/charter/?uid__in=<segment_2_uid> with the id of the carrier
Create a transport with 2 different chartered carriers
Create a complex transport with 2 segments.
Call POST on /api/v4/segments/charter/?uid__in=<segment_1_uid> with the id of carrier 1
Call POST on /api/v4/segments/charter/?uid__in=<segment_2_uid> with the id of carrier 2
Create a transport with several segments chartered to another carrier
Create a complex transports where all segments are not assigned to the same carrier and at least two segments are chartered to another carrier.
Example: A→B →C →D where :
A → B is assigned to a trucker
B →C and C → D are chartered to another carrier
call POST on /api/v4/segments/charter/?uid__in=uid_B-C,uid_C-D
The API controls that segments are from the same transport and exist in this order.
In this case the number of chartered segments is unlimited and may occur anywhere in the list of segments from the original transport.