Webhooks
Paratro sends HTTP POST webhook notifications for transaction lifecycle events — from initial detection on-chain through final confirmation. All webhook requests are authenticated using HMAC-SHA256 signatures.Event Types
Webhooks are sent at each stage of a transaction’s lifecycle:| Event Type | Description | When |
|---|---|---|
transaction.confirming | Transaction detected on-chain | Block mined but < required confirmations |
transaction.confirmed | Transaction fully confirmed | Required confirmations reached |
transaction.failed | Transaction failed on-chain | Transaction reverted |
x402.settlement.confirmed | x402 settlement completed | Facilitator settle tx confirmed |
x402.settlement.failed | x402 settlement failed | Facilitator settle tx reverted |
Confirmation Requirements
| Chain | Confirmations | Estimated Time |
|---|---|---|
| Ethereum | 12 | ~2.5 minutes |
| BSC | 15 | ~45 seconds |
| Polygon | 12 | ~24 seconds |
| Base / Optimism / Arbitrum | 12 | ~24 seconds |
| Tron | 19 | ~57 seconds |
| Bitcoin | 1 | ~10 minutes |
| Solana | 0 (finalized) | Instant |
Trigger Conditions
Webhook notifications are sent when all of the following are met:- Wallet account for the address (
toorfrom) exists in the system - Client status is
ACTIVE - Configuration — both
WebhookUrlandWebhookSecretare configured
Request Format
Method:POST
Headers:
| Header | Description |
|---|---|
Content-Type | application/json |
X-Paratro-Timestamp | Unix timestamp (seconds) |
X-Paratro-Signature | v1= + hex-encoded HMAC-SHA256 signature |
X-Paratro-Api-Key | Client API Key |
| Field | Type | Description |
|---|---|---|
event_id | string | Unique UUID for this webhook event |
event_type | string | Event type (see Event Types table) |
event_time | string | ISO 8601 timestamp when webhook was sent |
source_id | string | Source identifier — transaction ID (tx_id) for transaction events, settlement ID for x402 events |
wallet_id | string | Wallet UUID (empty for x402 settlement events) |
account_id | string | Account UUID (empty for x402 settlement events) |
status | string | CONFIRMING, CONFIRMED, FAILED, or SETTLED |
transaction_type | string | INBOUND or OUTBOUND |
chain | string | Blockchain (ethereum, bsc, polygon, base, tron, solana, bitcoin) |
network | string | Network environment: testnet or mainnet |
txhash | string | On-chain transaction hash |
block_number | number | Block height |
from | string | Sender address |
to | string | Recipient address |
symbol | string | Token symbol (e.g., ETH, USDC) |
contract_address | string | Token contract address (empty for native tokens) |
amount | string | Amount in smallest unit (e.g., "20000000" for 20 USDC) |
decimals | number | Token decimal places |
confirmations | number | Current confirmation count |
required_confirmations | number | Required confirmations for this chain |
created_at | string | ISO 8601 transaction creation time |
confirmed_at | string | ISO 8601 confirmation time (empty string if not yet confirmed) |
risk_checked | boolean | Whether compliance scanning was performed |
risk_score | number | Risk score (0 if not scanned) |
risk_level | string | LOW, MEDIUM, HIGH, or UNSCANNED |
data | string | Hex-encoded EVM transaction calldata. Only populated for EVM chains (Ethereum, BSC, Polygon, Base). Always empty for Solana, Bitcoin, and Tron (these chains have different data models — use txhash to fetch full tx details from chain RPC if needed). |
Example Payloads
Transaction Lifecycle
Transaction Detected
The system detects the transaction in a newly mined block. A
transaction.confirming webhook is sent immediately — the transaction is now visible in your dashboard.Awaiting Confirmations
The system monitors the blockchain until the required number of confirmations is reached. No additional webhooks during this phase.
Signature Verification
All webhook requests include an HMAC-SHA256 signature following the Stripe-style signing scheme.Algorithm
- Build canonical string:
{timestamp}.{raw_request_body} - Compute:
"v1=" + hex(HMAC-SHA256(webhook_secret, canonical_string)) - Compare with
X-Paratro-Signatureheader using constant-time comparison
Go Verification Code
Response Requirements
Return HTTP 200 to acknowledge receipt:Retry Policy
Failed deliveries are retried with exponential backoff:| Attempt | Delay |
|---|---|
| 1 | Immediate |
| 2 | 25 seconds |
| 3 | 125 seconds (~2 min) |
| 4 | 625 seconds (~10 min) |
Best Practices
- Idempotency — Use
source_id+event_typeas a unique identifier to prevent duplicate processing - Handle both events — Process
transaction.confirmingfor UI updates,transaction.confirmedfor balance crediting - Async processing — Return 200 immediately, process in the background
- HTTPS — Always use HTTPS for your webhook URL
- Secret protection — Store
WebhookSecretsecurely, never in source code - Signature verification — Always verify signatures before processing
- Timestamp validation — Validate timestamps to prevent replay attacks (default: 5 minute window)
Security Guarantees
| Threat | Mitigation |
|---|---|
| Body tampering | HMAC-SHA256 integrity verification |
| Signature forgery | Requires webhook secret |
| Replay attack | Timestamp window validation |
| Timing attack | Constant-time comparison (hmac.Equal) |