Webhooks
Overview
Receive real-time notifications about events in your Bebas Kirim account. Webhooks allow you to automatically trigger actions in your system when specific events occur, such as order updates, shipment status changes, or inventory alerts.
Authentication
All webhooks send by a Authorization key in the header, where the value is can be accessed in the Partner Dashboard.
Authorization: YOUR_WEBHOOK_SECRET_KEYWebhook Payload Structure
All webhook events follow a consistent payload structure:
json
{
"event": "order.to_process",
"timestamp": "2024-01-20T15:30:00Z",
"tenant_id": "TEN-2024-001",
"data": {
"order_id": "ORD-2024-001",
"order_number": "BBS-2024-0001",
"status": "to_process",
"updated_at": "2024-01-20T15:30:00Z"
}
}Available Webhooks
1. Item Events
| Event | Description |
|---|---|
item.created | New item created |
item.published | item published |
item.archived | Product details archived |
Example Payload
json
{
"event": "item.created",
"timestamp": "2024-01-20T15:30:00Z",
"tenant_id": "TEN-2024-001",
"data": {
"item_id": "ITEM-2024-001",
"sku": "ABC-001",
"name": "Apple",
"description": "Delicious fruit",
"category": "Fruit",
"subcategory": "Apple",
"brand": "Apple",
"base_price": 10000,
"publish_price": 20000,
"weight": 0,
"dimensions": {
"length": 0,
"width": 0,
"height": 0,
"unit": "cm"
},
"featured_image_url": "https://cdn.bebaskirim.com/products/ITEM-2024-001/main.jpg",
"status": "draft",
"created_at": "2024-01-20T15:30:00Z",
"updated_at": "2024-01-20T15:30:00Z"
}
}2. Purchase Events
| Event | Description |
|---|---|
purchase.created | New purchase order created |
purchase.approved | Purchase order approved |
purchase.rejected | Purchase order rejected |
purchase.completed | Purchase order completed |
Example Payload
json
{
"event": "purchase.created",
"timestamp": "2024-01-20T15:30:00Z",
"tenant_id": "TEN-2024-001",
"data": {
"purchase_id": "PUR-2024-001",
"purchase_number": "PO-2024-001",
"status": "pending",
"expected_delivery": "2024-01-20T15:30:00Z",
"subtotal": 100000,
"total_discount": 0,
"total_amount": 100000,
"notes": "Please deliver to reception",
"items": [
{
"item_id": "ITEM-2024-001",
"quantity": 100,
"unit_price": 10000,
"discount_percent": 0,
"discount_amount": 0,
"total_price": 100000,
"notes": "Delicious fruit"
}
],
"created_at": "2024-01-20T15:30:00Z",
"updated_at": "2024-01-20T15:30:00Z"
}
}3. Inbound Events
| Event | Description |
|---|---|
inbound.created | New inbound shipment created |
inbound.received | Items received |
inbound.completed | Inbound shipment completed |
Example Payload
json
{
"event": "inbound.created",
"timestamp": "2024-01-20T15:30:00Z",
"tenant_id": "TEN-2024-001",
"data": {
"inbound_id": "INB-2024-001",
"reference_number": "PO-2024-001",
"status": "pending",
"location": {
"id": "WH-001",
"code": "WH-001",
"name": "Jakarta Warehouse"
},
"expected_arrival": "2024-01-20T15:30:00Z",
"actual_arrival": "2024-01-20T15:30:00Z",
"items": [
{
"id": "ITEM-2024-001",
"sku": "ABC-001",
"name": "Apple",
"quantity": 100,
"unit": "pcs",
"unit_price": 10000,
"expected_quantity": 100,
"good_received_quantity": 100,
"damaged_received_quantity": 0,
"grid_id": "grid_123",
"received_at": "2024-01-20T15:30:00Z",
"received_by": "warehouse_staff"
}
],
"notes": "Handle with care",
"created_at": "2024-01-20T15:30:00Z",
"updated_at": "2024-01-20T15:30:00Z"
}
}4. Transfer Events
| Event | Description |
|---|---|
transfer.created | New transfer request created |
transfer.approved | Transfer request approved |
transfer.rejected | Transfer request rejected |
transfer.completed | Transfer request completed |
Example Payload
json
{
"event": "transfer.created",
"timestamp": "2024-01-20T15:30:00Z",
"tenant_id": "TEN-2024-001",
"data": {
"transfer_id": "TRF-2024-001",
"transfer_number": "TRF-2024-001",
"status": "pending",
"from_location": {
"id": "WH-001",
"code": "WH-001",
"name": "Jakarta Warehouse"
},
"to_location": {
"id": "WH-002",
"code": "WH-002",
"name": "Surabaya Warehouse"
},
"expected_arrival": "2024-01-20T15:30:00Z",
"actual_arrival": "2024-01-20T15:30:00Z",
"items": [
{
"id": "ITEM-2024-001",
"sku": "ABC-001",
"name": "Apple",
"quantity": 100,
"unit": "pcs",
"unit_price": 10000,
"expected_quantity": 100,
"good_received_quantity": 100,
"damaged_received_quantity": 0,
"grid_id": "grid_123",
"received_at": "2024-01-20T15:30:00Z",
"received_by": "warehouse_staff"
}
],
"notes": "Handle with care",
"created_at": "2024-01-20T15:30:00Z",
"updated_at": "2024-01-20T15:30:00Z"
}
}5. Adjustment Events
| Event | Description |
|---|---|
adjustment.created | New adjustment created |
adjustment.approved | Adjustment approved |
adjustment.rejected | Adjustment rejected |
adjustment.completed | Adjustment completed |
Example Payload
json
{
"event": "adjustment.created",
"timestamp": "2024-01-20T15:30:00Z",
"tenant_id": "TEN-2024-001",
"data": {
"adjustment_id": "ADJ-2024-001",
"adjustment_number": "ADJ-2024-001",
"location": {
"id": "WH-001",
"code": "WH-001",
"name": "Jakarta Warehouse"
},
"type": "increase",
"stock_source": "good",
"reason": "Stock correction",
"status": "pending",
"total_amount": 500000,
"item_count": 1,
"items": [
{
"id": "ITEM-2024-001",
"sku": "ABC-001",
"name": "Apple",
"quantity": 10,
"unit_cost": 50000,
"total_cost": 500000,
"notes": "Additional stock found"
}
],
"created_at": "2024-01-20T15:30:00Z",
"updated_at": "2024-01-20T15:30:00Z"
}
}6. Outbound Events
| Event | Description |
|---|---|
outbound.created | New outbound shipment created |
outbound.completed | Outbound shipment completed |
Example Payload
json
{
"event": "outbound.created",
"timestamp": "2024-01-20T15:30:00Z",
"tenant_id": "TEN-2024-001",
"data": {
"outbound_id": "OUT-2024-001",
"transfer_id": "TRF-2024-001",
"reference_number": "TRF-OUT-2024-001",
"status": "shipped",
"source_warehouse": {
"id": "WH-001",
"code": "WH-001",
"name": "Jakarta Warehouse"
},
"destination_warehouse": {
"id": "WH-002",
"code": "WH-002",
"name": "Surabaya Warehouse"
},
"expected_departure": "2024-01-20T15:30:00Z",
"actual_departure": "2024-01-20T15:30:00Z",
"expected_arrival": "2024-01-20T15:30:00Z",
"actual_arrival": "2024-01-20T15:30:00Z",
"items": [
{
"id": "ITEM-2024-001",
"sku": "ABC-001",
"name": "Apple",
"quantity": 50,
"unit": "pcs",
"unit_price": 50000,
"shipped_quantity": 50,
"received_quantity": 50,
"pending_quantity": 0
}
],
"courier": "JNE",
"tracking_number": "TRK987654321",
"priority": "normal",
"notes": "Transfer for restocking",
"created_at": "2024-01-20T15:30:00Z",
"updated_at": "2024-01-20T15:30:00Z"
}
}7. Order Events
| Event | Description |
|---|---|
order.draft | New order draft |
order.to_process | New order created |
order.in_process | Order in process |
order.packed | Order packed |
order.ready_for_pickup | Order ready for pickup |
order.pending_waybill | Order ready for pickup |
order.shipped | Order ready for pickup |
order.refunded | Order refunded |
order.returned | Order returned |
order.completed | Order completed |
order_cancel_partial | Partial order cancellation - some items cancelled |
Example Payload
Standard Order Event
json
{
"event": "order.to_process",
"timestamp": "2024-01-20T15:30:00Z",
"tenant_id": "TEN-2024-001",
"data": {
"order_id": "ORD-2024-001",
"order_number": "BBS-2024-0001",
"status": "to_process",
"updated_at": "2024-01-20T15:30:00Z"
}
}Partial Cancellation Event
json
{
"event": "order_cancel_partial",
"timestamp": "2024-01-20T15:30:00Z",
"tenant_id": "TEN-2024-001",
"data": {
"order_id": "ORD-2024-001",
"order_number": "BBS-2024-0001",
"status": "partial_cancelled",
"cancelled_items": [
{
"sku": "ABC-001",
"product_name": "Product A",
"quantity": 1,
"price": 50000
}
],
"remaining_items": [
{
"sku": "ABC-002",
"product_name": "Product B",
"quantity": 2,
"price": 75000
}
],
"updated_at": "2024-01-20T15:30:00Z"
}
}Note: When order_cancel_partial event is received, Plugin Ethix will automatically create a new order with remaining items and maintain the same invoice number structure.
8. Awb Events
| Event | Description |
|---|---|
awb.generated | Awb generated |
awb.changed | Awb changed |
Example Payload
json
{
"event": "awb.generated",
"timestamp": "2024-01-20T15:30:00Z",
"tenant_id": "TEN-2024-001",
"data": {
"order_id": "ORD-2024-001",
"order_number": "BBS-2024-0001",
"awb_number": "AWB-2024-001",
"status": "generated",
"logistic_provider": "JNE",
"logistic_service": "REG",
"updated_at": "2024-01-20T15:30:00Z"
}
}Retry Policy
Webhooks follow an exponential backoff retry policy:
| Attempt | Delay |
|---|---|
| 1 | Immediate |
| 2 | 5 seconds |
| 3 | 10 seconds |
| 4 | 30 seconds |
| 5 | 1 minute |
| 6 | 5 minutes |
| 7 | 10 minutes |
| 8+ | 30 minutes |
Webhooks will retry up to 15 times over 24 hours before being marked as failed.