Skip to content

Webhooks

Webhooks allow ShipEdge to automatically send notifications to your external systems when specific events occur, such as when an order is shipped, inventory is corrected, or a replenishment is received. This enables real-time integration without polling the API.

Real-Time Updates

Receive instant notifications when events occur instead of checking the API repeatedly.

Automate Workflows

Trigger actions in your systems automatically when orders ship, inventory changes, or replenishments arrive.

Reduce API Calls

Eliminate the need to poll the API constantly. Webhooks push data to you only when events happen.

Stay Synchronized

Keep your external systems synchronized with ShipEdge automatically, reducing manual work and errors.


  1. Configure Webhook: Set up a webhook URL and select which events to monitor
  2. Event Occurs: When the selected event happens (e.g., order ships), ShipEdge prepares the data
  3. HTTP POST: ShipEdge sends an HTTP POST request to your webhook URL with event data
  4. Your System Responds: Your server receives the data and processes it (update database, send email, etc.)
  5. Confirmation: Your server responds with HTTP 200 to confirm receipt

  1. Log in to your ShipEdge OMS account

    Access your Order Management System account through the web interface.

  2. Navigate to Preferences

    Go to My Account > Preferences in the main menu.

  3. Open Webhooks tab

    Click on the Webhooks tab in Preferences.

  4. Configure webhooks

    You’ll see options to:

    • Add new webhooks
    • View existing webhooks
    • View webhook logs
    • Resend failed webhooks

WMS webhooks are configured separately and are available for warehouse-specific events.


Order Status Changes:

  • Order any status change - Triggers on any order status change (configurable)
  • Order pending - When order enters pending status
  • Order processing - When order moves to processing status
  • Order shipped - When order is shipped
  • Order canceled - When order is canceled
  • Order backorder - When order becomes backordered
  • Order divided - When order is divided into multiple shipments
  • Order updated by OMS - When order is updated through OMS

Order Shipping Methods:

  • Order shipped with shipping method - Filtered by specific shipping method
  • Order shipped by store - Filtered by store/channel
  • Order shipped by order type - Filtered by order type

Order Fulfillment Types:

  • Order shipped by Amazon FBA - When fulfilled by Amazon FBA
  • Order shipped by Amazon MCF - When fulfilled by Amazon MCF
  • Order shipped by dropshipper - When fulfilled by dropshipper
  • Order shipped by Shipedge - When fulfilled by ShipEdge warehouse
  • Order shipped by WFS - When fulfilled by WFS

Order Actions:

  • Order shipped items - When specific items are shipped
  • Order pending items - When specific items are pending
  • Order dropship cancel - When dropship order is canceled
  • Order refund - When order is refunded
  • Order sent by Amazon FBA - When sent to Amazon FBA
  • Order sent by Amazon MCF - When sent to Amazon MCF
  • Order sent to Shipedge - When sent to ShipEdge warehouse
  • Inventory corrections - When inventory is adjusted or corrected
  • Inventory mirror - Real-time inventory synchronization (special feature)
  • Replenishment initiated - When a replenishment request is created
  • Replenishment received - When replenishment inventory is received
  • Simple return order initiated - When a return order is created
  • Simple return order received - When a return order is received
  • Exchange now order initiated - When an exchange order is created
  • Exchange now order received - When an exchange order is received
  • Exchange on received order initiated - When exchange is initiated after receiving return
  • Exchange on received order received - When exchange order is received
  • Unexpected Return Order Received - When an unexpected return arrives

