Order Schema
Orders, auctions, templates and forms.
Popular queries and mutations
Create order (mutation)
Creates a new order with loading and unloading depots. Get formId from orderForms, transportTypeId from formFields. Transport modes: road, rail, ship, air. Depot types: load, unload. Response message contains the created order ID.
mutation CreateOrder(
$transportModeCode: String!
$formId: String!
$transportTypeId: Int!
$depots: [DepotInput!]!
$details: DetailsInput
) {
createOrder(
transportModeCode: $transportModeCode
formId: $formId
transportTypeId: $transportTypeId
depots: $depots
details: $details
) {
success
message
}
}
# Variables (replace formId and transportTypeId):
{
"transportModeCode": "road",
"formId": "YOUR_ORDER_FORM_ID",
"transportTypeId": 1,
"depots": [
{
"position": 1,
"type": "load",
"dateStart": "2025-03-10",
"dateEnd": "2025-03-10",
"timeStart": "09:00",
"timeEnd": "12:00",
"warehouseName": "Warehouse A",
"companyName": "Sender Ltd",
"contactPerson": "John Doe",
"contactPhone": "+1234567890",
"location": {
"country": "Germany",
"region": "Bavaria",
"city": "Munich",
"fullAddress": "Munich, Bavaria, Germany",
"countryCode": "DE",
"lat": 48.1351,
"lon": 11.5820
}
},
{
"position": 2,
"type": "unload",
"warehouseName": "Warehouse B",
"companyName": "Receiver Ltd",
"contactPerson": "Jane Smith",
"contactPhone": "+0987654321",
"location": {
"country": "France",
"region": "Île-de-France",
"city": "Paris",
"fullAddress": "Paris, Île-de-France, France",
"countryCode": "FR",
"lat": 48.8566,
"lon": 2.3522
}
}
],
"details": {
"comment": "Fragile cargo",
"capacityPallets": 33
}
}
Get order with all fields (query)
Fetches order by ID with all available fields including depots, cargos, details, carrier and auction info.
query GetOrder($id: String!) {
order(id: $id) {
id
internalId
deliveryNumber
formId
route
status
isEditable
payerId
transportMode {
id
code
}
transportType {
id
code
}
user {
id
email
firstName
lastName
}
company {
id
name
registrationNumber
}
depots {
id
position
type
dateStart
dateEnd
timeStart
timeEnd
warehouseName
companyName
contactPerson
contactPhone
terminalName
etd
eta
location {
id
country
region
city
street
houseNumber
fullAddress
countryCode
postalCode
lat
lon
}
}
cargos {
id
name
type
weight
capacity
temperature
packageType
cargoItemsCount
}
details {
distance
transportDirection
comment
commentToAddress
internalComment
capacityPallets
loadingType
}
detailsInternational { customsDeparture customsDestination declarationNumber }
detailsRail { vanNumber vanType vanCount vanCapacity }
detailsShip { vesselName voyageNumber bookingNumber }
detailsAir { flightNumber awbNumber }
carrier {
id
price
currency
paymentMethod
vehicle { id }
company { id name }
counterparty { id name }
}
auction {
auctionTypeCode
currency
startedAt
plannedStopAt
members { id }
currentMinBet { price }
currentMaxBet { price }
winnerBet { id }
}
}
}
# Variables:
{ "id": "YOUR_ORDER_ID" }
Queries
-
formFields
Returns a list of field definitions for order forms (used when creating or editing forms).
-
orderForm
Returns a single order form by ID.
-
orderForms
Returns a paginated list of order forms.
-
order
Returns order details by ID.
-
orders
Returns a paginated list of orders with optional filters.
-
orderTemplates
Returns a list of saved order templates.
Mutations
-
createOrderForm
Creates a new order form with name, fields and transport modes.
-
updateOrderForm
Updates an existing order form.
-
deleteOrderForm
Deletes an order form.
-
setDefaultOrderForm
Sets an order form as the default for the company.
-
createOrder
Creates a new order with details, depots and transport configuration.
-
updateOrder
Updates an existing order.
-
deleteOrder
Deletes an order.
-
saveCargosToOrder
Adds or updates cargo items on an order.
-
createCounterpartyToOrder
Adds a counterparty (carrier) to an order with price and vehicle data.
-
updateCounterpartyToOrder
Updates counterparty (carrier) data on an order.
-
createVehicleToOrder
Adds a vehicle to an order carrier.
-
createAuction
Creates an auction for an order (reduction or other type).
-
resetAuction
Resets an auction to its initial state.
-
createBet
Places a bet in an auction.
-
selectWinningBet
Selects the winning bet and assigns the carrier to the order.
-
deleteBet
Removes a bet from an auction.
-
createOrderTemplate
Saves an order as a template for reuse.
-
updateOrderTemplate
Updates an existing order template.
-
deleteOrderTemplate
Deletes an order template.