Darstellung
Depots
Depots des Mandanten.
| Endpunkt | Anfrage |
|---|---|
| Depots auflisten | GET /v1/depots |
| Depot anlegen | POST /v1/depots |
| Depot ändern | PATCH /v1/depots/{id} |
| Depot löschen | DELETE /v1/depots/{id} |
Depots auflisten GET
http
GET /v1/depotsAnmeldung: API-Schlüssel oder Sitzung eines Admins (mehr)
Beispiel
bash
curl -sS --fail-with-body "https://api.tourblick.de/v1/depots" \
-H "Authorization: Bearer $TOURBLICK_API_KEY"js
const res = await fetch('https://api.tourblick.de/v1/depots', {
headers: {
Authorization: `Bearer ${process.env.TOURBLICK_API_KEY}`,
},
});
if (!res.ok) throw new Error(`HTTP ${res.status}: ${await res.text()}`);
const depotList = await res.json();
console.log(depotList);Antwort
200 Erfolgreich · Schema DepotList
json
{
"data": [
{
"id": "9d403f51-6e70-4182-9d2e-3f4a5b6c7d8e",
"tenant_id": "6a1f0c2e-3b4d-4e5f-8a9b-0c1d2e3f4a5b",
"name": "Lager Mitte",
"address_line": "Friedrichstraße 123",
"postal_code": "10117",
"city": "Berlin",
"country": "DE",
"lat": 52.520008,
"lng": 13.404954,
"is_default": true,
"created_at": "2026-11-01T10:00:00.000Z",
"updated_at": "2026-11-01T10:00:00.000Z"
}
]
}Fehler
| Status | Code | Bedeutung |
|---|---|---|
| 401 | unauthorized | Nicht angemeldet |
| 403 | forbidden | Keine Berechtigung |
| 429 | rate_limited | Zu viele Anfragen |
| sonst | internal | Fehler (Format siehe Error) |
Format und Codes: Fehler.
Depot anlegen POST
http
POST /v1/depotsAnmeldung: API-Schlüssel oder Sitzung eines Admins (mehr)
Anfrage
Body als JSON (Content-Type: application/json).
| Feld | Typ | Pflicht | Beschreibung |
|---|---|---|---|
name | string | ja | Länge 1–120 Zeichen. |
address_line | string | ja | Straße und Hausnummer. Länge 1–300 Zeichen. |
postal_code | string | ja | Länge 1–20 Zeichen. |
city | string | ja | Länge 1–120 Zeichen. |
country | string | ja | Ländercode ISO 3166-1 alpha-2. Muster ^[A-Z]{2}$. |
lat | number | – | Ohne Angabe wird die Adresse geokodiert. Bereich -90–90. |
lng | number | – | Bereich -180–180. |
is_default | boolean | – |
Beispiel
bash
curl -sS --fail-with-body -X POST "https://api.tourblick.de/v1/depots" \
-H "Authorization: Bearer $TOURBLICK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Lager Deutz",
"address_line": "Deutz-Mülheimer Straße 111",
"postal_code": "51063",
"city": "Köln",
"country": "DE",
"is_default": false
}'js
const res = await fetch('https://api.tourblick.de/v1/depots', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.TOURBLICK_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Lager Deutz',
address_line: 'Deutz-Mülheimer Straße 111',
postal_code: '51063',
city: 'Köln',
country: 'DE',
is_default: false,
}),
});
if (!res.ok) throw new Error(`HTTP ${res.status}: ${await res.text()}`);
const depot = await res.json();
console.log(depot);Antwort
201 Angelegt · Schema Depot
json
{
"id": "9d403f51-6e70-4182-9d2e-3f4a5b6c7d8e",
"tenant_id": "6a1f0c2e-3b4d-4e5f-8a9b-0c1d2e3f4a5b",
"name": "Lager Mitte",
"address_line": "Friedrichstraße 123",
"postal_code": "10117",
"city": "Berlin",
"country": "DE",
"lat": 52.520008,
"lng": 13.404954,
"is_default": true,
"created_at": "2026-11-01T10:00:00.000Z",
"updated_at": "2026-11-01T10:00:00.000Z"
}Fehler
| Status | Code | Bedeutung |
|---|---|---|
| 401 | unauthorized | Nicht angemeldet |
| 403 | forbidden | Keine Berechtigung |
| 422 | validation_failed | Eingabe ungültig |
| 429 | rate_limited | Zu viele Anfragen |
| sonst | internal | Fehler (Format siehe Error) |
Format und Codes: Fehler.
Depot ändern PATCH
http
PATCH /v1/depots/{id}Anmeldung: API-Schlüssel oder Sitzung eines Admins (mehr)
Parameter
| Name | Ort | Typ | Pflicht | Beschreibung |
|---|---|---|---|---|
id | Pfad | string (uuid) | ja | ID der Ressource. Im Beispiel $DEPOT_ID. |
Anfrage
Body als JSON (Content-Type: application/json). Der Body ist optional.
| Feld | Typ | Pflicht | Beschreibung |
|---|---|---|---|
name | string | – | Länge 1–120 Zeichen. |
address_line | string | – | Straße und Hausnummer. Länge 1–300 Zeichen. |
postal_code | string | – | Länge 1–20 Zeichen. |
city | string | – | Länge 1–120 Zeichen. |
country | string | – | Ländercode ISO 3166-1 alpha-2. Muster ^[A-Z]{2}$. |
lat | number | – | Ohne Angabe wird die Adresse geokodiert. Bereich -90–90. |
lng | number | – | Bereich -180–180. |
is_default | boolean | – |
Beispiel
Vorher setzen: DEPOT_ID (Shell-Variable bzw. Umgebungsvariable, siehe Platzhalter).
bash
curl -sS --fail-with-body -X PATCH "https://api.tourblick.de/v1/depots/$DEPOT_ID" \
-H "Authorization: Bearer $TOURBLICK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Lager Deutz (Halle 2)"
}'js
const depotId = process.env.DEPOT_ID;
const res = await fetch(`https://api.tourblick.de/v1/depots/${depotId}`, {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.TOURBLICK_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Lager Deutz (Halle 2)',
}),
});
if (!res.ok) throw new Error(`HTTP ${res.status}: ${await res.text()}`);
const depot = await res.json();
console.log(depot);Antwort
200 Erfolgreich · Schema Depot
json
{
"id": "9d403f51-6e70-4182-9d2e-3f4a5b6c7d8e",
"tenant_id": "6a1f0c2e-3b4d-4e5f-8a9b-0c1d2e3f4a5b",
"name": "Lager Mitte",
"address_line": "Friedrichstraße 123",
"postal_code": "10117",
"city": "Berlin",
"country": "DE",
"lat": 52.520008,
"lng": 13.404954,
"is_default": true,
"created_at": "2026-11-01T10:00:00.000Z",
"updated_at": "2026-11-01T10:00:00.000Z"
}Fehler
| Status | Code | Bedeutung |
|---|---|---|
| 401 | unauthorized | Nicht angemeldet |
| 403 | forbidden | Keine Berechtigung |
| 404 | not_found | Nicht gefunden |
| 422 | validation_failed | Eingabe ungültig |
| 429 | rate_limited | Zu viele Anfragen |
| sonst | internal | Fehler (Format siehe Error) |
Format und Codes: Fehler.
Depot löschen DELETE
http
DELETE /v1/depots/{id}Anmeldung: API-Schlüssel oder Sitzung eines Admins (mehr)
Parameter
| Name | Ort | Typ | Pflicht | Beschreibung |
|---|---|---|---|---|
id | Pfad | string (uuid) | ja | ID der Ressource. Im Beispiel $DEPOT_ID. |
Beispiel
Vorher setzen: DEPOT_ID (Shell-Variable bzw. Umgebungsvariable, siehe Platzhalter).
bash
curl -sS --fail-with-body -X DELETE "https://api.tourblick.de/v1/depots/$DEPOT_ID" \
-H "Authorization: Bearer $TOURBLICK_API_KEY"js
const depotId = process.env.DEPOT_ID;
const res = await fetch(`https://api.tourblick.de/v1/depots/${depotId}`, {
method: 'DELETE',
headers: {
Authorization: `Bearer ${process.env.TOURBLICK_API_KEY}`,
},
});
if (!res.ok) throw new Error(`HTTP ${res.status}: ${await res.text()}`);
console.log(res.status); // 204Antwort
204 Erfolgreich, kein Inhalt
Fehler
| Status | Code | Bedeutung |
|---|---|---|
| 401 | unauthorized | Nicht angemeldet |
| 403 | forbidden | Keine Berechtigung |
| 404 | not_found | Nicht gefunden |
| 422 | validation_failed | Eingabe ungültig |
| 429 | rate_limited | Zu viele Anfragen |
| sonst | internal | Fehler (Format siehe Error) |
Format und Codes: Fehler.