Webhooks

Understanding Webhooks

Webhooks provide a powerful way to receive real-time notifications about events occurring in your UnblockPay transactions. Instead of continuously polling our API for updates, webhooks push information to your system as soon as events happen.

When an event occurs (like a transaction status change), UnblockPay will send an HTTP POST request to the URL you specify. This enables your application to:

  • Automatically update your internal systems when transaction statuses change

  • Track the progress of payments in real-time

  • Trigger your own business logic based on payment events

  • Maintain accurate records without constant API polling


How to create or manage a webhook configuration

Create a new webhook configuration

To set it up, make a POST request to /v1/webhook-configs with:

  • The list of events (listed below in Event types) you want to subscribe to in the subscriptions field

  • Your webhook URL where you'll receive the events

  • Set enabled to true to begin listening for events. If enabled is omitted, it defaults to false — set it to true to begin receiving events immediately.

Each partner may have only one webhook configuration.

Attempting to create a second configuration returns a 422 error with the code webhook_config_already_exists. Use PUT /v1/webhook-configs/{id} to update an existing configuration.

Below is an example request to our webhook endpoint:

curl https://api.sandbox.unblockpay.com/v1/webhook-configs \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: YOUR_SECRET_TOKEN' \
  --data '{
    "url": "https://your-app.example.com/webhooks/unblockpay",
    "subscriptions": ["payout.completed", "payout.failed", "payin.completed"],
    "enabled": true
  }'

You will get a response like:

{
  "id": "d4e5f6a7-0010-7000-8000-001122334455",
  "partner_id": "123e4567-e89b-12d3-a456-426614174000",
  "url": "https://your-app.example.com/webhooks/unblockpay",
  "subscriptions": ["payout.completed", "payout.failed", "payin.completed"],
  "enabled": true,
  "created_at": "2024-03-15T14:30:00Z",
  "updated_at": "2024-03-15T14:30:00Z"
}

Update the current webhook configuration

You can update your webhook configuration at any time by making a PUT request to /v1/webhook-configs/{id} to:

  • Modify which events you want to receive

  • Change your webhook receiving URL

  • Set enabled to true or false to enable or disable webhook notifications

Below is an example request to update webhook configuration:

curl https://api.sandbox.unblockpay.com/v1/webhook-configs/d4e5f6a7-0010-7000-8000-001122334455 \
  --request PUT \
  --header 'Content-Type: application/json' \
  --header 'Authorization: YOUR_SECRET_TOKEN' \
  --data '{
    "url": "https://your-app.example.com/webhooks/unblockpay-v2",
    "subscriptions": [
      "payout.completed",
      "payout.failed",
      "payout.error",
      "payin.completed",
      "customer.approved",
      "customer.rejected"
    ],
    "enabled": true
  }'

Response example:

{
  "id": "d4e5f6a7-0010-7000-8000-001122334455",
  "partner_id": "123e4567-e89b-12d3-a456-426614174000",
  "url": "https://your-app.example.com/webhooks/unblockpay-v2",
  "subscriptions": [
    "payout.completed",
    "payout.failed",
    "payout.error",
    "payin.completed",
    "customer.approved",
    "customer.rejected"
  ],
  "enabled": true,
  "created_at": "2024-03-15T14:30:00Z",
  "updated_at": "2024-03-22T10:15:00Z"
}

To pause event delivery without deleting the configuration, set enabled to false


Event types

Below are all available webhook event types.

Fiat to Stablecoin (Pay-in)

Event

Description

payin.created

Triggered when a new pay-in request is initially created.

payin.processing

Sent when UnblockPay confirms receipt of the fiat deposit and begins processing the transaction.

payin.completed

Indicates that the pay-in has been successfully processed and funds have been delivered to the recipient.

payin.cancelled

Triggered when a pay-in is cancelled, which can only occur while in the awaiting_deposit status.

payin.failed

Indicates that the pay-in transaction has failed to process successfully.

payin.error

Indicates that an unexpected error occurred during processing.

payin.refunded

Signifies that the funds have been returned to the sender.

Stablecoin to Fiat (Payout)

Event

Description

payout.created

Triggered when a new payout request is initially created.

payout.processing

Sent when UnblockPay confirms receipt of the stablecoin deposit and begins processing the transaction.

payout.completed

Indicates that the payout has been successfully processed and funds have been delivered to the recipient.

payout.cancelled

Triggered when a payout is cancelled, which can only occur while in the awaiting_deposit status.

payout.failed

Indicates that the payout transaction has failed to process successfully.

payout.error

Indicates that an unexpected error occurred during processing.

payout.refunded

Signifies that the funds have been returned to the sender.

Stablecoin Transfer

Event

Description

walletTransfer.created

Triggered when a new wallet transfer request is initially created.

walletTransfer.completed

Indicates that the wallet transfer has been successfully processed and funds have been delivered to the recipient.

walletTransfer.failed

Indicates that the wallet transfer transaction has failed to process successfully.

Customer

Event

Description

customer.created

Triggered when a new customer record is created.

customer.approved

Sent when a customer's identity verification is approved.

customer.under_review

Sent when a customer's verification is pending manual review.

customer.rejected

Sent when a customer's verification is rejected.

customer.partially_rejected

Sent when part of a customer's verification is rejected.

External Account

Event

Description

external_account.created

Triggered when a new external account is created for a customer.

external_account.approved

Sent when an external account is approved.

external_account.rejected

Sent when an external account is rejected.

Virtual Account

Event

Description

virtual_account.created

Triggered when a new virtual account is provisioned.

virtual_account.approved

Sent when a virtual account is approved and ready to receive deposits.

virtual_account.rejected

Sent when a virtual account provisioning request is rejected.

virtual_account.cancelled

Sent when a virtual account is cancelled.


Event structure

For every event, the payload includes the following fields:

Field

Description

event

The resource type (e.g., payout, payin, customer).

event_id

The unique identifier of the event.

event_type

One of the event types listed above.

event_resource_id

The unique identifier of the resource that changed.

event_resource_status

The current status of the resource.

event_resource

The complete resource object at the time of the event.

event_created_at

ISO 8601 timestamp of when the event occurred.

Below is an example payload for a created payout:

{
  "event": "payout",
  "event_id": "4d7196d0-ed6e-11ef-8fc7-7b1bb8f06792",
  "event_type": "payout.created",
  "event_resource_id": "23449700-0375-11f0-a25c-7da3b4c9befc",
  "event_resource_status": "awaiting_deposit",
  "event_resource": {},
  "event_created_at": "2025-03-17T21:16:49.711Z"
}

Testing webhooks in sandbox environment

In the sandbox environment, UnblockPay does not send real webhooks. Instead, you can trigger mocked event payloads that are delivered to your registered URL. To test, send a POST request to /webhooks/mock with the desired event_type.

Mocked events are currently supported for payout, payin, and walletTransfer event types.

Here is a request example in sandbox environment:

{
    "event_type": "payout.processing"
}

Webhooks API endpoints

Method

Endpoint

Description

GET

/v1/webhook-configs

Get the current webhook configuration​

POST

/v1/webhook-configs

Create a new webhook configurationon

PUT

/v1/webhook-configs/{id}

Update the current webhook configuration

For the full schema and request/response details, see the API Reference.