API reference
Example Response 200
Example Response 201
Example Response 200
Example Response 200
Example Response 200
Example Response 200
Example Response 200
Webhooks
7 endpoints
The endpoint descriptions come directly from the API and are in German.
Webhook-Endpunkte
get/v1/webhook_endpoints
Empfänger für Ereignisse.
Response 200WebhookEndpointList
| Name | Type | Description |
|---|---|---|
objectrequired | "list" | |
datarequired | WebhookEndpoint[] | |
has_morerequired | boolean |
Possible errors
- 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.
Parameters
| Name | In | Type |
|---|---|---|
idempotency-keyoptionalWiederholbare Anfragen ohne doppelte Wirkung (24 Stunden) | Header | string |
Request
| Name | Type | Description |
|---|---|---|
urlrequired | string (uri) | |
descriptionoptional | string | null | |
eventsoptional | "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" | "*"[] | |
enabledoptional | boolean |
Response 201WebhookEndpoint
| Name | Type | Description |
|---|---|---|
idrequired | string | ID mit Präfix «whk_» |
objectrequired | "webhook_endpoint" | |
livemoderequired | boolean | |
urlrequired | string | |
descriptionrequired | string | null | |
eventsrequired | string[] | |
enabledrequired | boolean | |
secretoptional | string | Nur beim Anlegen oder Rotieren sichtbar |
created_atrequired | string |
Possible errors
- 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`.
Parameters
| Name | In | Type |
|---|---|---|
idrequired | Path | string |
Request
| Name | Type | Description |
|---|---|---|
urloptional | string (uri) | |
descriptionoptional | string | null | |
eventsoptional | "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" | "*"[] | |
enabledoptional | boolean | |
rotate_secretoptional | boolean |
Response 200WebhookEndpoint
| Name | Type | Description |
|---|---|---|
idrequired | string | ID mit Präfix «whk_» |
objectrequired | "webhook_endpoint" | |
livemoderequired | boolean | |
urlrequired | string | |
descriptionrequired | string | null | |
eventsrequired | string[] | |
enabledrequired | boolean | |
secretoptional | string | Nur beim Anlegen oder Rotieren sichtbar |
created_atrequired | string |
Possible errors
- 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.
Parameters
| Name | In | Type |
|---|---|---|
idrequired | Path | string |
Response 200Deleted
| Name | Type | Description |
|---|---|---|
idrequired | string | |
objectrequired | string | |
deletedrequired | true |
Possible errors
- 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.
Parameters
| Name | In | Type |
|---|---|---|
idrequired | Path | string |
Response 200Object
Possible errors
- 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.
Parameters
| Name | In | Type |
|---|---|---|
limitoptional | Query | integer |
starting_afteroptional | Query | string |
typeoptional | Query | string |
Response 200EventList
| Name | Type | Description |
|---|---|---|
objectrequired | "list" | |
datarequired | Event[] | |
has_morerequired | boolean |
Possible errors
- 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.
Parameters
| Name | In | Type |
|---|---|---|
idrequired | Path | string |
idempotency-keyoptionalWiederholbare Anfragen ohne doppelte Wirkung (24 Stunden) | Header | string |
Response 200Object
Possible errors
- 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_…"{}