Vai al contenuto
Riferimento API

Sitzungen

6 endpoint

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

Sitzungen auflisten

get/v1/sessions

Ladungen, neueste zuerst. Filter: state (kommagetrennt), device_id, location_id, access_grant_id, from, to.

Parametri

NomePosizioneTipo
limitfacoltativoQueryinteger
starting_afterfacoltativoQuerystring
statefacoltativoQuerystring
device_idfacoltativoQuerystring
location_idfacoltativoQuerystring
access_grant_idfacoltativoQuerystring
fromfacoltativoQuerystring (date-time)
tofacoltativoQuerystring (date-time)

Risposta 200SessionList

NomeTipoDescrizione
objectobbligatorio"list"
dataobbligatorioSession[]
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/sessions \n  -H "Authorization: Bearer lh_test_…"
Risposta 200
{
  "object": "list",
  "data": [
    {
      "id": "ses_1a2b3c4d5e6f7a8b9c0d",
      "object": "session",
      "livemode": true,
      "state": "string",
      "mode": "reservation",
      "channel": "qr",
      "location_id": "string",
      "device_id": "string",
      "connector_id": "string",
      "currency": "string",
      "authorized_amount": 1235,
      "amount": 1235,
      "captured_amount": 1235,
      "refunded_amount": 1235,
      "vat_amount": 1235,
      "energy_wh": 0,
      "idle_minutes": 0,
      "stop_reason": "string",
      "receipt_number": "string",
      "started_at": "2026-10-25T08:30:00.000Z",
      "ended_at": "2026-10-25T08:30:00.000Z",
      "settled_at": "2026-10-25T08:30:00.000Z",
      "created_at": "string"
    }
  ],
  "has_more": true
}

Sitzung starten

post/v1/sessions

Startet eine Ladung ohne Zahlung über die API (z. B. für eigene Apps oder Weiterverrechnung). Mit `access_grant_id` gilt der Sondertarif des Zugangs.

Parametri

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

Richiesta

NomeTipoDescrizione
device_idobbligatoriostring
access_grant_idfacoltativostring
metadatafacoltativoobject

Risposta 201Session

NomeTipoDescrizione
idobbligatoriostringID mit Präfix «ses_»
objectobbligatorio"session"
livemodeobbligatorioboolean
stateobbligatoriostringZustand gemäss Zustandsautomat (created … settled)
modeobbligatorio"reservation" | "prepaid" | "access"
channelobbligatorio"qr" | "terminal" | "api" | "rfid" | "access_link"
location_idobbligatoriostring
device_idobbligatoriostring
connector_idobbligatoriostring
currencyobbligatoriostring
authorized_amountobbligatoriointegerReservierter beziehungsweise bezahlter Betrag in Rappen
amountobbligatoriointegerHochgerechneter Betrag (laufend) oder Endbetrag in Rappen
captured_amountobbligatoriointegerBelasteter Betrag in Rappen
refunded_amountobbligatoriointegerZurückerstatteter Betrag in Rappen
vat_amountobbligatoriointegerMWST-Anteil in Rappen
energy_whobbligatoriointegerGeladene Energie in Wh
idle_minutesobbligatoriointeger
stop_reasonobbligatoriostring | null
receipt_numberobbligatoriostring | null
started_atobbligatoriostring | nullZeitpunkt (ISO 8601, UTC)
ended_atobbligatoriostring | nullZeitpunkt (ISO 8601, UTC)
settled_atobbligatoriostring | nullZeitpunkt (ISO 8601, UTC)
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/sessions \n  -H "Authorization: Bearer lh_test_…" \n  -H "Content-Type: application/json" \n  -d '{"device_id":"string","access_grant_id":"string","metadata":{}}'
Risposta 201
{
  "id": "ses_1a2b3c4d5e6f7a8b9c0d",
  "object": "session",
  "livemode": true,
  "state": "string",
  "mode": "reservation",
  "channel": "qr",
  "location_id": "string",
  "device_id": "string",
  "connector_id": "string",
  "currency": "string",
  "authorized_amount": 1235,
  "amount": 1235,
  "captured_amount": 1235,
  "refunded_amount": 1235,
  "vat_amount": 1235,
  "energy_wh": 0,
  "idle_minutes": 0,
  "stop_reason": "string",
  "receipt_number": "string",
  "started_at": "2026-10-25T08:30:00.000Z",
  "ended_at": "2026-10-25T08:30:00.000Z",
  "settled_at": "2026-10-25T08:30:00.000Z",
  "created_at": "string"
}

