Skip to main content

🧡 Send Transaction and Receive Notification via Webhook

This guide documents the full workflow for sending a blockchain transaction and receiving asynchronous status updates via webhook events. It covers how to subscribe to the necessary events and how to interpret transaction outcomes (mined or failed).

🌟 Objective: Ensure clients can programmatically send transactions and handle outcomes via webhook notifications.


πŸ“š OpenAPI Documentation​


✨ Workflow Summary​

This workflow includes the following steps:

  1. πŸ”Ή Subscribe to webhook events for TX_MINED and TX_FAILED.
  2. πŸ”Ή Send a blockchain transaction (e.g. minting an ERC3643 token).
  3. πŸ”Ή Receive asynchronous notification via webhook on transaction success or failure.

πŸ“‹ Workflow Steps Table​

StepAPI OperationMethodParametersOutputsDescription
Subscribe to All TX EventsPOST /subscriptions/webhooks-eventTypes, callbackUrl, filterByClientsubscriptionIdSubscribes to TX_MINED and TX_FAILED for all transactions by the client
OR: Subscribe by TokenPOST /tokens/{tokenId}/subscriptions/webhook-tokenId, eventTypes, callbackUrlsubscriptionIdSubscribes to TX_MINED and TX_FAILED for a specific token only
Mint Token (example tx)POST /erc3643/{tokenId}/mint-recipient, amount, tokenIdtransactionIdSends a token mint transaction
Receive Webhook EventCallback to callbackUrl-eventType, txHash, status-Event TX_MINED or TX_FAILED sent to the registered callback URL

🎨 Workflow Visualizations​

🌊 Mermaid Sequence Diagram​

sequenceDiagram
participant Client
participant API
participant Blockchain

Client->>API: POST /subscriptions/webhooks (or /tokens/{tokenId}/subscriptions/webhook)
API->>Client: subscriptionId

Client->>API: POST /erc3643/{tokenId}/mint
API->>Client: transactionId

API->>Blockchain: Process transaction

alt Transaction mined
Blockchain-->>API: TX_MINED (with txHash)
API-->>Client: TX_MINED (with txHash)
else Transaction failed
Blockchain-->>API: TX_FAILED (with txHash)
API-->>Client: TX_FAILED (with txHash)
end