Webhooks API

Syncaty receives webhooks from Salla to keep your data synchronized in real-time. This page documents the webhook events and their payloads.

Automatic Configuration

Webhooks are automatically configured when you connect a Salla store. No manual setup required.

Supported Events

EventDescription
order.createdNew order placed in the store
order.updatedOrder details were modified
order.status.updatedOrder status changed
order.cancelledOrder was cancelled
order.refundedOrder was refunded
customer.createdNew customer registered
customer.updatedCustomer profile updated
product.createdNew product added
product.updatedProduct details changed
product.deletedProduct was deleted

Webhook Payload

All webhooks from Salla follow this general structure:

{
  "event": "order.created",
  "merchant": 123456789,
  "created_at": "2024-01-15T10:30:00Z",
  "data": {
    // Event-specific data
  }
}

Order Event Payload

{
  "event": "order.created",
  "merchant": 123456789,
  "created_at": "2024-01-15T10:30:00Z",
  "data": {
    "id": 987654321,
    "reference_id": "ORD-12345",
    "date": {
      "date": "2024-01-15",
      "time": "10:30:00",
      "timezone": "Asia/Riyadh"
    },
    "status": {
      "id": 1,
      "name": "pending",
      "customized": {
        "id": 10,
        "name": "Processing"
      }
    },
    "amounts": {
      "sub_total": 299.99,
      "shipping_cost": 25.00,
      "total": 324.99,
      "currency": "SAR"
    },
    "customer": {
      "id": 111222333,
      "first_name": "Ahmed",
      "last_name": "Mohammed",
      "mobile": "+966501234567",
      "email": "ahmed@example.com"
    },
    "items": [
      {
        "id": 444555666,
        "name": "Product Name",
        "sku": "SKU-001",
        "quantity": 2,
        "price": 149.99,
        "product_id": 777888999
      }
    ]
  }
}

Customer Event Payload

{
  "event": "customer.created",
  "merchant": 123456789,
  "created_at": "2024-01-15T10:30:00Z",
  "data": {
    "id": 111222333,
    "first_name": "Ahmed",
    "last_name": "Mohammed",
    "mobile": "+966501234567",
    "mobile_code": "+966",
    "email": "ahmed@example.com",
    "gender": "male",
    "birthday": "1990-05-15",
    "city": "Riyadh",
    "country": "SA",
    "language": "ar",
    "created_at": "2024-01-15T10:30:00Z"
  }
}

Product Event Payload

{
  "event": "product.updated",
  "merchant": 123456789,
  "created_at": "2024-01-15T10:30:00Z",
  "data": {
    "id": 777888999,
    "name": "Product Name",
    "sku": "SKU-001",
    "price": {
      "amount": 149.99,
      "currency": "SAR"
    },
    "sale_price": null,
    "quantity": 50,
    "status": "active",
    "categories": [
      {
        "id": 123,
        "name": "Electronics"
      }
    ]
  }
}

Processing

When Syncaty receives a webhook:

  1. Validates the webhook signature using HMAC
  2. Creates a job in the processing queue
  3. Updates the relevant data (order, customer, product)
  4. Recalculates customer RFM scores if applicable
  5. Updates analytics and segment memberships

Monitoring

You can monitor webhook processing in the Jobs section of your dashboard:

  • View all incoming webhook events
  • Check processing status (pending, completed, failed)
  • Debug failed webhooks with payload inspection