Webhooks
The full list of request body parameters and possible outcomes can be found here.
#
Retrieve webhooksRetrieves the webhooks configured for the channel identified by your API key.
List<WebhookResponse> response = api.webhooksClient().retrieveWebhooks().get();
#
Register webhookRegister a new webhook endpoint that Checkout.com will post all or selected events to.
List<String> eventTypes = Arrays.asList("payment_captured", "payment_approved", "payment_declined");
WebhookRequest webhookRequest = WebhookRequest.builder() .url("https://example.com/webhook") .eventTypes(eventTypes) .build();
WebhookResponse response = api.webhooksClient().registerWebhook(webhookRequest).get();
#
Retrieve webhookRetrieves the webhook with the specified identifier string.
WebhookResponse webhook = api.webhooksClient().retrieveWebhook(webhookId).get();
#
Update webhookUpdates an existing webhook.
List<String> eventTypes = Arrays.asList("payment_captured", "payment_approved", "payment_declined");
WebhookRequest webhookRequest = WebhookRequest.builder() .url("https://example.com/webhooks/updated") .eventTypes(eventTypes) .build();
WebhookResponse webhook = api.webhooksClient().updateWebhook(webhookId, webhookRequest).get();
#
Partially update webhookUpdates all or some of the registered webhook details.
WebhookRequest webhookRequest = oldWebhook.toRequest();webhookRequest.setUrl("https://example.com/webhooks/updated");
WebhookResponse newWebhook = api.webhooksClient().updateWebhook(oldWebhook.getId(), webhookRequest).get();
#
Remove webhookRemoves an existing webhook.
api.webhooksClient().removeWebhook(webhookId).get();