Skip to content
MothershipDevelopers

GuidesConfiguring webhooks

Creating a webhook configuration

Subscribe an endpoint on your server to shipment and document events.

1 min read

Organizations can subscribe to any of the events listed below via the Create a webhook configuration endpoint, or on the Webhooks settings page in the dashboard.

A subscription to the shipment.purchased and billOfLading.created events can be set with the following request.

curl --request POST \
  --url https://api.mothership.com/beta/webhookConfigs \
  --header "Authorization: Bearer $MOTHERSHIP_API_TOKEN" \
  --header 'Content-Type: application/json' \
  --data '{
  "webhookUrl": "https://www.yourserver.com/webhook/mothership",
  "subscribedEvents": ["shipment.purchased", "billOfLading.created"]
}'

Store the secretKey. You need it to validate webhook payloads.

The webhookUrl must be an https URL on a domain name. Mothership doesn't send webhooks to http URLs, IP addresses or localhost.

Webhook event typeSent when
billOfLading.createdA bill of lading is first attached to a shipment.
billOfLading.updatedA new version of a bill of lading is attached.
proofOfDelivery.createdA proof of delivery is first attached.
proofOfDelivery.updatedA new version of a proof of delivery is attached.
deliveryReceipt.createdA delivery receipt is first attached.
deliveryReceipt.updatedA new version of a delivery receipt is attached.
certificateOfInsurance.createdA certificate of insurance is attached.
shipment.purchasedA shipment is booked.
shipment.status.updatedA shipment's status changes.