How to import addresses
The importAddresses
mutation allows users to import multiple addresses into the system in a single request. It accepts an array of address objects, each containing details such as category, company name, contact person, phone number, city, street, zipcode, and country. This mutation is ideal for bulk importing addresses efficiently.
- NodeJS
const fetch = require("node-fetch")
fetch("https://backend.impargo.eu/", {
method: "POST",
headers: {
"authorization": token,
"content-type": "application/json",
},
body: JSON.stringify([
{
operationName: "importAddresses",
variables: {
data: [
{
category: "PICKUP_DROP",
companyName: "Maurweg pharmacy",
email: "company@email.com",
contactPerson: "Daniel",
phoneNumber: "+301234567",
city: "Berlin",
street: "Berliner Mauerweg",
zipcode: "10117",
country: "de"
},
{
category: "PICKUP_DROP",
companyName: "Bekamp market",
email: "info@gmail.com",
contactPerson: "David Paul",
phoneNumber: "+2012345678",
city: "Warstein",
street: "Bekamp",
zipcode: "59581",
country: "de"
}
]
},
query: `mutation importAddresses($data: [AddressImportInput!]!) {
importAddresses(data: $data) {
index
error
__typename
}
}`
}
]),
});
- Response
[
{
"data":{
"importAddresses":[]
}
}
]