> ## Documentation Index
> Fetch the complete documentation index at: https://developer-embed.kolomonimfb.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Webhook

> Webhooks are a powerful feature that allows your application to receive real-time notifications about specific events that occur within the Embed platform. By setting up webhooks, you can automate processes, update records, and trigger workflows in your application as soon as an event happens.

## What Are Webhooks?

Webhooks are user-defined HTTP callbacks that are triggered by specific events. When one of those events is triggered, Embed will send an HTTP POST request to the webhook URL you specify. This request contains details about the event, allowing your application to handle the event data in real-time.

> [!NOTE]
>
> Webhooks enable your application to respond to events as they happen, ensuring
> that your system stays up-to-date without the need for constant polling.

### Common Use Cases for Webhooks

> [card] Payment Notifications
>
> Get notified when a payment is successful or fails, and update your records
> accordingly.

> [card] Wallet Updates
>
> Receive updates when a wallet is updated, or deleted.

> [card] Transaction Events
>
> Monitor transactions in real-time, enabling immediate action or analysis.

> [card] Collection Events
>
> Get notified when a wallet is credited, enabling you to provide service
> seamlessly.

## Setting Up Webhooks on Embed Dashboard

To start using webhooks, you need to configure them through the Embed Dashboard. Follow the steps below to set up your webhooks:

**1. Log in to the Embed Dashboard**

Begin by logging in to your Embed dashboard.

**2. Navigate to the Webhooks Section**

Once logged in, navigate to the APIs & Integration page

**3. Configre Your Webhook**

<ul>
  <li>
    **Click on "Edit":** This will open a form where you can
    enter your webhook url.
  </li>

  <li>
    **Enter the Webhook URL:** Provide the URL where you want
    to receive webhook notifications. Ensure that this URL is accessible
    from the public internet.
  </li>

  <li>
    **Save the Webhook:** Save the webhook configuration.
  </li>
</ul>

> [!TIP]
>
> Ensure that your server responds quickly to webhook requests. Webhooks that do
> not receive a `200 OK` response may be retried multiple times by Embed.

Here’s the guide rewritten using the **Steps** component to clearly outline the process for handling webhooks in your application:

## Handling Webhooks in Your Application

When your application receives a webhook, it’s important to handle it efficiently and securely. Follow these steps to manage incoming webhooks:

**1. Step 1: Parse the Incoming Request**

Webhooks are sent as HTTP POST requests with a JSON payload.

**2. Step 2: Verify the Webhook**

If you have set a secret key, you should verify the signature included in the webhook request headers. This verification ensures that the request is authentic and actually from Embed.

```http theme={null}
  POST /webhook-endpoint HTTP/1.1
  Host: yourapplication.com
  Content-Type: application/json
  X-Auth-Signature: sha256(secret)
```

**3. Step 3: Respond to the Webhook**

Always respond to the webhook request with a `200 OK` status code once your application has processed the event. This response tells Embed that the webhook was received and handled successfully.

```http theme={null}
  HTTP/1.1 200 OK
```

> [!WARNING]
>
> Ensure your webhook endpoint is secure. Consider implementing rate limiting
> and verifying the signature of incoming requests to prevent unauthorized
> access.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.