Most webhook events support multiple versions (v1, v2, v3) with different data formats:

  • v1 - Original format (legacy)
  • v2 - Enhanced format with more data fields (recommended)
  • v3 - Latest format (available for some events like orders/shipped)

  1. Go to Webhooks Configuration

    Navigate to My Account > Preferences > Webhooks.

  2. Click Add New Webhook

    Or edit an existing webhook if updating.

  3. Select Event

    Choose the event you want to monitor from the dropdown (e.g., “Order shipped”).

  4. Select Version

    Choose the version format (v1, v2, or v3 if available). Use v2 or v3 for best results.

  5. Enter Webhook URL

    Provide the full URL where ShipEdge should send notifications (e.g., https://your-server.com/webhooks/order-shipped).

  6. Configure Status

    Set webhook status to Active to enable it, or Inactive to disable temporarily.

  7. Add Custom Headers (Optional)

    Add custom HTTP headers if your server requires authentication or special headers.

  8. Configure Authentication (Optional)

    Select an authentication method if your server requires authentication.

  9. Configure Certificate (Optional)

    Enable certificate identification if your server requires SSL client certificates.

  10. Save Webhook

    Click Save to create the webhook. It will start working immediately if status is Active.

Required Fields:

  • Event - The event to monitor
  • Version - Data format version (v1, v2, or v3)
  • Address - Webhook URL endpoint
  • Status - Active or Inactive

Optional Fields:

  • Custom Headers - Additional HTTP headers (e.g., Authorization: Bearer token)
  • Authentication - Pre-configured authentication method
  • Certificate Identification - SSL client certificate for secure connections
  • Format - Response format (JSON is standard)

Webhooks send data as JSON in the HTTP POST request body. The exact structure depends on the event type and version.

{
"event": "orders/shipped_v2",
"account_id": 100,
"order_id": 12345,
"order_number": "ORD-001",
"order_reference": "REF-123",
"status": "shipped",
"shipped_date": "2024-01-15 10:30:00",
"tracking_number": "1Z999AA10123456784",
"carrier": "UPS",
"shipping_method": "Ground",
"customer": {
"email": "customer@example.com",
"name": "John Doe",
"address": {
"address1": "123 Main St",
"city": "Los Angeles",
"state": "CA",
"zip": "90001",
"country": "USA"
}
},
"items": [
{
"sku": "PROD-001",
"quantity": 2,
"description": "Product Description"
}
],
"total": 59.98,
"shipping_cost": 5.99
}
{
"event": "inventory/corrections_v2",
"account_id": 100,
"correction_id": 789,
"sku": "PROD-001",
"location": "A-01",
"bin": "BIN-001",
"previous_quantity": 50,
"new_quantity": 45,
"adjustment": -5,
"reason": "Cycle count adjustment",
"user": "warehouse_user",
"timestamp": "2024-01-15 14:20:00"
}

Your webhook endpoint should:

  1. Accept POST Requests: Webhooks are sent via HTTP POST
  2. Parse JSON: Extract data from the JSON request body
  3. Validate Data: Verify the data is valid and from ShipEdge
  4. Process Event: Handle the event appropriately (update database, send notifications, etc.)
  5. Return 200 OK: Respond with HTTP 200 to confirm receipt
webhook_handler.php
<?php
// Get the raw POST data
$payload = file_get_contents('php://input');
$data = json_decode($payload, true);
// Validate the data
if (!$data || !isset($data['event'])) {
http_response_code(400);
exit('Invalid webhook data');
}
// Process based on event type
switch ($data['event']) {
case 'orders/shipped_v2':
// Handle order shipped
$orderId = $data['order_id'];
$orderNumber = $data['order_number'];
$trackingNumber = $data['tracking_number'];
// Update your system
updateOrderStatus($orderId, 'shipped', $trackingNumber);
sendCustomerNotification($orderNumber, $trackingNumber);
break;
case 'inventory/corrections_v2':
// Handle inventory correction
$sku = $data['sku'];
$newQuantity = $data['new_quantity'];
// Update inventory in your system
updateInventory($sku, $newQuantity);
break;
default:
// Unknown event type
error_log("Unknown webhook event: " . $data['event']);
}
// Always return 200 OK
http_response_code(200);
echo 'OK';
?>
webhook_handler.js
const express = require('express');
const app = express();
app.use(express.json());
app.post('/webhooks/order-shipped', (req, res) => {
const data = req.body;
// Validate the data
if (!data.event || !data.order_id) {
return res.status(400).send('Invalid webhook data');
}
// Process the event
if (data.event === 'orders/shipped_v2') {
const { order_id, order_number, tracking_number } = data;
// Update your system
updateOrderStatus(order_id, 'shipped', tracking_number);
sendCustomerNotification(order_number, tracking_number);
}
// Always return 200 OK
res.status(200).send('OK');
});
app.listen(3000, () => {
console.log('Webhook server listening on port 3000');
});

Always use HTTPS URLs for webhooks to encrypt data in transit. ShipEdge will not send webhooks to HTTP endpoints in production.

Use custom headers or authentication methods to verify requests are from ShipEdge:

Option 1: Custom Header

Authorization: Bearer your-secret-token

Option 2: Authentication Configuration Configure authentication in the webhook settings using pre-configured authentication methods.

For enhanced security, enable certificate identification to use SSL client certificates.

If possible, whitelist ShipEdge server IPs on your firewall (contact support for IP ranges).


ShipEdge maintains logs of all webhook attempts. You can view logs to:

  • Monitor Success: See which webhooks were delivered successfully
  • Debug Failures: Identify why webhooks failed (timeout, invalid URL, etc.)
  • Resend Failed Webhooks: Retry webhooks that failed to deliver
  1. Go to My Account > Preferences > Webhooks
  2. Click on Webhook logs tab
  3. View logs filtered by:
    • Date range
    • Event type
    • Status (success/failure)
    • Webhook URL
  1. Go to My Account > Preferences > Webhooks
  2. Click on Resend webhooks tab
  3. Select failed webhooks to resend
  4. Click Resend to retry delivery

Use HTTPS

Always use HTTPS URLs for webhooks to ensure data is encrypted in transit.

Respond Quickly

Process webhooks quickly and return HTTP 200 immediately. ShipEdge times out after 10 seconds.

Handle Duplicates

Implement idempotency to handle duplicate webhook deliveries gracefully.

Validate Data

Always validate webhook data before processing to ensure it’s valid and from ShipEdge.

Use Latest Versions

Use v2 or v3 webhook versions when available for more complete data and better structure.

Monitor Logs

Regularly check webhook logs to ensure successful delivery and identify issues early.

Test Webhooks

Test your webhook endpoint thoroughly before going live to ensure it handles all event types correctly.

Implement Retry Logic

If your server is temporarily unavailable, ShipEdge will retry, but implement your own retry logic for critical events.


Common causes:

  • Webhook status is Inactive
  • Invalid or unreachable URL
  • Server timeout (webhook must respond within 10 seconds)
  • Firewall blocking requests
  • SSL certificate issues

Solution:

  1. Verify webhook status is Active
  2. Test the URL manually (should accept POST requests)
  3. Check webhook logs for error messages
  4. Verify firewall allows ShipEdge server IPs
  5. Ensure SSL certificate is valid if using HTTPS

Common causes:

  • Slow server response
  • Heavy processing in webhook handler
  • Database queries taking too long

Solution:

  1. Return HTTP 200 immediately after receiving webhook
  2. Process data asynchronously (queue for background processing)
  3. Optimize database queries
  4. Use a message queue for heavy processing

Common causes:

  • ShipEdge retrying failed webhooks
  • Network issues causing retries
  • Multiple webhooks configured for same event

Solution:

  1. Implement idempotency using order_id or event_id
  2. Check for duplicate webhook configurations
  3. Use database unique constraints to prevent duplicate processing

Common causes:

  • Using wrong webhook version
  • Expecting different data structure
  • Missing required fields

Solution:

  1. Verify webhook version matches your expectations
  2. Review webhook payload examples for your event type
  3. Handle missing fields gracefully in your code
  4. Update to latest webhook version if available


Next Step: REST API v4 (OMS) - Learn to use OMS endpoints for order and inventory management