Aller au contenu
Référence API

Zugänge

9 endpoints

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

Zugänge auflisten

get/v1/access_grants

Personen und Ladekarten, die gratis oder zum Sondertarif laden.

Réponse 200AccessGrantList

NomTypeDescription
objectobligatoire"list"
dataobligatoireAccessGrant[]
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/access_grants \n  -H "Authorization: Bearer lh_test_…"
Réponse 200
{
  "object": "list",
  "data": [
    {
      "id": "acc_0e9d8c7b6a5f4e3d",
      "object": "access_grant",
      "name": "string",
      "email": "string",
      "rfid_uid": "string",
      "link_url": "string",
      "free": true,
      "tariff_id": "string",
      "monthly_limit_wh": 0,
      "revoked": true,
      "created_at": "string"
    }
  ],
  "has_more": true
}

Zugang anlegen

post/v1/access_grants

Ohne `tariff_id` gratis, mit `tariff_id` Sondertarif und Monatsabrechnung. Erzeugt einen persönlichen Link.

Paramètres

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

Requête

NomTypeDescription
nameobligatoirestring
emailfacultatifstring | null
rfid_uidfacultatifstring | null
create_linkfacultatifboolean
valid_fromfacultatifstring | null
valid_untilfacultatifstring | null
device_idsfacultatifstring[]
tariff_idfacultatifstring | null
monthly_limit_whfacultatifinteger | null
billing_integration_idfacultatifstring | null
notefacultatifstring | null

Réponse 201AccessGrant

NomTypeDescription
idobligatoirestringID mit Präfix «acc_»
objectobligatoire"access_grant"
nameobligatoirestring
emailobligatoirestring | null
rfid_uidobligatoirestring | null
link_urlobligatoirestring | nullPersönlicher Link zum Laden ohne Zahlung
freeobligatoireboolean
tariff_idobligatoirestring | null
monthly_limit_whobligatoireinteger | null
revokedobligatoireboolean
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/access_grants \n  -H "Authorization: Bearer lh_test_…" \n  -H "Content-Type: application/json" \n  -d '{"name":"string","email":"person@example.ch","rfid_uid":"string","create_link":true,"valid_from":"2026-10-25T08:30:00.000Z","valid_until":"2026-10-25T08:30:00.000Z","device_ids":[],"tariff_id":"string","monthly_limit_wh":0,"billing_integration_id":"string","note":"string"}'
Réponse 201
{
  "id": "acc_0e9d8c7b6a5f4e3d",
  "object": "access_grant",
  "name": "string",
  "email": "string",
  "rfid_uid": "string",
  "link_url": "string",
  "free": true,
  "tariff_id": "string",
  "monthly_limit_wh": 0,
  "revoked": true,
  "created_at": "string"
}

Zugang abrufen

get/v1/access_grants/{id}

Ein Zugang.

Paramètres

NomEmplacementType
idobligatoireCheminstring

Réponse 200AccessGrant

NomTypeDescription
idobligatoirestringID mit Präfix «acc_»
objectobligatoire"access_grant"
nameobligatoirestring
emailobligatoirestring | null
rfid_uidobligatoirestring | null
link_urlobligatoirestring | nullPersönlicher Link zum Laden ohne Zahlung
freeobligatoireboolean
tariff_idobligatoirestring | null
monthly_limit_whobligatoireinteger | null
revokedobligatoireboolean
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/access_grants/{id} \n  -H "Authorization: Bearer lh_test_…"
Réponse 200
{
  "id": "acc_0e9d8c7b6a5f4e3d",
  "object": "access_grant",
  "name": "string",
  "email": "string",
  "rfid_uid": "string",
  "link_url": "string",
  "free": true,
  "tariff_id": "string",
  "monthly_limit_wh": 0,
  "revoked": true,
  "created_at": "string"
}

Zugang ändern

patch/v1/access_grants/{id}

Auch `revoked` und `regenerate_link`.

Paramètres

NomEmplacementType
idobligatoireCheminstring

Requête

NomTypeDescription
namefacultatifstring
emailfacultatifstring | null
rfid_uidfacultatifstring | null
create_linkfacultatifboolean
valid_fromfacultatifstring | null
valid_untilfacultatifstring | null
device_idsfacultatifstring[]
tariff_idfacultatifstring | null
monthly_limit_whfacultatifinteger | null
billing_integration_idfacultatifstring | null
notefacultatifstring | null
revokedfacultatifboolean
regenerate_linkfacultatifboolean

Réponse 200AccessGrant

NomTypeDescription
idobligatoirestringID mit Präfix «acc_»
objectobligatoire"access_grant"
nameobligatoirestring
emailobligatoirestring | null
rfid_uidobligatoirestring | null
link_urlobligatoirestring | nullPersönlicher Link zum Laden ohne Zahlung
freeobligatoireboolean
tariff_idobligatoirestring | null
monthly_limit_whobligatoireinteger | null
revokedobligatoireboolean
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/access_grants/{id} \n  -H "Authorization: Bearer lh_test_…" \n  -H "Content-Type: application/json" \n  -d '{"name":"string","email":"person@example.ch","rfid_uid":"string","create_link":true,"valid_from":"2026-10-25T08:30:00.000Z","valid_until":"2026-10-25T08:30:00.000Z","device_ids":[],"tariff_id":"string","monthly_limit_wh":0,"billing_integration_id":"string","note":"string","revoked":true,"regenerate_link":true}'
Réponse 200
{
  "id": "acc_0e9d8c7b6a5f4e3d",
  "object": "access_grant",
  "name": "string",
  "email": "string",
  "rfid_uid": "string",
  "link_url": "string",
  "free": true,
  "tariff_id": "string",
  "monthly_limit_wh": 0,
  "revoked": true,
  "created_at": "string"
}

Zugang widerrufen

delete/v1/access_grants/{id}

Link und Berechtigung werden ungültig.

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/access_grants/{id} \n  -H "Authorization: Bearer lh_test_…"
Réponse 200
{
  "id": "string",
  "object": "string",
  "deleted": true
}

Monatsabrechnungen

get/v1/billing_statements

Abrechnungen für Zugänge mit Sondertarif.

Paramètres

NomEmplacementType
periodfacultatifRequêtestring

Réponse 200Object

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/billing_statements \n  -H "Authorization: Bearer lh_test_…"
Réponse 200
{}

Abrechnungen erstellen

post/v1/billing_statements/generate

Für einen Monat (`period` = JJJJ-MM).

Paramètres

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

Requête

NomTypeDescription
periodobligatoirestring

Réponse 200Object

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/billing_statements/generate \n  -H "Authorization: Bearer lh_test_…" \n  -H "Content-Type: application/json" \n  -d '{"period":"string"}'
Réponse 200
{}

Abrechnung senden

post/v1/billing_statements/{id}/send

E-Mail mit Zahlungslink über zahls.ch oder Freika.

Paramètres

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

Réponse 200Object

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/billing_statements/{id}/send \n  -H "Authorization: Bearer lh_test_…"
Réponse 200
{}

Als bezahlt markieren

post/v1/billing_statements/{id}/paid

Zum Beispiel bei Barzahlung.

Paramètres

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

Réponse 200Object

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/billing_statements/{id}/paid \n  -H "Authorization: Bearer lh_test_…"
Réponse 200
{}