Bloc uses webhooks to notify your application when an event occurs in your account. Webhooks provide an asynchronous means of communication.

How to receive webhook notifications

Step 1: Configure your webhook URL on the Bloc Dashboard.

You can configure your webhook URL on the Bloc dashboard by going to settings>webhooks.

1490

Step 2: Listen for events

Build an HTTP handler that listens for events coming from Bloc.

const express = require('express');
const app = express();

app.post('/myapp/webhook', express.json({type: 'application/json'}), (request, response) => {
  const event = request.body;

  console.log(event)

  response.json({success: true});
});