5 min read
Parts Webhook Events
Webhook events for inventory parts
Parts Webhook Events
Receive notifications when parts are created, updated, or when stock levels change.
Events
| Event | Description |
|---|---|
part.created |
A new part was added to inventory |
part.updated |
A part's details were modified |
part.deleted |
A part was removed from inventory |
part.stock_updated |
Part stock quantity changed |
part.created
Triggered when a new part is added to the inventory.
Payload
{
"event": "part.created",
"timestamp": "2024-01-15T08:30:00Z",
"data": {
"id": 123,
"company_id": 1,
"part_number": "BRK-PAD-001",
"sku": "SKU-12345",
"name": "Brake Pad Set - Front",
"description": "Premium ceramic brake pads for front axle",
"category": "Brakes",
"brand": "Brembo",
"cost_price": "45.00",
"selling_price": "89.99",
"quantity_in_stock": 50,
"reorder_level": 10,
"unit": "set",
"is_active": true,
"stock_status": "in_stock",
"created_at": "2024-01-15T08:30:00Z",
"updated_at": "2024-01-15T08:30:00Z"
}
}
part.updated
Triggered when a part's details are modified.
Payload
{
"event": "part.updated",
"timestamp": "2024-01-15T10:15:00Z",
"data": {
"id": 123,
"company_id": 1,
"part_number": "BRK-PAD-001",
"sku": "SKU-12345",
"name": "Brake Pad Set - Front",
"description": "Premium ceramic brake pads for front axle",
"category": "Brakes",
"brand": "Brembo",
"cost_price": "48.00",
"selling_price": "94.99",
"quantity_in_stock": 50,
"reorder_level": 10,
"unit": "set",
"is_active": true,
"stock_status": "in_stock",
"created_at": "2024-01-15T08:30:00Z",
"updated_at": "2024-01-15T10:15:00Z"
}
}
part.stock_updated
Triggered when a part's stock quantity changes. Useful for inventory monitoring and low-stock alerts.
Payload
{
"event": "part.stock_updated",
"timestamp": "2024-01-15T14:22:00Z",
"data": {
"id": 123,
"part_number": "BRK-PAD-001",
"sku": "SKU-12345",
"name": "Brake Pad Set - Front",
"previous_quantity": 50,
"new_quantity": 45,
"change": -5,
"stock_status": "in_stock",
"is_low_stock": false
}
}
Stock Status Values
| Status | Description |
|---|---|
in_stock |
Quantity is above reorder level |
low_stock |
Quantity is at or below reorder level |
out_of_stock |
Quantity is zero or negative |
part.deleted
Triggered when a part is removed from inventory.
Payload
{
"event": "part.deleted",
"timestamp": "2024-01-15T16:45:00Z",
"data": {
"id": 123,
"part_number": "BRK-PAD-001",
"sku": "SKU-12345",
"name": "Brake Pad Set - Front"
}
}
Use Cases
Low Stock Alerts
Monitor the part.stock_updated event to trigger alerts when inventory runs low:
if ($payload['data']['is_low_stock']) {
// Send alert to purchasing team
// Trigger reorder workflow
}
Inventory Sync
Use part.created, part.updated, and part.deleted events to keep external inventory systems synchronized.
Audit Trail
Log all part events to maintain a complete audit trail of inventory changes.
Back to Webhooks
Was this helpful?