How to request bids from partners
The RequestBids
mutation allows users to request bids from partner carriers, facilitating the assignment of orders and enhancing collaboration in the shipping process.
- NodeJS
const fetch = require('node-fetch');
const url = "https://backend.impargo.eu/";
const options = {
method: "POST",
headers: {
"authorization": token,
"content-type": "application/json",
},
body: JSON.stringify([
{
operationName: "RequestBids",
variables: {
companyOrderId: "6367c8997aa0d87c7c6d312e",
carriers: ["5fda2b6f7846dd8841bcdea9"]
},
query: `mutation RequestBids($carriers: [ObjectId!]!, $companyOrderId: ObjectId!) {
requestBids(carriers: $carriers, companyOrderId: $companyOrderId) {
...CompanyOrder
__typename
}
}
fragment Takeover on Takeover {
_id
company
companyName
status
decliningComment
__typename
}
fragment DriverLocation on DriverLocation {
timestamp
lat
lon
heading
speed
battery
__typename
}
fragment Event on Event {
_id
timestamp
eventType
eventDetails {
... on OrderDetails {
sourceId
companyId
user {
_id
company
firstname
lastname
email
__typename
}
fusedOrders {
_id
reference
__typename
}
__typename
}
... on OrderDocumentDetails {
sourceId
orderFileType
stopRef
driverId
files {
orderFileType
fileDetails {
name
url
__typename
}
__typename
}
fileDetails {
name
url
__typename
}
companyId
user {
_id
company
firstname
lastname
email
__typename
}
__typename
}
... on OrderStatusDetails {
sourceId
orderStatus
driverId
companyId
user {
_id
company
firstname
lastname
email
__typename
}
location {
...DriverLocation
__typename
}
__typename
}
... on StopStatusDetails {
sourceId
orderId
stopStatus
driverId
companyId
statusUpdateComment
stopFiles: files {
orderFileType
fileDetails {
name
url
__typename
}
__typename
}
user {
_id
company
firstname
lastname
email
__typename
}
location {
...DriverLocation
__typename
}
__typename
}
... on OrderChangeRequestDetails {
sourceId
companyId
changeRequestId
changeRequestComment
user {
_id
company
firstname
lastname
email
__typename
}
__typename
}
... on OrderChangeRequestStatusDetails {
sourceId
companyId
changeRequestId
changeRequestStatus
changeRequestDeclineComment
user {
_id
company
firstname
lastname
email
__typename
}
__typename
}
... on OffersRequestedDetails {
companyId
user {
firstname
lastname
company
email
__typename
}
bids {
_id
companyName
status
amount
expiresAt
comment
receivingUser {
firstname
lastname
telephone
__typename
}
__typename
}
__typename
}
... on OrderFusedDetails {
sourceId
user {
firstname
lastname
company
email
__typename
}
resultingOrder {
_id
reference
__typename
}
__typename
}
__typename
}
__typename
}
`
}
])
};
fetch(url, options)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
- Response
[
{
"data":{
"requestBids":null
}
}
]