Skip to content
Weik.ioUniversity
Try Weik.io

Webhooks

APIM 4 · 3:08

A webhook version of the API accepts a payment provider's confirmations and stores each one in a channel before it answers ok. An integration then receives them from that channel.

Download the mp4Recorded on 2026.2

What it covers

  • Declaring the channel payments with weikio channel create, then applying version 2.0 as a webhook
  • The payment provider as a caller with its own key
  • A posted confirmation, stored as a webhook receipt before the ok
  • Listing the receipts with weikio events list in the hook family
  • The admin UI's Events page, which lists the receipt and opens it with its body
  • An integration in finance that receives the events of the payments channel

Commands in this video

Terminal
$ weikio channel create finance/payments
$ weikio apply -f ./finance/apis/webhooks.yaml
$ weikio subscription create finance/payment-provider --env production --api invoices --type apikey -y
$ curl http://api.example.com/invoices/2.0/payments -H "X-Api-Key: $API_KEY" -H "Content-Type: application/json" -d '{"payment":"settled","order":42}'
$ weikio events list --env production --family hook --api invoices
Transcript
  1. 0:02Your payment provider pushes a confirmation every time a payment settles.
  2. 0:06This video takes one in:
  3. 0:08a webhook version stores the body in a channel and answers ok.
  4. 0:17The gateway serves invoices in production, on api.example.com.
  5. 0:22Partner-x calls invoices 1.0 with its key, its limit counts the calls.
  6. 0:29Another caller pushes, instead of asking:
  7. 0:31the payment provider sends a confirmation when a payment settles.
  8. 0:36It does not want an answer. It wants its message taken in.
  9. 0:45First, the project declares the channel payments, with one command before the apply.
  10. 0:50A version can take a call in. This one is applied like any other document.
  11. 0:56Its type is webhook, its channel is payments.
  12. 0:59And it publishes to production, beside the proxy version.
  13. 1:03One apply stores it, and the gateway serves both versions under the same prefix.
  14. 1:08Version one dot zero forwards calls to the upstream.
  15. 1:11Version two dot zero stores them.
  16. 1:18A webhook call is admitted under a subscription, like any other call.
  17. 1:23So the payment provider is a caller with its own key.
  18. 1:26The key is minted and printed once.
  19. 1:32The provider posts a confirmation, with its key.
  20. 1:36The gateway stores the body in the channel.
  21. 1:38It answers ok, once the message is stored.
  22. 1:45The body the gateway just stored has a name.
  23. 1:48It is the webhook receipt, the message it keeps for one call it took in.
  24. 1:53Receipts live in a named stream of messages inside the hub that integrations read.
  25. 1:59That stream is a channel, and this one is payments.
  26. 2:05Reading what came in is one command.
  27. 2:07Its family is hook, for the receipts a webhook version stored.
  28. 2:12This one lists the receipts of the invoices API.
  29. 2:16Each row is one receipt, with its stream and its size.
  30. 2:25The version's page names its type and its channel.
  31. 2:28The Events page lists the receipt this version took in.
  32. 2:32This list is the same stored stream the command read.
  33. 2:36A receipt opens with its body.
  34. 2:42Where they go: an integration in finance reads the payments channel.
  35. 2:47It takes the receipts from there.
  36. 2:49The channel is the stream it reads from.
  37. 2:56Here is the picture.
  38. 2:57The webhook version stores every call it takes in, as a receipt in its channel.
  39. 3:03An integration reads the channel, and the provider gets its ok.