Webhook Notifications
Listen for events on your Openfort account so your integration can automatically trigger reactions.
What is a webhook?#
Openfort uses webhooks to push real-time notifications to you about your transactions. All webhooks use HTTPS and deliver a JSON payload that can be used by your application. You can use webhook feeds to do things like:
- Granting users a game item when a transaction is confirmed.
- Store all transaction events in your own database for custom reporting/retention
Steps to receive webhooks#
You can start receiving real-time events in your app using the steps:
- Create a local endpoint to receive requests
- Register your development webhook endpoint
- Test that your webhook endpoint is working properly
- Register your production webhook endpoint
Webhook object#
The webhook object contains the following fields:
_10{_10 "data": {_10 "id": "tin_c502d628-5bb3-42f2-b8f5-62ba4d71df3a",_10 "createdAt": 1689869074,_10 "object": "transactionIntent",_10 "etc":"..."_10 },_10 "type": "transaction_intent.succeeded",_10 "date": 1689869074_10}
Where the type
will be one of the following:
transaction_intent.succeeded
: The transaction intent has arrived on-chain and is confirmed.transaction_intent.failed
: The transaction intent has arrived on-chain and is reverted.transaction_intent.cancelled
: The transaction intent parameters were not met.transaction_intent.broadcast
: The transaction intent was broadcasted.
And the data
will be a transaction intent object.
1. Create a local endpoint to receive requests#
In your local application, create a new route that can accept POST requests.