API Reference

When to use Webhooks

Webhooks are necessary for behind-the-scenes transactions. With webhooks you can be notified about asynchronous changes to the status of transaction objects. BlockATM can send webhook events that notify your application anytime an event happens on your account. This is especially useful for events like transaction status updates, that are not triggered by a direct API request.
It will be sent via an HTTP POST request to any endpoint URLs that you have defined in your account's Webhooks settings.

You can differentiate each webhook event type by the request header "BlockATM-Event". When "BlockATM-Event" is set to "Payment", it indicates that your payment contract has received a payment. When it is set to "Payout", it indicates that your payout contract has triggered a payment.


All Event:

  • Payment : Payment contract has received a payment
  • QR-Payment: Received a payment from Qr Code model.
  • Payout: Payout contract has triggered a payment.
  • QR-Payout : Payout results of the QR Code have been generated.

Configuring your Webhook Settings

Webhooks are configured in your BlockATM dashboard.

Receiving a Webhook Notification

Creating a webhook endpoint on your server is no different from creating any page on your website. With PHP, you might create a new .php file on your server; with a framework like Sinatra, you would add a new route with the desired URL.

Webhook data is sent as JSON in the POST request body. The full event details are included and can be used directly, after parsing the JSON.