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

# Webhooks

> Configure and manage real-time notifications for your meCash transaction lifecycle events.

Webhooks are a way for meCash to send your application automatic notifications whenever specific events take place. Instead of your application constantly asking meCash for updates, meCash pushes information to you in real-time.

<AccordionGroup>
  <Accordion icon="diagram-project" title="How Webhooks Work">
    ```mermaid theme={null}
    sequenceDiagram
        participant A as meCash System
        participant B as Your Webhook Endpoint
        A->>A: Event occurs (payout, collection, etc.)
        A->>B: Send secure HTTP POST with event payload
        B-->>A: Return 2XX acknowledgment
        B->>B: Validate X-Signature using HMAC-512
        B->>B: Confirm authenticity of the request
    ```

    The process is straightforward:

    1. **An Event Occurs**: Something happens in your account, like a successful payout or a collection.
    2. **meCash Sends a Request**: We send a secure HTTP POST request containing the event details to the webhook URL you've configured.
    3. **You Acknowledge and Verify**: Your server acknowledges receipt by returning a `2XX` status code and then validates the request's signature to confirm it's genuinely from meCash.
  </Accordion>

  <Accordion icon="shield-halved" title="Webhook Security">
    <Callout type="info" emoji="🛡️">
      All meCash webhook events are signed using an `HMAC-512` signature in the `X-Signature` header. The signature is computed from the raw request body using your webhook secret key (found in **Developers → Webhooks** in your dashboard). Always verify this signature before processing the event to ensure authenticity and prevent replay attacks.
    </Callout>

    * Reject requests with missing or invalid signatures.
    * Log every webhook delivery for auditability.
    * Retry failed processing gracefully and return `2XX` only after you persist the event.
  </Accordion>

  <Accordion icon="gear" title="Configure Your Webhook in the Dashboard">
    <AccordionGroup>
      <Accordion icon="compass-drafting" title="Navigate to the Webhooks page">
        In the **Developers** section of your meCash dashboard, select **Webhooks** from the left-hand menu to review existing endpoints and create new ones.

        <Frame>
          <img src="https://mintcdn.com/mecash-0665cec5/hdhYl9PSb3yFfmpE/public/images/webhooks2.png?fit=max&auto=format&n=hdhYl9PSb3yFfmpE&q=85&s=9d11104b0e470a4e7f5b093d360195c0" alt="Developers dashboard highlighting the Webhooks navigation item" style={{ borderRadius: '0.75rem' }} width="1436" height="431" data-path="public/images/webhooks2.png" />
        </Frame>
      </Accordion>

      <Accordion icon="plus" title="Create a new webhook">
        Click the **Create Webhook** button at the top-right corner to launch the configuration modal for a new endpoint.

        <Frame>
          <img src="https://mintcdn.com/mecash-0665cec5/hdhYl9PSb3yFfmpE/public/images/webhooks.png?fit=max&auto=format&n=hdhYl9PSb3yFfmpE&q=85&s=bc068d611b9a408bd8dca9fc3bed8aa2" alt="Create webhook dialog in the meCash dashboard" style={{ borderRadius: '0.75rem' }} width="1439" height="445" data-path="public/images/webhooks.png" />
        </Frame>
      </Accordion>

      <Accordion icon="link" title="Provide your webhook URL">
        * Enter the publicly accessible **URL** where you want to receive webhook events.<br />
        * Ensure the endpoint accepts HTTPS POST requests and responds within 10 seconds.<br />
        * Return an HTTP **2XX status code** to acknowledge receipt and prevent retries.

        <Frame>
          <img src="https://mintcdn.com/mecash-0665cec5/YwWwP-Aa6_SDT7kC/public/images/Screenshot202316.png?fit=max&auto=format&n=YwWwP-Aa6_SDT7kC&q=85&s=cdb2fca59cc8ead6e39c6f5443cc4a98" alt="Webhook configuration form requesting callback URL" style={{ borderRadius: '0.75rem' }} width="1440" height="699" data-path="public/images/Screenshot202316.png" />
        </Frame>
      </Accordion>

      <Accordion icon="circle-check" title="Confirm and monitor delivery">
        After clicking **Confirm**, your webhook appears in the list with its current status. Use the dashboard to pause, resume, or regenerate the signing secret if needed.
      </Accordion>
    </AccordionGroup>
  </Accordion>
</AccordionGroup>
