# Webhooks

{% hint style="info" %}
Tes apakah webhook sudah berjalan. Lakukan ping dengan URL dibawah ini. Kami akan mengirim data ke url yang telah anda settings.
{% endhint %}

> **<https://api.ilenpay.co.id/v1/webhook/ping/\\[Webhook> ID]**

```
// Contoh data yang kami kirim ke server anda.
{
  "data": {
    "webhook_id": "Tu9olJ9bLu0gDWv",
    "webhook_url": "https://ilenpay.id/webhook.php",
    "webhook_key": "alamat",
    "back_url": "https://ilenpay.id/tes-backurl.php"
  }
}
```

{% hint style="info" %}
Contoh pengiriman dari server kami
{% endhint %}

<pre><code>> POST /gass HTTP/1.1
> Host: ilenpay.co.id:3220
> X-Ilen-Delivery: pwsO51H0hfBk8iddERvp1LTasm7gG4
> X-Ilen-Signature: key=7d6f016c23d03b696e76dada91c07f178cc0af4d
> User-Agent: Ilenpay-Hookshot
<strong>> Content-Type: application/json
</strong>> Content-Length: 445
> X-Ilen-Event: create
{
  "data": {
    "hash": "e8d51bbe59f7689f82b3897a87f1e17829187391",
    "reff_id": "trx68164endo_tes",
    "payment": "telkomsel",
    "rate": "0.80",
    "nominal": "15000",
    "total_tf": "20000",
<strong>    "sender" : "6281234567898",
</strong>    "status": "PAID"
    "saldo_ahir": "576546"
  }
}

</code></pre>

{% hint style="info" %}
Contoh untuk menerima event PHP Native&#x20;
{% endhint %}

```
<?php
    $secret     = 'kodekamu';
    $post_data  = file_get_contents('php://input');
    $signature  = hash_hmac('sha1', $post_data, $secret);

    if($_SERVER['HTTP_X_ILEN_SIGNATURE'] == 'key=' . $signature){
       file_put_contents("log-ilenpay.txt", $post_data);
    }
    
?>
```


---

# 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://docs.ilenpay.co.id/webhooks.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.
