Overview
InventPay sends webhook notifications for various events throughout the payment and withdrawal lifecycle. This page documents all available webhook events and their payload structures.Event Categories
Payment Events
6 events covering the complete payment lifecycle
Withdrawal Events
4 events for withdrawal status changes
Account Events
Coming soon: Balance alerts, API key changes
System Events
Test events and system notifications
Payment Events
payment.created
Sent immediately when a new payment or invoice is created. When to expect:- Right after calling
/v1/create_paymentor/v1/create_invoice - Within 1-2 seconds of creation
- Log payment requests in your system
- Send payment link to customer via email/SMS
- Track payment funnel analytics
- Reserve inventory
Full Field Descriptions
Full Field Descriptions
Unique payment identifier
Your custom order ID (if provided)
Payment amount in cryptocurrency
Original amount in base currency
Base currency (USD, USDT, etc.)
Cryptocurrency for payment
Unique payment address
Hosted payment page URL
Always “PENDING” for created events
payment.pending
Sent when payment funds are detected on the blockchain but awaiting confirmations. When to expect:- When customer sends cryptocurrency
- Before required confirmations are reached
- Within seconds of transaction broadcast
- Show “Payment detected” message to customer
- Update order status to “processing”
- Display confirmation progress
- Reduce fraud risk assessment
Full Field Descriptions
Full Field Descriptions
payment.confirmed / payment.completed
Sent when payment receives required blockchain confirmations and is complete. When to expect:- After required confirmations (3-15 blocks)
- BTC: ~30 minutes
- ETH/USDT_ERC20: ~3 minutes
- USDT_BEP20: ~45 seconds
- Fulfill the order (most important)
- Send confirmation email to customer
- Update inventory
- Issue invoice/receipt
- Trigger affiliate commissions
- Update accounting systems
Full Field Descriptions
Full Field Descriptions
payment.underpaid
Sent when customer sends less than the required amount (below 95% of required). When to expect:- When received amount < 95% of required
- Immediately after detection
- Notify customer of shortfall
- Display remaining amount needed
- Send reminder with payment details
- Offer refund option
- Update order to “partially paid” status
Full Field Descriptions
Full Field Descriptions
Customers can send additional funds to the same address to complete the
payment before expiration.
payment.expired
Sent when payment expiration time is reached without receiving the full amount. When to expect:- At payment expiration time
- Default: 30-60 minutes after creation
- Cancel the order
- Release reserved inventory
- Send expiration notification to customer
- Offer to create new payment
- Log abandoned cart for analytics
Full Field Descriptions
Full Field Descriptions
If
wasUnderpaid is true and currentBalance > 0, contact support to discuss
refund or manual completion options.payment.failed
Sent when payment encounters a critical error. When to expect:- Rare: Only during system errors or blockchain issues
- Immediately when error detected
- Log error for investigation
- Notify customer of issue
- Create new payment if needed
- Alert technical team
Full Field Descriptions
Full Field Descriptions
Withdrawal Events
withdrawal.created
Sent when a new withdrawal request is created. Payload:withdrawal.processing
Sent when withdrawal transaction is submitted to the blockchain. Payload:withdrawal.completed
Sent when withdrawal is confirmed on the blockchain. Payload:withdrawal.failed
Sent when withdrawal fails (funds returned to balance). Payload:System Events
payment.test
Test webhook event for verifying your endpoint. Payload:Common Fields
All webhook events include these common fields:| Field | Type | Description |
|---|---|---|
event | string | Event type (e.g., “payment.confirmed”) |
data | object | Event-specific data |
timestamp | string | When webhook was sent (ISO 8601) |
test | boolean | True if test event, false for production |
Event Headers
All webhook requests include these headers:| Header | Description | Example |
|---|---|---|
X-Webhook-Signature | HMAC-SHA256 signature | a1b2c3d4e5f6... |
X-Webhook-Event | Event type | payment.confirmed |
X-Webhook-ID | Unique delivery ID | wh_123abc456def |
X-Webhook-Timestamp | Delivery timestamp | 2024-01-01T12:00:00Z |
Content-Type | Always application/json | application/json |
Event Handling Examples
Basic Event Router
Best Practices
Handle All Relevant Events
Handle All Relevant Events
Implement handlers for all events relevant to your business logic
Use payment.confirmed for Fulfillment
Use payment.confirmed for Fulfillment
Only fulfill orders after receiving
payment.confirmed eventLog All Events
Log All Events
Keep audit trail of all webhook deliveries
Handle Failures Gracefully
Handle Failures Gracefully
Have contingency plans for failed payments
Test All Event Types
Test All Event Types
Ensure your code handles all event types correctly
