Callback Events (Webhooks)
Receive real-time notifications from MasonHub via webhook callbacks
Callback events (webhooks) provide real-time notifications when specific events occur in MasonHub. This approach delivers immediate updates to your ERP system without the need for continuous polling.
Overview
Webhooks allow MasonHub to automatically call your endpoints when important events happen, such as order status changes, shipment updates, or inventory modifications.
Advantages
- Real-time notifications
- Reduced API call volume
- Immediate event processing
- Lower latency for critical updates
Considerations
- Requires publicly accessible endpoints
- Need proper security implementation
- Must handle retry logic
- Firewall configuration may be needed
Supported Callback Events
Order Events
Inbound Shipment Events
Webhook Setup Process
1. Endpoint Development
Create secure endpoints in your system to receive webhook calls:
2. Webhook Registration
Register your webhook endpoints with MasonHub:
Contact Integration Team
Provide your webhook URLs to the MasonHub integration team
Specify Event Types
Define which events you want to receive notifications for
Configure Authentication
Set up webhook signature verification secrets
Test Configuration
Validate webhook delivery in sandbox environment
Security Implementation
Webhook Authentication
Always verify webhook authenticity to prevent unauthorized access to your systems.
Signature Verification
MasonHub signs webhooks using HMAC-SHA256:
IP Allowlisting
Consider restricting webhook access to MasonHub IP addresses:
Event Processing Patterns
Idempotent Processing
Handle duplicate webhook deliveries gracefully:
Error Handling & Retries
Asynchronous Processing
For complex processing, consider queuing webhook events:
Event Types & Use Cases
Order Events
Event: order.fulfilled
Use Case: Update ERP with shipment details
Action:
- Update order status
- Record tracking numbers
- Trigger customer notifications
Inventory Events
Event: inventory.updated
Use Case: Real-time inventory sync
Action:
- Update available quantities
- Trigger reorder alerts
- Update product availability
Monitoring & Troubleshooting
Webhook Health Monitoring
Delivery Metrics
- Successful deliveries
- Failed deliveries
- Average response times
- Retry rates
Processing Metrics
- Events processed
- Processing errors
- Queue depths
- Duplicate events
Common Issues & Solutions
Testing Webhooks
Sandbox Testing
Setup Test Endpoints
Configure webhook endpoints in your development environment
Register with MasonHub
Provide test webhook URLs to integration team
Trigger Test Events
Create test orders and shipments to generate webhook events
Validate Processing
Confirm events are received and processed correctly
Testing Tools
Use tools to test webhook handling:
Round-Trip Validation
Critical Requirement: Ensure tracking numbers and shipment information successfully flow back to your source system through webhook processing.
Validation Checklist
- Webhook endpoint receives events
- Signature verification works
- Events are processed correctly
- ERP system is updated
- Customer notifications are triggered
- Error handling works properly
Complete Documentation
Callback Events Documentation
Comprehensive documentation for setup instructions and payload samples
Next Steps
Consider implementing a hybrid approach using both polling for bulk data and webhooks for real-time critical updates.