Vai al contenuto
Riferimento API

Zugänge

9 endpoint

Le descrizioni degli endpoint provengono direttamente dall'API e sono in tedesco.

Zugänge auflisten

get/v1/access_grants

Personen und Ladekarten, die gratis oder zum Sondertarif laden.

Risposta 200AccessGrantList

NomeTipoDescrizione
objectobbligatorio"list"
dataobbligatorioAccessGrant[]
has_moreobbligatorioboolean

Errori possibili

  • 400 Anfrage ungültig
  • 401 Nicht angemeldet
  • 403 Berechtigung fehlt
  • 404 Nicht gefunden
  • 409 Zustand passt nicht
  • 429 Zu viele Anfragen
Esempio
curl -X GET https://api.ladehase.com/v1/access_grants \n  -H "Authorization: Bearer lh_test_…"
Risposta 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.

Parametri

NomePosizioneTipo
idempotency-keyfacoltativoWiederholbare Anfragen ohne doppelte Wirkung (24 Stunden)Intestazionestring

Richiesta

NomeTipoDescrizione
nameobbligatoriostring
emailfacoltativostring | null
rfid_uidfacoltativostring | null
create_linkfacoltativoboolean
valid_fromfacoltativostring | null
valid_untilfacoltativostring | null
device_idsfacoltativostring[]
tariff_idfacoltativostring | null
monthly_limit_whfacoltativointeger | null
billing_integration_idfacoltativostring | null
notefacoltativostring | null

Risposta 201AccessGrant

NomeTipoDescrizione
idobbligatoriostringID mit Präfix «acc_»
objectobbligatorio"access_grant"
nameobbligatoriostring
emailobbligatoriostring | null
rfid_uidobbligatoriostring | null
link_urlobbligatoriostring | nullPersönlicher Link zum Laden ohne Zahlung
freeobbligatorioboolean
tariff_idobbligatoriostring | null
monthly_limit_whobbligatoriointeger | null
revokedobbligatorioboolean
created_atobbligatoriostring

Errori possibili

  • 400 Anfrage ungültig
  • 401 Nicht angemeldet
  • 403 Berechtigung fehlt
  • 404 Nicht gefunden
  • 409 Zustand passt nicht
  • 429 Zu viele Anfragen
Esempio
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"}'
Risposta 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.

Parametri

NomePosizioneTipo
idobbligatorioPercorsostring

Risposta 200AccessGrant

NomeTipoDescrizione
idobbligatoriostringID mit Präfix «acc_»
objectobbligatorio"access_grant"
nameobbligatoriostring
emailobbligatoriostring | null
rfid_uidobbligatoriostring | null
link_urlobbligatoriostring | nullPersönlicher Link zum Laden ohne Zahlung
freeobbligatorioboolean
tariff_idobbligatoriostring | null
monthly_limit_whobbligatoriointeger | null
revokedobbligatorioboolean
created_atobbligatoriostring

Errori possibili

  • 400 Anfrage ungültig
  • 401 Nicht angemeldet
  • 403 Berechtigung fehlt
  • 404 Nicht gefunden
  • 409 Zustand passt nicht
  • 429 Zu viele Anfragen
Esempio
curl -X GET https://api.ladehase.com/v1/access_grants/{id} \n  -H "Authorization: Bearer lh_test_…"
Risposta 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`.

Parametri

NomePosizioneTipo
idobbligatorioPercorsostring

Richiesta

NomeTipoDescrizione
namefacoltativostring
emailfacoltativostring | null
rfid_uidfacoltativostring | null
create_linkfacoltativoboolean
valid_fromfacoltativostring | null
valid_untilfacoltativostring | null
device_idsfacoltativostring[]
tariff_idfacoltativostring | null
monthly_limit_whfacoltativointeger | null
billing_integration_idfacoltativostring | null
notefacoltativostring | null
revokedfacoltativoboolean
regenerate_linkfacoltativoboolean

Risposta 200AccessGrant

NomeTipoDescrizione
idobbligatoriostringID mit Präfix «acc_»
objectobbligatorio"access_grant"
nameobbligatoriostring
emailobbligatoriostring | null
rfid_uidobbligatoriostring | null
link_urlobbligatoriostring | nullPersönlicher Link zum Laden ohne Zahlung
freeobbligatorioboolean
tariff_idobbligatoriostring | null
monthly_limit_whobbligatoriointeger | null
revokedobbligatorioboolean
created_atobbligatoriostring

Errori possibili

  • 400 Anfrage ungültig
  • 401 Nicht angemeldet
  • 403 Berechtigung fehlt
  • 404 Nicht gefunden
  • 409 Zustand passt nicht
  • 429 Zu viele Anfragen
Esempio
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}'
Risposta 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.

Parametri

NomePosizioneTipo
idobbligatorioPercorsostring

Risposta 200Deleted

NomeTipoDescrizione
idobbligatoriostring
objectobbligatoriostring
deletedobbligatoriotrue

Errori possibili

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

Monatsabrechnungen

get/v1/billing_statements

Abrechnungen für Zugänge mit Sondertarif.

Parametri

NomePosizioneTipo
periodfacoltativoQuerystring

Risposta 200Object

Errori possibili

  • 400 Anfrage ungültig
  • 401 Nicht angemeldet
  • 403 Berechtigung fehlt
  • 404 Nicht gefunden
  • 409 Zustand passt nicht
  • 429 Zu viele Anfragen
Esempio
curl -X GET https://api.ladehase.com/v1/billing_statements \n  -H "Authorization: Bearer lh_test_…"
Risposta 200
{}

Abrechnungen erstellen

post/v1/billing_statements/generate

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

Parametri

NomePosizioneTipo
idempotency-keyfacoltativoWiederholbare Anfragen ohne doppelte Wirkung (24 Stunden)Intestazionestring

Richiesta

NomeTipoDescrizione
periodobbligatoriostring

Risposta 200Object

Errori possibili

  • 400 Anfrage ungültig
  • 401 Nicht angemeldet
  • 403 Berechtigung fehlt
  • 404 Nicht gefunden
  • 409 Zustand passt nicht
  • 429 Zu viele Anfragen
Esempio
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"}'
Risposta 200
{}

Abrechnung senden

post/v1/billing_statements/{id}/send

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

Parametri

NomePosizioneTipo
idobbligatorioPercorsostring
idempotency-keyfacoltativoWiederholbare Anfragen ohne doppelte Wirkung (24 Stunden)Intestazionestring

Risposta 200Object

Errori possibili

  • 400 Anfrage ungültig
  • 401 Nicht angemeldet
  • 403 Berechtigung fehlt
  • 404 Nicht gefunden
  • 409 Zustand passt nicht
  • 429 Zu viele Anfragen
Esempio
curl -X POST https://api.ladehase.com/v1/billing_statements/{id}/send \n  -H "Authorization: Bearer lh_test_…"
Risposta 200
{}

Als bezahlt markieren

post/v1/billing_statements/{id}/paid

Zum Beispiel bei Barzahlung.

Parametri

NomePosizioneTipo
idobbligatorioPercorsostring
idempotency-keyfacoltativoWiederholbare Anfragen ohne doppelte Wirkung (24 Stunden)Intestazionestring

Risposta 200Object

Errori possibili

  • 400 Anfrage ungültig
  • 401 Nicht angemeldet
  • 403 Berechtigung fehlt
  • 404 Nicht gefunden
  • 409 Zustand passt nicht
  • 429 Zu viele Anfragen
Esempio
curl -X POST https://api.ladehase.com/v1/billing_statements/{id}/paid \n  -H "Authorization: Bearer lh_test_…"
Risposta 200
{}