POST
Create a stock transfer
Company space For: Stock keeper, Manager · Permission: transfers.create Conditions
  • motif (at most 255 characters) and cost_distribution_method (average or prorata) are required. type and status are not accepted.
  • Either trip_id or both steps and route_legs (at least one each) must be sent; trip_id cannot be combined with steps, route_legs, segments or vehicles.
  • With trip_id, the trip must be visible to the company and active, with at least two location group stops and a complete set of legs between them.
  • Each step needs a position and a location group of the organization that holds at least one location. Each vehicle must be a vehicle asset of the organization.
  • The route must have exactly one route leg between every two consecutive steps, in order. Route leg cost amounts are in major units with at most the currency decimals; amount_minor is not accepted.
  • Segment lines need a tracked stock item and unit of the organization and a base quantity of at least 1; costs, dates, stock_sources and stock_withdrawals on segments or lines are not accepted.
What else happens
  • Creates the transfer as a draft owned by the current company, with the current user as creator, plus its steps, route legs, costs, segments, lines and vehicles. With a trip, steps, route legs (with the company’s rates, and trip-level rates split equally with the remainder on the first leg) and vehicles are copied from the trip. No stock moves until it is started.
Part of Plan and run stock transfers.

Authorizations

Authorization
string
header
required

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

Response

TransferResource

id
string
required

Identifier of the transfer.

trip_id
string | null
required

Identifier of the trip template it was created from; null otherwise.

company_id
string
required

Identifier of the company the record belongs to.

organization_id
string
required

Identifier of the organization the record belongs to.

motif
string
required

Reason of the transfer, free text.

type
string
required

Legacy classification, simple or complex. New transfers are complex.

status
string
required

draft (being planned), running, finished or cancelled. Finished and cancelled are final.

cost_distribution_method
string
required

How route costs are spread over the goods: average or prorata. Fixed at creation.

creator_user_id
string | null
required

Member who created the transfer.

pilot_user_id
string | null
required

Member who started the transfer; null until it starts.

started_at
string<date-time> | null
required

When the transfer was started, ISO 8601; null for a draft.

finished_at
string<date-time> | null
required

When it was finished or cancelled, ISO 8601; null until then.

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).

in_transit
array

Goods currently in transit: one entry per stock item with stockable_id and the quantity in the reference unit of the item.

steps
TransferStepResource · object[]

Steps of the route, in the loaded detail view.

route_legs
TransferRouteLegResource · object[]

Route legs between consecutive steps, with costs for the owner company.

segments
TransferSegmentResource · object[]

Segments carrying lines of goods between two steps.

vehicles
TransferVehicleResource · object[]

Vehicles assigned to the transfer.