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

# PAYMENT REFUNDED

> Technical reference for the PAYMENT_REFUNDED webhook event, including payload schema, field specifications, and implementation details.

## Event Overview

**Event Type**: `PAYMENT_REFUNDED`\
**Category**: Payment\
**Description**: Payment has been refunded

This webhook is triggered when a payment is refunded to the customer through EximPe.

***

## Delivery Details

| Attribute        | Value                                                                 |
| ---------------- | --------------------------------------------------------------------- |
| **HTTP method**  | `POST`                                                                |
| **URL**          | The webhook URL configured on your merchant account's API credentials |
| **Content-Type** | `application/json`                                                    |
| **Timeout**      | 10 seconds                                                            |
| **Retries**      | Up to 5 delivery attempts (backoff: 1 min, 5 min, 15 min, 60 min)     |

### Headers

| Header                | Description                                                                                                                                   |
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `Content-Type`        | `application/json`                                                                                                                            |
| `User-Agent`          | `Eximpe-Webhook/1.0`                                                                                                                          |
| `X-Webhook-Event`     | `PAYMENT_REFUNDED`                                                                                                                            |
| `X-Webhook-Timestamp` | Unix timestamp (string) at the time of the request                                                                                            |
| `X-Webhook-Signature` | HMAC-SHA256 signature of the request body (JSON string with keys sorted, no extra whitespace), using your API key as the secret. Hex-encoded. |

**Signature verification (recommended):**\
Compute `HMAC-SHA256(encryption_key, raw_body)` where `raw_body` is the exact UTF-8 request body as received. Compare the hex result with the `X-Webhook-Signature` header to ensure the webhook is from the platform and unchanged.

***

## Payload Schema

<CodeGroup>
  ```json Example Payload theme={null}
  {
      "event_type": "PAYMENT_REFUNDED",
      "event_time": "2024-02-15 16:53:15",
      "version": "1.0",
      "sequence_number": "e40552bf-ed12-4f35-9a97-162d97e6fa34",
      "data": {
          "refunds": [
              {
                  "payment_request_id": "PR7485664995",
                  "order_id": "OD6085456489",
                  "refund_id": "RF2684785771",
                  "amount": 1000,
                  "bank_arn": "arn"
              }
          ]
      }
  }
  ```
</CodeGroup>

## Field Specifications

<Tabs>
  <Tab title="Root Level Fields">
    <ParamField path="event_type" type="string" required>
      Always `"PAYMENT_REFUNDED"` for this webhook event
    </ParamField>

    <ParamField path="event_time" type="string" required>
      Timestamp when the event occurred in YYYY-MM-DD HH:MM:SS format

      **Example**: `"2024-02-15 16:53:15"`
    </ParamField>

    <ParamField path="version" type="string" required>
      Webhook payload version (currently "1.0")
    </ParamField>

    <ParamField path="sequence_number" type="string" required>
      Unique identifier for the event instance

      **Example**: `"e40552bf-ed12-4f35-9a97-162d97e6fa34"`
    </ParamField>

    <ParamField path="data" type="object" required>
      Event-specific data payload containing refund details
    </ParamField>
  </Tab>

  <Tab title="Data Object Fields">
    <ParamField path="data.refunds" type="array" required>
      Array of refund objects containing the refund information
    </ParamField>

    <ParamField path="data.refunds[].payment_request_id" type="string" required>
      Original payment request ID that was refunded

      **Example**: `"PR7485664995"`
    </ParamField>

    <ParamField path="data.refunds[].order_id" type="string" required>
      Order ID associated with the refund

      **Example**: `"OD6085456489"`
    </ParamField>

    <ParamField path="data.refunds[].refund_id" type="string" required>
      Unique refund identifier

      **Example**: `"RF2684785771"`
    </ParamField>

    <ParamField path="data.refunds[].amount" type="number" required>
      Refund amount

      **Example**: `1000`
    </ParamField>

    <ParamField path="data.refunds[].bank_arn" type="string">
      Bank ARN (Acquirer Reference Number) - may be null

      **Example**: `"arn"`
    </ParamField>
  </Tab>
</Tabs>
