Importing depots using API is particularly useful when defining a large number of depots. This is made possible by defining a POST
request and using the endpoint depots/createMany
[[POST /depots/createMany](<http://localhost:8000/depots>)]
Sample request payload
{
"items": [
{
"externalId": "TestDepot 1",
"reference": "REF-1",
"address": "40 Clarendon Rd, Watford WD17 1HZ",
"postCode": "WD17 1HZ",
"city": "London",
"country": "United Kingdom",
"coordinates": [
-0.095146,
51.5156469
],
"contactName": "John",
"contactPhone": "71234567",
"contactEmail": "John@gmail.com",
"instructions": "Default depot"
},
{
"externalId": "TestDepot 2",
"reference": "REF-2",
"address": "34 Upper Brook St, London W1K 7QS",
"postCode": "W1K 7QS",
"city": "London",
"country": "United Kingdom",
"coordinates": [
-0.1562390173828058,
51.51113139236668
],
"contactName": "Doe",
"contactPhone": "789101112",
"contactEmail": "doe@gmail.com",
"instructions": "Backup depot"
}
]
}
Sample response
{
"result": 2,
"errors": [],
"ids": [
"656d4a97b856250158aae87b",
"656d4a97b856250158aae87c"
]
}