Référence API
Exemple Réponse 200
Exemple Réponse 201
Exemple Réponse 200
Exemple Réponse 200
Exemple Réponse 200
Exemple Réponse 200
Exemple Réponse 200
Webhooks
7 endpoints
Les descriptions des endpoints proviennent directement de l'API et sont en allemand.
Webhook-Endpunkte
get/v1/webhook_endpoints
Empfänger für Ereignisse.
Réponse 200WebhookEndpointList
| Nom | Type | Description |
|---|---|---|
objectobligatoire | "list" | |
dataobligatoire | WebhookEndpoint[] | |
has_moreobligatoire | boolean |
Erreurs possibles
- 400 Anfrage ungültig
- 401 Nicht angemeldet
- 403 Berechtigung fehlt
- 404 Nicht gefunden
- 409 Zustand passt nicht
- 429 Zu viele Anfragen
curl -X GET https://api.ladehase.com/v1/webhook_endpoints \n -H "Authorization: Bearer lh_test_…"{
"object": "list",
"data": [
{
"id": "whk_2f4a6c8e0b1d3f5a",
"object": "webhook_endpoint",
"livemode": true,
"url": "string",
"description": "string",
"events": [
"string"
],
"enabled": true,
"secret": "string",
"created_at": "string"
}
],
"has_more": true
}Webhook anlegen
post/v1/webhook_endpoints
Signatur `Ladehase-Signature: t=…,v1=…` (HMAC-SHA256 über `t.body`). Das Geheimnis ist nur in dieser Antwort sichtbar.
Paramètres
| Nom | Emplacement | Type |
|---|---|---|
idempotency-keyfacultatifWiederholbare Anfragen ohne doppelte Wirkung (24 Stunden) | En-tête | string |
Requête
| Nom | Type | Description |
|---|---|---|
urlobligatoire | string (uri) | |
descriptionfacultatif | string | null | |
eventsfacultatif | "session.created" | "session.started" | "session.updated" | "session.stopped" | "session.settled" | "session.failed" | "payment.authorized" | "payment.captured" | "payment.released" | "payment.refunded" | "device.online" | "device.offline" | "device.error" | "terminal.online" | "terminal.offline" | "integration.error" | "*"[] | |
enabledfacultatif | boolean |
Réponse 201WebhookEndpoint
| Nom | Type | Description |
|---|---|---|
idobligatoire | string | ID mit Präfix «whk_» |
objectobligatoire | "webhook_endpoint" | |
livemodeobligatoire | boolean | |
urlobligatoire | string | |
descriptionobligatoire | string | null | |
eventsobligatoire | string[] | |
enabledobligatoire | boolean | |
secretfacultatif | string | Nur beim Anlegen oder Rotieren sichtbar |
created_atobligatoire | string |
Erreurs possibles
- 400 Anfrage ungültig
- 401 Nicht angemeldet
- 403 Berechtigung fehlt
- 404 Nicht gefunden
- 409 Zustand passt nicht
- 429 Zu viele Anfragen
curl -X POST https://api.ladehase.com/v1/webhook_endpoints \n -H "Authorization: Bearer lh_test_…" \n -H "Content-Type: application/json" \n -d '{"url":"https://example.ch/webhooks/ladehase","description":"string","events":["*"],"enabled":true}'{
"id": "whk_2f4a6c8e0b1d3f5a",
"object": "webhook_endpoint",
"livemode": true,
"url": "string",
"description": "string",
"events": [
"string"
],
"enabled": true,
"secret": "string",
"created_at": "string"
}Webhook ändern
patch/v1/webhook_endpoints/{id}
Auch `rotate_secret`.
Paramètres
| Nom | Emplacement | Type |
|---|---|---|
idobligatoire | Chemin | string |
Requête
| Nom | Type | Description |
|---|---|---|
urlfacultatif | string (uri) | |
descriptionfacultatif | string | null | |
eventsfacultatif | "session.created" | "session.started" | "session.updated" | "session.stopped" | "session.settled" | "session.failed" | "payment.authorized" | "payment.captured" | "payment.released" | "payment.refunded" | "device.online" | "device.offline" | "device.error" | "terminal.online" | "terminal.offline" | "integration.error" | "*"[] | |
enabledfacultatif | boolean | |
rotate_secretfacultatif | boolean |
Réponse 200WebhookEndpoint
| Nom | Type | Description |
|---|---|---|
idobligatoire | string | ID mit Präfix «whk_» |
objectobligatoire | "webhook_endpoint" | |
livemodeobligatoire | boolean | |
urlobligatoire | string | |
descriptionobligatoire | string | null | |
eventsobligatoire | string[] | |
enabledobligatoire | boolean | |
secretfacultatif | string | Nur beim Anlegen oder Rotieren sichtbar |
created_atobligatoire | string |
Erreurs possibles
- 400 Anfrage ungültig
- 401 Nicht angemeldet
- 403 Berechtigung fehlt
- 404 Nicht gefunden
- 409 Zustand passt nicht
- 429 Zu viele Anfragen
curl -X PATCH https://api.ladehase.com/v1/webhook_endpoints/{id} \n -H "Authorization: Bearer lh_test_…" \n -H "Content-Type: application/json" \n -d '{"url":"https://example.ch/webhooks/ladehase","description":"string","events":["*"],"enabled":true,"rotate_secret":true}'{
"id": "whk_2f4a6c8e0b1d3f5a",
"object": "webhook_endpoint",
"livemode": true,
"url": "string",
"description": "string",
"events": [
"string"
],
"enabled": true,
"secret": "string",
"created_at": "string"
}Webhook löschen
delete/v1/webhook_endpoints/{id}
Keine weiteren Zustellungen.
Paramètres
| Nom | Emplacement | Type |
|---|---|---|
idobligatoire | Chemin | string |
Réponse 200Deleted
| Nom | Type | Description |
|---|---|---|
idobligatoire | string | |
objectobligatoire | string | |
deletedobligatoire | true |
Erreurs possibles
- 400 Anfrage ungültig
- 401 Nicht angemeldet
- 403 Berechtigung fehlt
- 404 Nicht gefunden
- 409 Zustand passt nicht
- 429 Zu viele Anfragen
curl -X DELETE https://api.ladehase.com/v1/webhook_endpoints/{id} \n -H "Authorization: Bearer lh_test_…"{
"id": "string",
"object": "string",
"deleted": true
}Zustellprotokoll
get/v1/webhook_endpoints/{id}/deliveries
Letzte 100 Zustellungen mit Antwortcode.
Paramètres
| Nom | Emplacement | Type |
|---|---|---|
idobligatoire | Chemin | string |
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
curl -X GET https://api.ladehase.com/v1/webhook_endpoints/{id}/deliveries \n -H "Authorization: Bearer lh_test_…"{}Ereignisse
get/v1/events
Alle Ereignisse, neueste zuerst.
Paramètres
| Nom | Emplacement | Type |
|---|---|---|
limitfacultatif | Requête | integer |
starting_afterfacultatif | Requête | string |
typefacultatif | Requête | string |
Réponse 200EventList
| Nom | Type | Description |
|---|---|---|
objectobligatoire | "list" | |
dataobligatoire | Event[] | |
has_moreobligatoire | boolean |
Erreurs possibles
- 400 Anfrage ungültig
- 401 Nicht angemeldet
- 403 Berechtigung fehlt
- 404 Nicht gefunden
- 409 Zustand passt nicht
- 429 Zu viele Anfragen
curl -X GET https://api.ladehase.com/v1/events \n -H "Authorization: Bearer lh_test_…"{
"object": "list",
"data": [
{
"id": "evt_1b3d5f7a9c0e2f4b",
"object": "event",
"type": "string",
"livemode": true,
"data": {},
"created_at": "string"
}
],
"has_more": true
}Ereignis erneut senden
post/v1/events/{id}/resend
An alle passenden Endpunkte.
Paramètres
| Nom | Emplacement | Type |
|---|---|---|
idobligatoire | Chemin | string |
idempotency-keyfacultatifWiederholbare Anfragen ohne doppelte Wirkung (24 Stunden) | En-tête | string |
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
curl -X POST https://api.ladehase.com/v1/events/{id}/resend \n -H "Authorization: Bearer lh_test_…"{}