Creates a new store.
POST
/api/chainsThe name must not be empty. All other parameters are
optional. Returns the created store chain.
Authorizations
api_key
Type: API Key (header: X-CSRF-Token)
Request Body
JSON
{
"id": 1,
"name": "MyChain GmbH",
"status": 2,
"headquartersZip": "48149",
"headquartersCity": "Münster",
"headquartersCountry": "Germany",
"allowPress": true,
"forumThread": 12345,
"notes": "Cooperating since 2021",
"commonStoreInformation": "Pickup times between 10:00 and 12:15",
"kams": [
{
"id": 1,
"name": "Max Mustermann",
"avatar": "/api/uploads/bc476952-08be-45a7-b670-db27c966c9c2"
}
],
"estimatedStoreCount": 12,
"modificationDate": "string",
"regionId": 0
}
Responses
Success
Authorization
api_key
cURL
curl -X POST \
'http://localhost/api/chains' \
--data '{
"id": 1,
"name": "MyChain GmbH",
"status": 2,
"headquartersZip": "48149",
"headquartersCity": "Münster",
"headquartersCountry": "Germany",
"allowPress": true,
"forumThread": 12345,
"notes": "Cooperating since 2021",
"commonStoreInformation": "Pickup times between 10:00 and 12:15",
"kams": [
{
"id": 1,
"name": "Max Mustermann",
"avatar": "/api/uploads/bc476952-08be-45a7-b670-db27c966c9c2"
}
],
"estimatedStoreCount": 12,
"modificationDate": "string",
"regionId": 0
}'
Samples
cURL
curl -X POST http://localhost/api/chains
JavaScript
fetch("http://localhost/api/chains", { method: "POST" })
.then(response => response.json())
.then(data => console.log(data));
PHP
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://localhost/api/chains");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Python
import requests
response = requests.post("http://localhost/api/chains")
print(response.json())