Sitzung abrufen

get/v1/sessions/{id}

Eine Ladung mit Beträgen, Energie und Preisaufstellung.

Parametri

NomePosizioneTipo
idobbligatorioPercorsostring

Risposta 200Session

NomeTipoDescrizione
idobbligatoriostringID mit Präfix «ses_»
objectobbligatorio"session"
livemodeobbligatorioboolean
stateobbligatoriostringZustand gemäss Zustandsautomat (created … settled)
modeobbligatorio"reservation" | "prepaid" | "access"
channelobbligatorio"qr" | "terminal" | "api" | "rfid" | "access_link"
location_idobbligatoriostring
device_idobbligatoriostring
connector_idobbligatoriostring
currencyobbligatoriostring
authorized_amountobbligatoriointegerReservierter beziehungsweise bezahlter Betrag in Rappen
amountobbligatoriointegerHochgerechneter Betrag (laufend) oder Endbetrag in Rappen
captured_amountobbligatoriointegerBelasteter Betrag in Rappen
refunded_amountobbligatoriointegerZurückerstatteter Betrag in Rappen
vat_amountobbligatoriointegerMWST-Anteil in Rappen
energy_whobbligatoriointegerGeladene Energie in Wh
idle_minutesobbligatoriointeger
stop_reasonobbligatoriostring | null
receipt_numberobbligatoriostring | null
started_atobbligatoriostring | nullZeitpunkt (ISO 8601, UTC)
ended_atobbligatoriostring | nullZeitpunkt (ISO 8601, UTC)
settled_atobbligatoriostring | nullZeitpunkt (ISO 8601, UTC)
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/sessions/{id} \n  -H "Authorization: Bearer lh_test_…"
Risposta 200
{
  "id": "ses_1a2b3c4d5e6f7a8b9c0d",
  "object": "session",
  "livemode": true,
  "state": "string",
  "mode": "reservation",
  "channel": "qr",
  "location_id": "string",
  "device_id": "string",
  "connector_id": "string",
  "currency": "string",
  "authorized_amount": 1235,
  "amount": 1235,
  "captured_amount": 1235,
  "refunded_amount": 1235,
  "vat_amount": 1235,
  "energy_wh": 0,
  "idle_minutes": 0,
  "stop_reason": "string",
  "receipt_number": "string",
  "started_at": "2026-10-25T08:30:00.000Z",
  "ended_at": "2026-10-25T08:30:00.000Z",
  "settled_at": "2026-10-25T08:30:00.000Z",
  "created_at": "string"
}

Sitzung stoppen

post/v1/sessions/{id}/stop

Stoppt die Ladung. Abgerechnet wird automatisch.

Parametri

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

Risposta 200Session

