Skip to main content

Setting Up Webhooks

How to create webhook subscriptions, choose event types, and test delivery using the merchant portal or API.

Written by Ryan O
Updated today

Overview

Webhooks push real-time event notifications to your server so you do not need to poll the API for status updates. When something happens in your Anton account -- such as a payout completing or a payee being created -- Anton sends an HTTP POST request to your registered URL with the event details.

Creating a Webhook via the Portal

  1. Log in to the merchant portal and navigate to Settings > Webhooks

  2. Click Create Webhook

  3. Enter your endpoint URL -- this must be a publicly accessible HTTPS URL

  4. Select the event types you want to receive (e.g., payout.completed, payout.failed)

  5. Click Save

After creation, the portal displays your signing secret. Copy and store it securely -- you need it to verify webhook signatures. The signing secret is only shown once.

Creating a Webhook via the API

curl https://api.antonpayments.dev/v1/webhooks \
  -X POST \
  -H "Authorization: Bearer ak_test_..." \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://your-server.com/webhooks/anton",
    "events": [
      "payout.completed",
      "payout.failed",
      "payout.returned",
      "payee.created"
    ]
  }'

The response includes the webhook ID, your selected events, and the signing_secret. Store the signing secret immediately -- it is only returned at creation time.

Choosing Event Types

Subscribe only to the events your system needs. Common configurations:

  • Payout tracking -- Subscribe to payout.completed, payout.failed, and payout.returned to track final outcomes.

  • Full lifecycle -- Add payout.created, payout.screening, payout.processing, and payout.sent for every status change.

  • Payee management -- Subscribe to payee.created, payee.updated, and payee.deleted to keep local records in sync.

  • Batch operations -- Use batch.completed and batch.failed to monitor batch processing.

Testing Webhook Delivery

Before going live, test your webhook endpoint in sandbox:

  • Use a tunnel service for local development. Tools like ngrok expose your local server so Anton can deliver webhooks:
    ​ngrok http 3000
    Register the generated HTTPS URL as your webhook endpoint.

  • Create test payouts in sandbox to trigger real webhook deliveries. Sandbox payouts settle instantly, so you receive events immediately.

  • Check delivery history in the merchant portal under Settings > Webhooks. Each attempt shows the status code, response time, and error details.

Managing Subscriptions

You can update or delete webhook subscriptions at any time through the portal or API. When you update a subscription, you can change the URL or modify the event types. Deleting a subscription stops all future deliveries to that endpoint.

Did this answer your question?