Aller au contenu
Référence API

Standorte

5 endpoints

Les descriptions des endpoints proviennent directement de l'API et sont en allemand.

Standorte auflisten

get/v1/locations

Alle Standorte der Organisation.

Réponse 200LocationList

NomTypeDescription
objectobligatoire"list"
dataobligatoireLocation[]
has_moreobligatoireboolean

Erreurs possibles

  • 400 Anfrage ungültig
  • 401 Nicht angemeldet
  • 403 Berechtigung fehlt
  • 404 Nicht gefunden
  • 409 Zustand passt nicht
  • 429 Zu viele Anfragen
Exemple
curl -X GET https://api.ladehase.com/v1/locations \n  -H "Authorization: Bearer lh_test_…"
Réponse 200
{
  "object": "list",
  "data": [
    {
      "id": "loc_2b8e1c0d9f7a6b5c",
      "object": "location",
      "name": "Hofladen",
      "street": "string",
      "postal_code": "string",
      "city": "string",
      "country": "string",
      "latitude": 0,
      "longitude": 0,
      "time_zone": "string",
      "opening_hours": "string",
      "payment_integration_id": "string",
      "is_public": true,
      "created_at": "string"
    }
  ],
  "has_more": true
}

Standort anlegen

post/v1/locations

Neuer Standort mit Adresse und Zahlungskonto für QR-Zahlungen.

Paramètres

NomEmplacementType
idempotency-keyfacultatifWiederholbare Anfragen ohne doppelte Wirkung (24 Stunden)En-têtestring

Requête

NomTypeDescription
nameobligatoirestring
streetfacultatifstring | null
postal_codefacultatifstring | null
cityfacultatifstring | null
countryfacultatifstring
latitudefacultatifnumber | null
longitudefacultatifnumber | null
time_zonefacultatifstring
opening_hoursfacultatifstring | null
payment_integration_idfacultatifstring | null
is_publicfacultatifboolean

Réponse 201Location

NomTypeDescription
idobligatoirestringID mit Präfix «loc_»
objectobligatoire"location"
nameobligatoirestring
streetobligatoirestring | null
postal_codeobligatoirestring | null
cityobligatoirestring | null
countryobligatoirestring
latitudeobligatoirenumber | null
longitudeobligatoirenumber | null
time_zoneobligatoirestring
opening_hoursobligatoirestring | null
payment_integration_idobligatoirestring | nullZahlungskonto für QR-Zahlungen an diesem Standort
is_publicobligatoireboolean
created_atobligatoirestring

Erreurs possibles

  • 400 Anfrage ungültig
  • 401 Nicht angemeldet
  • 403 Berechtigung fehlt
  • 404 Nicht gefunden
  • 409 Zustand passt nicht
  • 429 Zu viele Anfragen
Exemple
curl -X POST https://api.ladehase.com/v1/locations \n  -H "Authorization: Bearer lh_test_…" \n  -H "Content-Type: application/json" \n  -d '{"name":"string","street":"string","postal_code":"string","city":"string","country":"CH","latitude":-90,"longitude":-180,"time_zone":"Europe/Zurich","opening_hours":"string","payment_integration_id":"string","is_public":true}'
Réponse 201
{
  "id": "loc_2b8e1c0d9f7a6b5c",
  "object": "location",
  "name": "Hofladen",
  "street": "string",
  "postal_code": "string",
  "city": "string",
  "country": "string",
  "latitude": 0,
  "longitude": 0,
  "time_zone": "string",
  "opening_hours": "string",
  "payment_integration_id": "string",
  "is_public": true,
  "created_at": "string"
}

Standort abrufen

get/v1/locations/{id}

Ein Standort.

Paramètres

NomEmplacementType
idobligatoireCheminstring

Réponse 200Location

NomTypeDescription
idobligatoirestringID mit Präfix «loc_»
objectobligatoire"location"
nameobligatoirestring
streetobligatoirestring | null
postal_codeobligatoirestring | null
cityobligatoirestring | null
countryobligatoirestring
latitudeobligatoirenumber | null
longitudeobligatoirenumber | null
time_zoneobligatoirestring
opening_hoursobligatoirestring | null
payment_integration_idobligatoirestring | nullZahlungskonto für QR-Zahlungen an diesem Standort
is_publicobligatoireboolean
created_atobligatoirestring

