Webhooks Guide
Learn how to set up and use webhooks to receive real-time notifications from Shipsidekick
Webhooks Guide
Shipsidekick uses webhooks to notify your applications when events happen in your account. Webhooks are particularly useful for tracking shipments, monitoring order updates, and handling billing adjustments.
Understanding Webhooks
Webhooks are HTTP callbacks (or push notifications) that keep your applications up-to-date on the status of Shipsidekick objects in real-time.
- Eliminate polling: Webhooks eliminate the need to continuously poll our API for updates
- Real-time updates: When triggered, each webhook sends an Event via HTTP
POSTrequest to your configured webhook URL - Reliable delivery: A successful
2XXresponse is expected from each webhook; in the event of a failure, Shipsidekick retries the webhook - Multiple formats: Support for both Shipsidekick native format and EasyPost-compatible format
Prerequisites
- An active Shipsidekick account
- A publicly accessible HTTPS endpoint to receive webhooks
- Application readiness to handle and process webhook events
- Use HMAC validation or basic authentication with HTTPS to secure the webhook endpoint
Webhook Authentication
Securing webhook endpoints is crucial to ensure data integrity and authenticity. Shipsidekick supports two primary methods for securing webhooks:
HMAC Validation (Recommended)
HMAC validation ensures webhook data is untampered during transmission. When creating a webhook endpoint, include a secret value. Shipsidekick generates an HMAC-SHA256 signature using this secret and sends it via the X-SSK-Signature header in each event.
To validate the webhook:
- Extract the signature from the
X-SSK-Signatureheader - Generate your own HMAC-SHA256 signature using your secret and the raw request body
- Compare the signatures using a constant-time comparison function
- If they match, the webhook is valid; otherwise, reject the event
Basic Authentication
Basic authentication requires embedding a username and password in the webhook URL:
Shipsidekick will include an Authorization header with the credentials. Validate these credentials against your stored values before processing the webhook.
Event Types and Headers
Shipsidekick adds an X-SSK-Webhook-Event-Type header to all webhook requests, allowing you to quickly identify the event type without parsing the entire payload.
Common event types include:
tracker.created- A new tracking number has been addedtracker.updated- Tracking status has changedshipment.invoice.created- A billing adjustment has been createdorder.updated- Order status has changed
Response Requirements
Response Time
Webhooks require a response within 10 seconds. If no response is received, Shipsidekick will automatically retry the webhook.
Recommendation: Process the event in a background worker and immediately return a 2XX status code to avoid duplicate notifications.
Expected Status Codes
- Return any
2XXstatus code to indicate successful receipt 200 OKor202 Acceptedare preferred- Any non-2XX response will trigger a retry
Retry Logic
Shipsidekick will retry failed webhook deliveries with exponential backoff:
- Maximum retries: 6 attempts
- Timeout: 10 seconds per attempt
- Backoff: Increasing delay between retries
Webhook Event Structure
All webhook events follow this structure:
Event Properties
description: The event type that triggered this webhookmode: Either "production" or "test"previous_attributes: Object containing the previous values of any changed fieldspending_urls: URLs that haven't received the webhook yetcompleted_urls: URLs that have successfully received the webhookresult: The object that triggered the event (e.g., Tracker, Order, etc.)
Security Best Practices
HTTPS Required
All webhook endpoints must use HTTPS with valid TLS certificates from trusted certificate authorities.
Validate Signatures
Always validate webhook signatures using HMAC verification to ensure data integrity.
Sensitive Data
Webhook payloads may contain sensitive information. Ensure your endpoint:
- Uses HTTPS encryption
- Validates the signature before processing
- Logs webhook data securely
- Follows your organization's data protection policies
Testing Webhooks
Test Environment
Webhooks in the test environment behave identically to production webhooks, making it easy to develop and test your integration.
Local Development
For local testing, you can use tools like:
- ngrok to expose your local server
- Webhook.site to inspect webhook payloads
- RequestBin for debugging
Example Test Endpoint
Common Event Examples
Tracker Updated Event
Troubleshooting
Common Issues
Webhook not received:
- Verify your endpoint is publicly accessible via HTTPS
- Check that your endpoint returns a 2XX status code within 10 seconds
- Ensure your firewall allows incoming connections
Signature validation failing:
- Verify you're using the correct secret
- Ensure you're using the raw request body (not parsed JSON)
- Use HMAC-SHA256 for signature generation
Duplicate events:
- Webhooks may be retried if your endpoint doesn't respond quickly enough
- Implement idempotency by tracking processed event IDs
- Return a 2XX status code immediately, then process asynchronously
FAQs
Q: How many webhook endpoints can I configure?
A: You can configure up to 30 webhook endpoints per organization.
Q: What happens if my endpoint is down?
A: Shipsidekick will retry the webhook up to 6 times with exponential backoff.
Q: Can I receive webhooks for events I didn't create?
A: Yes, if you have appropriate permissions for the organization, you'll receive webhooks for all relevant events.
Q: How long are webhook events stored?
A: Webhook events are stored for 30 days and can be retrieved via the API if needed.
Next Steps
- Set up adjustment webhooks for billing notifications
- Review our API documentation for webhook endpoint management