bunq callbacks: list, set and remove notification filters #1

Open
opened 2026-11-21 06:27:30 +00:00 by jorijnvdgraaf · 0 comments

Nostro can read and pay through a bunq connection, but it cannot tell bunq to push a notification when something happens on an account. bunq calls these callbacks and stores them as notification filters. There is no typed call for them in the library (only the raw Get and Post reach them, for a consumer that holds the credentials itself), and nothing on nostrod's interface or in the CLI. So whoever uses nostrod, and therefore holds no key, has no way to register a URL.

Who needs it

A server that settles incoming bank transfers. The catcrafts.net shop takes SEPA transfers into its own bunq account and marks an order paid when a credit with its reference arrives. bunq pushes each payment to the shop's server within seconds, which is what makes that fast. The shop can already read the account through nostrod (Transactions), and registering the callback is the last thing its own bunq client is kept for: tools/register-bunq-webhook.sh borrows that client's session. With this in Nostro, the client and the API key beside it can be deleted.

It is useful beyond that shop. Any front end that wants to react to a payment, a card transaction or a request without polling needs the same calls.

What bunq offers

From bunq's documentation (doc.bunq.com, "Callbacks (Webhooks)" and the Notification Filter pages, read 2026-11-21) and from the script above, which has registered one against production:

  • GET /v1/user/{userID}/notification-filter-url lists the URL filters. Each item is a NotificationFilterUrl with a category and a notification_target.
  • POST /v1/user/{userID}/notification-filter-url with {"notification_filters":[{"category":"MUTATION","notification_target":"https://…"}]} sets them. The POST replaces the whole set: a filter left out is deleted, and an empty list removes all of them.
  • The target must be HTTPS. A notification_delivery_method in the body is refused on this endpoint as superfluous.
  • Categories include MUTATION (any change of a balance, carrying the payment), PAYMENT, INSTANT_PAYMENT, REQUEST, DRAFT_PAYMENT, SCHEDULE_RESULT, IDEAL and the CARD_TRANSACTION_… family.
  • A failed callback is retried 5 times, a minute apart, and then dropped. GET /v1/user/{userID}/notification-filter-failure lists the dropped ones, and a POST there with notification_filter_failed_ids sends them again.
  • bunq does not sign a callback. It documents the source range for production (185.40.108.0/22, which it says may change) and optional certificate pinning (certificate-pinned).

Not checked, because bunq's pages do not say: whether a filter outlives the API key that set it, and whether an OAuth connection may set one.

What it would take

  • Library: on BunqConnector, list the filters and replace them, with typed values (a category and a target). Because bunq's POST replaces everything, adding or removing one filter has to read the set, change it and write it back.
  • nostrod: new methods on net.catcrafts.Nostro1 (design rule 10 allows adding methods), the XML, Nostro::Client, and a polkit action for each (design rule 9). Setting changes something at the bank and pays nobody, which is what Change is for.
  • CLI and README: commands to list, set and remove. AGENTS.consumer.md for consumers.
  • FakeBunq.inc and tests for the calls, and one run against the sandbox.

To decide

  • Which action listing needs. A target URL is often the only secret a receiver has, because bunq does not sign: the shop's is a long random path. Under View, every program in the user's session could read it without a password.
  • Whether the list of failed callbacks and their retry belong in the same change. A receiver could use them to recover what it missed while it was down, which the shop covers with a periodic read of the account.
  • What the app shows of this, if anything.
Nostro can read and pay through a bunq connection, but it cannot tell bunq to push a notification when something happens on an account. bunq calls these callbacks and stores them as notification filters. There is no typed call for them in the library (only the raw `Get` and `Post` reach them, for a consumer that holds the credentials itself), and nothing on nostrod's interface or in the CLI. So whoever uses nostrod, and therefore holds no key, has no way to register a URL. ## Who needs it A server that settles incoming bank transfers. The catcrafts.net shop takes SEPA transfers into its own bunq account and marks an order paid when a credit with its reference arrives. bunq pushes each payment to the shop's server within seconds, which is what makes that fast. The shop can already read the account through nostrod (`Transactions`), and registering the callback is the last thing its own bunq client is kept for: [`tools/register-bunq-webhook.sh`](https://forgejo.catcrafts.net/Catcrafts/catcrafts.net/src/commit/80668e18cdd942c3c0ce4883f14264f376067589/tools/register-bunq-webhook.sh) borrows that client's session. With this in Nostro, the client and the API key beside it can be deleted. It is useful beyond that shop. Any front end that wants to react to a payment, a card transaction or a request without polling needs the same calls. ## What bunq offers From bunq's documentation (doc.bunq.com, "Callbacks (Webhooks)" and the Notification Filter pages, read 2026-11-21) and from the script above, which has registered one against production: - `GET /v1/user/{userID}/notification-filter-url` lists the URL filters. Each item is a `NotificationFilterUrl` with a `category` and a `notification_target`. - `POST /v1/user/{userID}/notification-filter-url` with `{"notification_filters":[{"category":"MUTATION","notification_target":"https://…"}]}` sets them. **The POST replaces the whole set**: a filter left out is deleted, and an empty list removes all of them. - The target must be HTTPS. A `notification_delivery_method` in the body is refused on this endpoint as superfluous. - Categories include `MUTATION` (any change of a balance, carrying the payment), `PAYMENT`, `INSTANT_PAYMENT`, `REQUEST`, `DRAFT_PAYMENT`, `SCHEDULE_RESULT`, `IDEAL` and the `CARD_TRANSACTION_…` family. - A failed callback is retried 5 times, a minute apart, and then dropped. `GET /v1/user/{userID}/notification-filter-failure` lists the dropped ones, and a POST there with `notification_filter_failed_ids` sends them again. - bunq does not sign a callback. It documents the source range for production (`185.40.108.0/22`, which it says may change) and optional certificate pinning (`certificate-pinned`). Not checked, because bunq's pages do not say: whether a filter outlives the API key that set it, and whether an OAuth connection may set one. ## What it would take - Library: on `BunqConnector`, list the filters and replace them, with typed values (a category and a target). Because bunq's POST replaces everything, adding or removing one filter has to read the set, change it and write it back. - nostrod: new methods on `net.catcrafts.Nostro1` (design rule 10 allows adding methods), the XML, `Nostro::Client`, and a polkit action for each (design rule 9). Setting changes something at the bank and pays nobody, which is what `Change` is for. - CLI and README: commands to list, set and remove. `AGENTS.consumer.md` for consumers. - `FakeBunq.inc` and tests for the calls, and one run against the sandbox. ## To decide - Which action listing needs. A target URL is often the only secret a receiver has, because bunq does not sign: the shop's is a long random path. Under `View`, every program in the user's session could read it without a password. - Whether the list of failed callbacks and their retry belong in the same change. A receiver could use them to recover what it missed while it was down, which the shop covers with a periodic read of the account. - What the app shows of this, if anything.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Catcrafts/Nostro#1
No description provided.