id in the body is ignored. name may be omitted, which keeps the distributor's name. warehouses is optional. Omitting it, or sending null, leaves the distributor's warehouses untouched, so a rename does not have to restate them. Supplying a list makes those the distributor's warehouses: a listed warehouse is created or updated, and one that already belongs to this distributor but is not listed is deleted, so an empty list deletes them all. The update is refused, naming the warehouse, if a warehouse it would delete has orders. Each listed warehouse needs an id, which may appear only once; one that already belongs to this distributor keeps its name and status when the body leaves them out, and a new one is active. To remove a single warehouse, call DELETE v1/Warehouses/{id}.curl --location --request PUT 'https://marketplacerest.perenso.net/v1/distributors/' \
--header 'Content-Type: application/json' \
--data '{
"name": "Eastern Distribution Group"
}'{
"id": "DIST-EAST",
"name": "Eastern Distribution Group",
"warehouses": [
{
"name": "Sydney DC",
"id": "WH-SYD",
"status": "ACTIVE"
},
{
"name": "Melbourne DC",
"id": "WH-MEL",
"status": "ACTIVE"
}
]
}