Use webhooks for real time messages
Last updated
Last updated
Webhooks are used to get real time guaranteed messages of ecosystem events such as state finalization, transfers, marketplace sales, and more from the platform.
You can use OpenAPI Swagger file below to generate webhook handler:
After , it should be able to receive structures like this:
Fields Description:
NotificationId - a unique identifier for each notification.
NotificationType - a string indicating the type of the event. This value helps determine how to interpret the payload.
Can be one of:
ItemTypeStateUpdated
ItemUpdateError
ItemStateUpdated
ItemMetadataUpdated
PurchaseCompleted
SellCompleted
QuickTradeCreated
QuickTradeReserved
QuickTradeCompleted
NotificationPayload - a JSON-marshalled string containing the payload data.
The NotificationType field indicates whether the NotificationPayload should be unmarshalled into corresponding structure:
Item (for ItemTypeStateUpdated, ItemUpdateError, ItemStateUpdated)
ItemType (for ItemMetadataUpdated)
PurchaseCompleted
SellCompleted
QuickTradeCreated
QuickTradeReserved
QuickTradeCompleted
Below are two example responses using the ServerMessagingNotification struct with random data.
In this example, the payload is marshalled from an Item object.
Here, the payload is marshalled from an ItemType object.