NomeTipoDescrizione
idobbligatoriostringID mit Präfix «ses_»
objectobbligatorio"session"
livemodeobbligatorioboolean
stateobbligatoriostringZustand gemäss Zustandsautomat (created … settled)
modeobbligatorio"reservation" | "prepaid" | "access"
channelobbligatorio"qr" | "terminal" | "api" | "rfid" | "access_link"
location_idobbligatoriostring
device_idobbligatoriostring
connector_idobbligatoriostring
currencyobbligatoriostring
authorized_amountobbligatoriointegerReservierter beziehungsweise bezahlter Betrag in Rappen
amountobbligatoriointegerHochgerechneter Betrag (laufend) oder Endbetrag in Rappen
captured_amountobbligatoriointegerBelasteter Betrag in Rappen
refunded_amountobbligatoriointegerZurückerstatteter Betrag in Rappen
vat_amountobbligatoriointegerMWST-Anteil in Rappen
energy_whobbligatoriointegerGeladene Energie in Wh
idle_minutesobbligatoriointeger
stop_reasonobbligatoriostring | null
receipt_numberobbligatoriostring | null
started_atobbligatoriostring | nullZeitpunkt (ISO 8601, UTC)
ended_atobbligatoriostring | nullZeitpunkt (ISO 8601, UTC)
settled_atobbligatoriostring | nullZeitpunkt (ISO 8601, UTC)
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/sessions/{id}/stop \n  -H "Authorization: Bearer lh_test_…"
Risposta 200
{
  "id": "ses_1a2b3c4d5e6f7a8b9c0d",
  "object": "session",
  "livemode": true,
  "state": "string",
  "mode": "reservation",
  "channel": "qr",
  "location_id": "string",
  "device_id": "string",
  "connector_id": "string",
  "currency": "string",
  "authorized_amount": 1235,
  "amount": 1235,
  "captured_amount": 1235,
  "refunded_amount": 1235,
  "vat_amount": 1235,
  "energy_wh": 0,
  "idle_minutes": 0,
  "stop_reason": "string",
  "receipt_number": "string",
  "started_at": "2026-10-25T08:30:00.000Z",
  "ended_at": "2026-10-25T08:30:00.000Z",
  "settled_at": "2026-10-25T08:30:00.000Z",
  "created_at": "string"
}

Zeitleiste einer Sitzung

get/v1/sessions/{id}/events

Alle Zustandswechsel und Messwerte (Ladekurve).

Parametri

NomePosizioneTipo
idobbligatorioPercorsostring

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/sessions/{id}/events \n  -H "Authorization: Bearer lh_test_…"
Risposta 200
{}

Rückerstatten

post/v1/sessions/{id}/refund

Voll oder teilweise (`amount` in Rappen).

Parametri

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

Richiesta

NomeTipoDescrizione
amountfacoltativointeger
reasonfacoltativostring

Risposta 200Session

NomeTipoDescrizione
idobbligatoriostringID mit Präfix «ses_»
objectobbligatorio"session"
livemodeobbligatorioboolean
stateobbligatoriostringZustand gemäss Zustandsautomat (created … settled)
modeobbligatorio"reservation" | "prepaid" | "access"
channelobbligatorio"qr" | "terminal" | "api" | "rfid" | "access_link"
location_idobbligatoriostring
device_idobbligatoriostring
connector_idobbligatoriostring
currencyobbligatoriostring
authorized_amountobbligatoriointegerReservierter beziehungsweise bezahlter Betrag in Rappen
amountobbligatoriointegerHochgerechneter Betrag (laufend) oder Endbetrag in Rappen
captured_amountobbligatoriointegerBelasteter Betrag in Rappen
refunded_amountobbligatoriointegerZurückerstatteter Betrag in Rappen
vat_amountobbligatoriointegerMWST-Anteil in Rappen
energy_whobbligatoriointegerGeladene Energie in Wh
idle_minutesobbligatoriointeger
stop_reasonobbligatoriostring | null
receipt_numberobbligatoriostring | null
started_atobbligatoriostring | nullZeitpunkt (ISO 8601, UTC)
ended_atobbligatoriostring | nullZeitpunkt (ISO 8601, UTC)
settled_atobbligatoriostring | nullZeitpunkt (ISO 8601, UTC)
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/sessions/{id}/refund \n  -H "Authorization: Bearer lh_test_…" \n  -H "Content-Type: application/json" \n  -d '{"amount":0,"reason":"string"}'
Risposta 200
{
  "id": "ses_1a2b3c4d5e6f7a8b9c0d",
  "object": "session",
  "livemode": true,
  "state": "string",
  "mode": "reservation",
  "channel": "qr",
  "location_id": "string",
  "device_id": "string",
  "connector_id": "string",
  "currency": "string",
  "authorized_amount": 1235,
  "amount": 1235,
  "captured_amount": 1235,
  "refunded_amount": 1235,
  "vat_amount": 1235,
  "energy_wh": 0,
  "idle_minutes": 0,
  "stop_reason": "string",
  "receipt_number": "string",
  "started_at": "2026-10-25T08:30:00.000Z",
  "ended_at": "2026-10-25T08:30:00.000Z",
  "settled_at": "2026-10-25T08:30:00.000Z",
  "created_at": "string"
}