# Webhook

### Introduction

<details>

<summary> Identitypass Webhook</summary>

We trigger an event when certain actions are performed, this event sends a structured payload to your configured webhook URL.

</details>

<details>

<summary>Setup Webhook</summary>

Setting up your company wehbook can be achieved using the following steps.

* Login to the [portal](https://dashboard.myidentitypass.com)&#x20;
* Navigate to **Settings** from the sidebar
* Click on the **Merchant Profile** tab
* Edit the **Webhook URL** input with your reachable webhook endpoint.
* **Save** your update
* *You are good to go*:thumbsup:

</details>

<details>

<summary>Authorisation and Security</summary>

Every webhook event sent to your URL contains two headers.

* ***x-identitypass-signature*** \
  This is a base64 encoding of your public key
* ***token***\
  This is a unique verification reference generated by Identitpass

**Note**: these two headers can be used to verify that the data coming to the endpoint are from our system and we also recommend you verify the host of every request and make sure it is coming from our **API BASE URL.**<br>

</details>

{% hint style="info" %}
Please make sure to return a **status code** of **200** for every webhook event sent to your endpoint to prevent us from trying to process the event again.
{% endhint %}

### Events

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

```json
{
  "source":"PORTAL",
  "data":{
      "status":True, // True or False
      "response_code":"00",
      ... 
      ...
    
      // other data structures (same as API responses)
   }
}
```

{% endtab %}

{% tab title="CHECKOUT" %}

```json
{
  "source":"CHECKOUT",
  "user_info": {
        "date": "",
        "first_name": "",
        "last_name": "",
        "email": "",
        "user_ref": ""
   },
  "data":{
      "status":True, // True or False
      "response_code":"00",
      ... 
      ...
    
      // other data structures (same as API responses)
   }
}
```

{% endtab %}
{% endtabs %}
