Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
215 changes: 215 additions & 0 deletions openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -11455,6 +11455,221 @@
}
},
"webhooks": {
"checkouts.created": {
"post": {
"operationId": "CheckoutCreatedWebhook",
"tags": [
"Checkouts"
],
"summary": "Checkout created",
"description": "Sent once when a checkout is first observed in the checkout snapshot stream, even if it is already paid, failed, or expired. The event timestamp is the original checkout creation time.",
"x-object": {
"$ref": "#/components/schemas/Checkout"
},
"x-object-type": "checkout",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Event"
},
"examples": {
"created": {
"value": {
"id": "event_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"type": "checkouts.created",
"created_at": "2026-10-15T12:00:00Z",
"object": {
"id": "e552de3b-1777-4c91-bdb8-756967678572",
"type": "checkout",
"url": "https://api.sumup.com/v0.1/checkouts/e552de3b-1777-4c91-bdb8-756967678572"
}
}
}
}
}
}
},
"responses": {
"2XX": {
"description": "Return any 2xx response to acknowledge successful delivery."
}
}
}
},
"checkouts.failed": {
"post": {
"operationId": "CheckoutFailedWebhook",
"tags": [
"Checkouts"
],
"summary": "Checkout failed",
"description": "Sent once when a checkout is first observed with status FAILED. A failed checkout can subsequently be retried and paid. Later FAILED snapshots do not emit another failed event.",
"x-object": {
"$ref": "#/components/schemas/Checkout"
},
"x-object-type": "checkout",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Event"
},
"examples": {
"failed": {
"value": {
"id": "event_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"type": "checkouts.failed",
"created_at": "2026-10-15T12:00:00Z",
"object": {
"id": "e552de3b-1777-4c91-bdb8-756967678572",
"type": "checkout",
"url": "https://api.sumup.com/v0.1/checkouts/e552de3b-1777-4c91-bdb8-756967678572"
}
}
}
}
}
}
},
"responses": {
"2XX": {
"description": "Return any 2xx response to acknowledge successful delivery."
}
}
}
},
"checkouts.expired": {
"post": {
"operationId": "CheckoutExpiredWebhook",
"tags": [
"Checkouts"
],
"summary": "Checkout expired",
"description": "Sent once when a checkout is first observed with status EXPIRED. Expiry or deactivation without an upstream snapshot cannot produce this event. Later EXPIRED snapshots do not emit another expired event.",
"x-object": {
"$ref": "#/components/schemas/Checkout"
},
"x-object-type": "checkout",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Event"
},
"examples": {
"expired": {
"value": {
"id": "event_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"type": "checkouts.expired",
"created_at": "2026-10-15T12:00:00Z",
"object": {
"id": "e552de3b-1777-4c91-bdb8-756967678572",
"type": "checkout",
"url": "https://api.sumup.com/v0.1/checkouts/e552de3b-1777-4c91-bdb8-756967678572"
}
}
}
}
}
}
},
"responses": {
"2XX": {
"description": "Return any 2xx response to acknowledge successful delivery."
}
}
}
},
"checkouts.updated": {
"post": {
"operationId": "CheckoutUpdatedWebhook",
"tags": [
"Checkouts"
],
"summary": "Checkout updated",
"description": "Sent when a checkout snapshot is published, including creation and payment status updates. Fetch the checkout to inspect its current status. This is not a guarantee that every checkout mutation produces a notification.",
"x-object": {
"$ref": "#/components/schemas/Checkout"
},
"x-object-type": "checkout",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Event"
},
"examples": {
"updated": {
"value": {
"id": "event_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"type": "checkouts.updated",
"created_at": "2026-10-15T12:00:00Z",
"object": {
"id": "e552de3b-1777-4c91-bdb8-756967678572",
"type": "checkout",
"url": "https://api.sumup.com/v0.1/checkouts/e552de3b-1777-4c91-bdb8-756967678572"
}
}
}
}
}
}
},
"responses": {
"2XX": {
"description": "Return any 2xx response to acknowledge successful delivery."
}
}
}
},
"checkouts.paid": {
"post": {
"operationId": "CheckoutPaidWebhook",
"tags": [
"Checkouts"
],
"summary": "Checkout paid",
"description": "Sent once when a checkout is first observed with status PAID. Later PAID snapshots do not emit another paid event. The timestamp is the snapshot update time, not necessarily the payment completion time.",
"x-object": {
"$ref": "#/components/schemas/Checkout"
},
"x-object-type": "checkout",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Event"
},
"examples": {
"paid": {
"value": {
"id": "event_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"type": "checkouts.paid",
"created_at": "2026-10-15T12:00:00Z",
"object": {
"id": "e552de3b-1777-4c91-bdb8-756967678572",
"type": "checkout",
"url": "https://api.sumup.com/v0.1/checkouts/e552de3b-1777-4c91-bdb8-756967678572"
}
}
}
}
}
}
},
"responses": {
"2XX": {
"description": "Return any 2xx response to acknowledge successful delivery."
}
}
}
},
"readers.created": {
"post": {
"operationId": "ReaderCreatedWebhook",
Expand Down
60 changes: 60 additions & 0 deletions src/main/java/com/sumup/sdk/events/AsyncEventsHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,66 @@ public EventNotification parse(byte[] body, String signature) {
return EventNotification.parse(client, body, signature, secret);
}

/**
* Registers the callback for {@code "checkouts.created"}, replacing any previous registration.
*
* @param callback callback to complete before acknowledging delivery
* @return this handler for chaining
*/
public AsyncEventsHandler onCheckoutCreated(AsyncEventCallback<CheckoutCreatedEvent> callback) {
Objects.requireNonNull(callback);
callbacks.put("checkouts.created", event -> callback.handle((CheckoutCreatedEvent) event));
return this;
}

/**
* Registers the callback for {@code "checkouts.expired"}, replacing any previous registration.
*
* @param callback callback to complete before acknowledging delivery
* @return this handler for chaining
*/
public AsyncEventsHandler onCheckoutExpired(AsyncEventCallback<CheckoutExpiredEvent> callback) {
Objects.requireNonNull(callback);
callbacks.put("checkouts.expired", event -> callback.handle((CheckoutExpiredEvent) event));
return this;
}

/**
* Registers the callback for {@code "checkouts.failed"}, replacing any previous registration.
*
* @param callback callback to complete before acknowledging delivery
* @return this handler for chaining
*/
public AsyncEventsHandler onCheckoutFailed(AsyncEventCallback<CheckoutFailedEvent> callback) {
Objects.requireNonNull(callback);
callbacks.put("checkouts.failed", event -> callback.handle((CheckoutFailedEvent) event));
return this;
}

/**
* Registers the callback for {@code "checkouts.paid"}, replacing any previous registration.
*
* @param callback callback to complete before acknowledging delivery
* @return this handler for chaining
*/
public AsyncEventsHandler onCheckoutPaid(AsyncEventCallback<CheckoutPaidEvent> callback) {
Objects.requireNonNull(callback);
callbacks.put("checkouts.paid", event -> callback.handle((CheckoutPaidEvent) event));
return this;
}

/**
* Registers the callback for {@code "checkouts.updated"}, replacing any previous registration.
*
* @param callback callback to complete before acknowledging delivery
* @return this handler for chaining
*/
public AsyncEventsHandler onCheckoutUpdated(AsyncEventCallback<CheckoutUpdatedEvent> callback) {
Objects.requireNonNull(callback);
callbacks.put("checkouts.updated", event -> callback.handle((CheckoutUpdatedEvent) event));
return this;
}

/**
* Registers the callback for {@code "members.created"}, replacing any previous registration.
*
Expand Down
16 changes: 16 additions & 0 deletions src/main/java/com/sumup/sdk/events/CheckoutCreatedEvent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Code generated by sumup-java/codegen. DO NOT EDIT.
package com.sumup.sdk.events;

import com.fasterxml.jackson.core.type.TypeReference;
import com.sumup.sdk.models.Checkout;

/**
* Sent once when a checkout is first observed in the checkout snapshot stream, even if it is
* already paid, failed, or expired. The event timestamp is the original checkout creation time.
*/
public final class CheckoutCreatedEvent extends FetchableEvent<Checkout> {
@Override
TypeReference<Checkout> resourceType() {
return new TypeReference<>() {};
}
}
17 changes: 17 additions & 0 deletions src/main/java/com/sumup/sdk/events/CheckoutExpiredEvent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Code generated by sumup-java/codegen. DO NOT EDIT.
package com.sumup.sdk.events;

import com.fasterxml.jackson.core.type.TypeReference;
import com.sumup.sdk.models.Checkout;

/**
* Sent once when a checkout is first observed with status EXPIRED. Expiry or deactivation without
* an upstream snapshot cannot produce this event. Later EXPIRED snapshots do not emit another
* expired event.
*/
public final class CheckoutExpiredEvent extends FetchableEvent<Checkout> {
@Override
TypeReference<Checkout> resourceType() {
return new TypeReference<>() {};
}
}
16 changes: 16 additions & 0 deletions src/main/java/com/sumup/sdk/events/CheckoutFailedEvent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Code generated by sumup-java/codegen. DO NOT EDIT.
package com.sumup.sdk.events;

import com.fasterxml.jackson.core.type.TypeReference;
import com.sumup.sdk.models.Checkout;

/**
* Sent once when a checkout is first observed with status FAILED. A failed checkout can
* subsequently be retried and paid. Later FAILED snapshots do not emit another failed event.
*/
public final class CheckoutFailedEvent extends FetchableEvent<Checkout> {
@Override
TypeReference<Checkout> resourceType() {
return new TypeReference<>() {};
}
}
17 changes: 17 additions & 0 deletions src/main/java/com/sumup/sdk/events/CheckoutPaidEvent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Code generated by sumup-java/codegen. DO NOT EDIT.
package com.sumup.sdk.events;

import com.fasterxml.jackson.core.type.TypeReference;
import com.sumup.sdk.models.Checkout;

/**
* Sent once when a checkout is first observed with status PAID. Later PAID snapshots do not emit
* another paid event. The timestamp is the snapshot update time, not necessarily the payment
* completion time.
*/
public final class CheckoutPaidEvent extends FetchableEvent<Checkout> {
@Override
TypeReference<Checkout> resourceType() {
return new TypeReference<>() {};
}
}
17 changes: 17 additions & 0 deletions src/main/java/com/sumup/sdk/events/CheckoutUpdatedEvent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Code generated by sumup-java/codegen. DO NOT EDIT.
package com.sumup.sdk.events;

import com.fasterxml.jackson.core.type.TypeReference;
import com.sumup.sdk.models.Checkout;

/**
* Sent when a checkout snapshot is published, including creation and payment status updates. Fetch
* the checkout to inspect its current status. This is not a guarantee that every checkout mutation
* produces a notification.
*/
public final class CheckoutUpdatedEvent extends FetchableEvent<Checkout> {
@Override
TypeReference<Checkout> resourceType() {
return new TypeReference<>() {};
}
}
5 changes: 5 additions & 0 deletions src/main/java/com/sumup/sdk/events/EventNotification.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ private static EventNotification parseBody(ApiClient client, byte[] body) {
throw new EventPayloadException("Expected a JSON object.");
Class<? extends EventNotification> type =
switch (root.path("type").asText("")) {
case "checkouts.created" -> CheckoutCreatedEvent.class;
case "checkouts.expired" -> CheckoutExpiredEvent.class;
case "checkouts.failed" -> CheckoutFailedEvent.class;
case "checkouts.paid" -> CheckoutPaidEvent.class;
case "checkouts.updated" -> CheckoutUpdatedEvent.class;
case "members.created" -> MemberCreatedEvent.class;
case "members.deleted" -> MemberDeletedEvent.class;
case "members.updated" -> MemberUpdatedEvent.class;
Expand Down
Loading
Loading