ShipStation Webhooks
ShipStation sends two event types to the middleware. These webhooks feed the Shipping Dashboard and maintain the local shipping data store.
Endpoints
| Event | Endpoint |
|---|---|
ORDER_NOTIFY | POST /api/webhooks/shipstation/order-notify |
SHIP_NOTIFY | POST /api/webhooks/shipstation/ship-notify |
ORDER_NOTIFY
Fired when an order is created or modified in ShipStation.
Payload
{
"resource_url": "https://ssapi.shipstation.com/orders?...",
"resource_type": "ORDERS"
}
Processing Flow
- Validate
resource_urlandresource_typeare present. - Call
ShipStationService::fetchFromUrl($resourceUrl)— makes an authenticated GET request to ShipStation's REST API. - Iterate the
ordersarray in the response. - For each order, call
ShipStationOrder::updateOrCreate(['order_id' => ...], [...]). - Delete existing items for the order, then insert fresh
ShipStationOrderItemrecords.
SHIP_NOTIFY
Fired when a shipment is created for an order.
Payload
{
"resource_url": "https://ssapi.shipstation.com/shipments?...",
"resource_type": "SHIP_NOTIFY"
}
Processing Flow
- Validate payload.
- Fetch full shipment detail from
resource_url. - Upsert
ShipStationShipmentrecords including tracking number, carrier, and ship date.
Authentication
ShipStation does not sign its webhook payloads with HMAC. The middleware relies on the secrecy of the endpoint URL. If extra security is needed, restrict access to ShipStation's IP range at the infrastructure/firewall level.
Data Stored
After processing ORDER_NOTIFY, the following tables are populated:
shipstation_orders— one row per ordershipstation_order_items— one row per line item
After processing SHIP_NOTIFY:
shipstation_shipments— one row per shipment
Key Files
| File | Description |
|---|---|
app/Http/Controllers/ShipStationWebhookController.php | Webhook handler |
app/Services/ShipStationService.php | REST API client (reads from ShipStation) |
app/Models/ShipStationOrder.php | Order model |
app/Models/ShipStationOrderItem.php | Order item model |
app/Models/ShipStationShipment.php | Shipment model |