# Webhook

Eshopbox observes several events that you can attach webhooks to. With a webhook,  you can attach custom code that performs actions outside of the Eshopbox ecosystem.

You may want to send a survey email after an order is fulfilled. You can do this via a webhook that sends event data to your custom function.

## Event Object

{% tabs %}
{% tab title="Attributes" %}

| Attribute           | Type     | Description                                                                                            |
| ------------------- | -------- | ------------------------------------------------------------------------------------------------------ |
| `id`                | `string` | Unique identifier for the registered events.                                                           |
| `resource`          | `string` | The resources affected by this event. Refer here for resource types available.                         |
| `eventType`         | `string` | <p>It describes the CRUD format of event .</p><p>Example: <code>POST</code> ,<code>PUT</code> etc.</p> |
| `eventSubType`      | `string` | This defines the event verb specifically for an event Type.                                            |
| `version`           | `string` | It is used for versioning the Events.                                                                  |
| `externalChannelID` | `string` | The channel which has registered for the webhook                                                       |
| `webhookUrl`        | `number` | The url of the API outside Eshopbox domain which is supposed to be triggered                           |
| `webhookMethod`     | `object` | The Rest API signature required to create a request .Example- `GET` ,`PUT` , `POST` , `DELETE`         |
| {% endtab %}        |          |                                                                                                        |

{% tab title="Sample Json" %}

```
{
    "id":"1",
    "resource": "channel_inventory",
    "eventType": "POST",
    "eventSubType": "updated",
    "version": "v1",
    "externalChannelID" : "TATA CLIQ VELOCY KAPAS KRAFT",
    "webhookUrl": "https://hooks.zapier.com/fake-subscription-url",
    "webhookMethod": "POST"
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://eshop.gitbook.io/eshopbox-developers/advanced/events-webhook.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