Erreurs possibles

  • 400 Anfrage ungültig
  • 401 Nicht angemeldet
  • 403 Berechtigung fehlt
  • 404 Nicht gefunden
  • 409 Zustand passt nicht
  • 429 Zu viele Anfragen
Exemple
curl -X GET https://api.ladehase.com/v1/locations/{id} \n  -H "Authorization: Bearer lh_test_…"
Réponse 200
{
  "id": "loc_2b8e1c0d9f7a6b5c",
  "object": "location",
  "name": "Hofladen",
  "street": "string",
  "postal_code": "string",
  "city": "string",
  "country": "string",
  "latitude": 0,
  "longitude": 0,
  "time_zone": "string",
  "opening_hours": "string",
  "payment_integration_id": "string",
  "is_public": true,
  "created_at": "string"
}

Standort ändern

patch/v1/locations/{id}

Ändert Name, Adresse, Öffnungszeiten oder das Zahlungskonto.

Paramètres

NomEmplacementType
idobligatoireCheminstring

Requête

NomTypeDescription
namefacultatifstring
streetfacultatifstring | null
postal_codefacultatifstring | null
cityfacultatifstring | null
countryfacultatifstring
latitudefacultatifnumber | null
longitudefacultatifnumber | null
time_zonefacultatifstring
opening_hoursfacultatifstring | null
payment_integration_idfacultatifstring | null
is_publicfacultatifboolean

Réponse 200Location

NomTypeDescription
idobligatoirestringID mit Präfix «loc_»
objectobligatoire"location"
nameobligatoirestring
streetobligatoirestring | null
postal_codeobligatoirestring | null
cityobligatoirestring | null
countryobligatoirestring
latitudeobligatoirenumber | null
longitudeobligatoirenumber | null
time_zoneobligatoirestring
opening_hoursobligatoirestring | null
payment_integration_idobligatoirestring | nullZahlungskonto für QR-Zahlungen an diesem Standort
is_publicobligatoireboolean
created_atobligatoirestring

Erreurs possibles

  • 400 Anfrage ungültig
  • 401 Nicht angemeldet
  • 403 Berechtigung fehlt
  • 404 Nicht gefunden
  • 409 Zustand passt nicht
  • 429 Zu viele Anfragen
Exemple
curl -X PATCH https://api.ladehase.com/v1/locations/{id} \n  -H "Authorization: Bearer lh_test_…" \n  -H "Content-Type: application/json" \n  -d '{"name":"string","street":"string","postal_code":"string","city":"string","country":"CH","latitude":-90,"longitude":-180,"time_zone":"Europe/Zurich","opening_hours":"string","payment_integration_id":"string","is_public":true}'
Réponse 200
{
  "id": "loc_2b8e1c0d9f7a6b5c",
  "object": "location",
  "name": "Hofladen",
  "street": "string",
  "postal_code": "string",
  "city": "string",
  "country": "string",
  "latitude": 0,
  "longitude": 0,
  "time_zone": "string",
  "opening_hours": "string",
  "payment_integration_id": "string",
  "is_public": true,
  "created_at": "string"
}

Standort löschen

delete/v1/locations/{id}

Nur Standorte ohne Geräte.

Paramètres

NomEmplacementType
idobligatoireCheminstring

Réponse 200Deleted

NomTypeDescription
idobligatoirestring
objectobligatoirestring
deletedobligatoiretrue

Erreurs possibles

  • 400 Anfrage ungültig
  • 401 Nicht angemeldet
  • 403 Berechtigung fehlt
  • 404 Nicht gefunden
  • 409 Zustand passt nicht
  • 429 Zu viele Anfragen
Exemple
curl -X DELETE https://api.ladehase.com/v1/locations/{id} \n  -H "Authorization: Bearer lh_test_…"
Réponse 200
{
  "id": "string",
  "object": "string",
  "deleted": true
}