Skip to main content

How to import orders

GraphQL mutation

You can import orders directly from spreadsheets, streamlining your order management process. We offer a user-friendly template that allows you to import up to 10,000 orders at once.


const fetch = require("node-fetch")

fetch("https://backend.impargo.eu/", {
method: "POST",
headers: {
"authorization": token,
"content-type": "application/json",
},
body: JSON.stringify([
{
"operationName": "ImportOrders",
"variables": {
"data": [
{
"stops": [
{
"location": {
"zipcode": "00165",
"city": "Rome",
"country": "it",
"streetAndHouseNumber": "Via Gregorio VII 213",
"coordinates": {
"lat": 41.8931,
"lon": 12.4539
}
}
},
{
"location": {
"city": "Villingen-Schwenningen",
"streetAndHouseNumber": "Friedrichstraße 10",
"zipcode": "78050",
"country": "de",
"coordinates": {
"lat": 48.0623,
"lon": 8.4936
}
}
}
],
"load": {},
"reference": null,
"vehicle": "63135a94a78b34015694ae13",
"driver": "63271ce05b1dc6c284de5ac8",
"customer": null
},
{
"stops": [
{
"location": {
"zipcode": "10178",
"city": "Berlin",
"country": "de",
"streetAndHouseNumber": "Alexanderplatz 1",
"coordinates": {
"lat": 52.5218,
"lon": 13.4125
}
}
},
{
"location": {
"city": "Paris",
"zipcode": "75001",
"country": "fr",
"streetAndHouseNumber": "Rue de Rivoli 34",
"coordinates": {
"lat": 48.8606,
"lon": 2.3364
}
}
}
],
"load": {},
"reference": null,
"vehicle": vehicle_id,
"driver": driver_id,
"customer": null
}
]
},
"query": `mutation ImportOrders($data: [OrderImportInput!]) {
importOrders(data: $data)
}`
}
])
})
.then(response => response.json())
.then(data => {
console.log("Output:", data);
})
.catch(error => {
console.error("Error:", error);
});


[
{
"data": {
"importOrders": [0, 1]
}
}
]