Managing webhook subscriptions
Rabo Smart Pay delivers events to your server using one or more webhook subscriptions, a subscription consist of:
- A destination in the form of an HTTP endpoints controlled by the you.
- A set of event types that will be delivered to the destination.
- Optionally a textual description of the webhook.
Webhook subscriptions are managed through the dashboard, or using the Webhook Subscriptions Management API.
The default maximum number of total webhook subscriptions is 32.
Basic Usage
Listing all subscriptions
- Dashboard
- Java
SmartPay smartPay = new SmartPay(REFRESH_TOKEN);
List<WebhookSubscription> subscriptions = smartPay.webhookSubscriptions.list();
Create a new subscription
- Dashboard
- Java
Starting at the webhook subscriptions overview:
- Click
New subscription
- Fill in the relevant details.
- Click
Create
SmartPay smartPay = new SmartPay(REFRESH_TOKEN);
smartPay.webhookSubscriptions.create(
WebhookSubscription.builder()
.description("My Subscription")
.url(new URI("https://www.example.com/callback"))
.event(Event.OrderStatusFinalizedV1)
.build()
);
Disable a subscription
- Dashboard
- Java
Starting at the webhook subscriptions overview:
- Find the subscription to disable.
- Click
Edit
. - In the status dropdown, select
disabled
. - Click
Update
.
SmartPay smartPay = new SmartPay(REFRESH_TOKEN);
smartPay.webhookSubscriptions.disable("wsb_akn89a3no4n2rcas4jssa");
Whenever you disable, or delete a webhook subscription that still has outstanding deliveries, Rabo Smart Pay will still attempt to deliver those events. Keep this in mind when disabling a webhook subscription; the destination might still receive events afterwards.
If you change the destination of a webhook subscription, any outstanding deliveries will still be sent to the old destination.