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
subscriptionsfield -
Your webhook URL where you'll receive the events
-
Set
enabledto true to begin listening for events. Ifenabledis omitted, it defaults tofalse— set it totrueto begin receiving events immediately.
Each partner may have only one webhook configuration.
Attempting to create a second configuration returns a
422error with the codewebhook_config_already_exists. UsePUT /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
enabledto 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
enabledtofalse
Event types
Below are all available webhook event types.
Fiat to Stablecoin (Pay-in)
|
Event |
Description |
|---|---|
|
|
Triggered when a new pay-in request is initially created. |
|
|
Sent when UnblockPay confirms receipt of the fiat deposit and begins processing the transaction. |
|
|
Indicates that the pay-in has been successfully processed and funds have been delivered to the recipient. |
|
|
Triggered when a pay-in is cancelled, which can only occur while in the |
|
|
Indicates that the pay-in transaction has failed to process successfully. |
|
|
Indicates that an unexpected error occurred during processing. |
|
|
Signifies that the funds have been returned to the sender. |
Stablecoin to Fiat (Payout)
|
Event |
Description |
|---|---|
|
|
Triggered when a new payout request is initially created. |
|
|
Sent when UnblockPay confirms receipt of the stablecoin deposit and begins processing the transaction. |
|
|
Indicates that the payout has been successfully processed and funds have been delivered to the recipient. |
|
|
Triggered when a payout is cancelled, which can only occur while in the |
|
|
Indicates that the payout transaction has failed to process successfully. |
|
|
Indicates that an unexpected error occurred during processing. |
|
|
Signifies that the funds have been returned to the sender. |
Stablecoin Transfer
|
Event |
Description |
|---|---|
|
|
Triggered when a new wallet transfer request is initially created. |
|
|
Indicates that the wallet transfer has been successfully processed and funds have been delivered to the recipient. |
|
|
Indicates that the wallet transfer transaction has failed to process successfully. |
Customer
|
Event |
Description |
|---|---|
|
|
Triggered when a new customer record is created. |
|
|
Sent when a customer's identity verification is approved. |
|
|
Sent when a customer's verification is pending manual review. |
|
|
Sent when a customer's verification is rejected. |
|
|
Sent when part of a customer's verification is rejected. |
External Account
|
Event |
Description |
|---|---|
|
|
Triggered when a new external account is created for a customer. |
|
|
Sent when an external account is approved. |
|
|
Sent when an external account is rejected. |
Virtual Account
|
Event |
Description |
|---|---|
|
|
Triggered when a new virtual account is provisioned. |
|
|
Sent when a virtual account is approved and ready to receive deposits. |
|
|
Sent when a virtual account provisioning request is rejected. |
|
|
Sent when a virtual account is cancelled. |
Event structure
For every event, the payload includes the following fields:
|
Field |
Description |
|---|---|
|
|
The resource type (e.g., |
|
|
The unique identifier of the event. |
|
|
One of the event types listed above. |
|
|
The unique identifier of the resource that changed. |
|
|
The current status of the resource. |
|
|
The complete resource object at the time of the event. |
|
|
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 the current webhook configuration |
|
|
|
Create a new webhook configurationon |
|
|
|
Update the current webhook configuration |
For the full schema and request/response details, see the API Reference.

