Skip to main content

ShipStation Webhooks

ShipStation sends two event types to the middleware. These webhooks feed the Shipping Dashboard and maintain the local shipping data store.


Endpoints

EventEndpoint
ORDER_NOTIFYPOST /api/webhooks/shipstation/order-notify
SHIP_NOTIFYPOST /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

  1. Validate resource_url and resource_type are present.
  2. Call ShipStationService::fetchFromUrl($resourceUrl) — makes an authenticated GET request to ShipStation's REST API.
  3. Iterate the orders array in the response.
  4. For each order, call ShipStationOrder::updateOrCreate(['order_id' => ...], [...]).
  5. Delete existing items for the order, then insert fresh ShipStationOrderItem records.

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

  1. Validate payload.
  2. Fetch full shipment detail from resource_url.
  3. Upsert ShipStationShipment records 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 order
  • shipstation_order_items — one row per line item

After processing SHIP_NOTIFY:

  • shipstation_shipments — one row per shipment

Key Files

FileDescription
app/Http/Controllers/ShipStationWebhookController.phpWebhook handler
app/Services/ShipStationService.phpREST API client (reads from ShipStation)
app/Models/ShipStationOrder.phpOrder model
app/Models/ShipStationOrderItem.phpOrder item model
app/Models/ShipStationShipment.phpShipment model