Event data in webhooks

Webhooks are limited in the data they carry to remain as fast as possible. Webhook data is always contained in the JSON body of a webhook:

  • storeId Ecwid store ID.

  • eventCreated UNIX timestamp when the event happened.

  • eventId Internal ID of the webhook event. Unique for each webhook.

  • eventType Entity and action of the event defining what happened in the store. For example, the order.created event means that a new order was placed in the store.

  • entityId: ID of the affected item, such as order ID, product ID, customer ID, etc. This ID allows you to request additional details about the entity with REST API immediately after receiving a webhook.

  • data object: Additional details available to some events. For example, all order.created and order.updated webhooks always contain order payment and fulfillment statuses in addition to the order ID.

Webhook JSON examples

Order events:

{
  "eventId":"80aece08-40e8-4145-8764-6c2f0d38678",
  "eventCreated":1234567,
  "storeId":1003,
  "entityId":103878161, // internal order ID. Use "orderId" instead
  "eventType":"order.created",
  "data":{
    "orderId":"XJ12H", // ID of created order
    "newPaymentStatus":"PAID",
    "newFulfillmentStatus":"SHIPPED"
  }
}

Abandoned cart events:

{
  "eventId": "95ed494f-362d-4fca-933d-f5c7064b04bb",
  "eventCreated": 1634209655,
  "storeId": 1003,
  "entityId": 293225803, // internal order ID. Use "orderId" instead
  "eventType": "unfinished_order.created",
  "data": {
    "orderId": "RA1SD",
    "cartId": "320AB5DE-5EA6-4419-A4CF-0B04D2913190"
  }
}

Product events:

{
  "eventId":"08a78904-4c1a-0aa0-953a-2e33c56236f1",
  "eventCreated":1469429915,
  "storeId":1003, 
  "entityId":667251253, // this is the id of the created product
  "eventType":"product.created"
}

Category events:

{
  "eventId":"08a78904-0aa0-4c1a-953a-2e33c56236f0",
  "eventCreated":1469429912,
  "storeId":1003, 
  "entityId":66722483, 
  "eventType":"category.created"
}

Product review events:

{
  "eventId": "95ed494f-362d-4fca-933d-f5c7064b04bb",
  "eventCreated": 1634209655,
  "storeId": 1003,
  "entityId": 293225803, //internal review id
  "eventType": "review.created",
  "data":{
    "productId": 62752,
    "orderId": 63254,
    "status":"MODERATED",
  }
}

Customer events:

{
  "eventId": "80aece08-40e8-4145-8764-6c2f0d38678",
  "eventCreated": 7891234567,
  "storeId": 1003,
  "entityId": 1663830, // customer ID
  "eventType": "customer.created",
  "data": {
    "customerEmail":"[email protected]" // customer email
  }
}

Application events (can only be received by the same app):

{
  "eventId":"80aece08-40e8-4145-8764-6c2f0d38678",
  "eventCreated":1234567,
  "storeId":1003,
  "entityId":"1003", // duplicates store ID
  "eventType":"application.installed"
}

Store profile events:

{
  "eventId": "80aece08-40e8-4145-8764-6c2f0d38678",
  "eventCreated": 7891234567,
  "storeId": 1003,
  "entityId": 1003,
  "eventType": "profile.updated"
}

Discount coupon events:

{
  "eventId": "80aece08-40e8-4145-8764-6c2f0d38678",
  "eventCreated": 7891234567,
  "storeId": 1003,
  "entityId": 12345678, // discount coupon ID
  "eventType": "discount_coupon.created",
}

Promotion (advanced discount) events:

{
  "eventId": "95ed494f-362d-4fca-933d-f5c7064b04bb",
  "eventCreated": 1469429915,
  "storeId": 1003, 
  "entityId": 667251253, // Advanced discount ID 
  "eventType": "promotion.created",
  "data": {
    "version": 1 // Internal iterated version for tracking discount changes
  }
}

Invoice events:

{
  "eventId": "08a78904-4c1a-0aa0-953a-2e33c56236f1",
  "eventCreated": 1469429915,
  "storeId": 1003, 
  "entityId": 667251253, // Invoice ID 
  "eventType": "invoice.created",
  "data": {
    "orderId": "GH781" // order ID
  }
}

Last updated

Was this helpful?