Skip to content

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_KEY

Webhook 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

EventDescription
item.createdNew item created
item.publisheditem published
item.archivedProduct 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

EventDescription
purchase.createdNew purchase order created
purchase.approvedPurchase order approved
purchase.rejectedPurchase order rejected
purchase.completedPurchase 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

EventDescription
inbound.createdNew inbound shipment created
inbound.receivedItems received
inbound.completedInbound 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

EventDescription
transfer.createdNew transfer request created
transfer.approvedTransfer request approved
transfer.rejectedTransfer request rejected
transfer.completedTransfer 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

EventDescription
adjustment.createdNew adjustment created
adjustment.approvedAdjustment approved
adjustment.rejectedAdjustment rejected
adjustment.completedAdjustment 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

EventDescription
outbound.createdNew outbound shipment created
outbound.completedOutbound 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

EventDescription
order.draftNew order draft
order.to_processNew order created
order.in_processOrder in process
order.packedOrder packed
order.ready_for_pickupOrder ready for pickup
order.pending_waybillOrder ready for pickup
order.shippedOrder ready for pickup
order.refundedOrder refunded
order.returnedOrder returned
order.completedOrder completed
order_cancel_partialPartial 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

EventDescription
awb.generatedAwb generated
awb.changedAwb 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:

AttemptDelay
1Immediate
25 seconds
310 seconds
430 seconds
51 minute
65 minutes
710 minutes
8+30 minutes

Webhooks will retry up to 15 times over 24 hours before being marked as failed.