# Konfirmasi

{% hint style="warning" %}
Hanya untuk transaksi type **DIRECT**
{% endhint %}

{% hint style="info" %}
Jika respon *sukses* maka kami akan mengirimkan notifikasi melalui url webhook yang telah anda setting.
{% endhint %}

<mark style="color:green;">`POST`</mark> `https://api.ilenpay.co.id/v1/konfirmasi/pembayaran`

#### Headers

| Name                                            | Type   | Description |
| ----------------------------------------------- | ------ | ----------- |
| Authorization<mark style="color:red;">\*</mark> | String | Api Key     |

#### Request Body

| Name                                       | Type   | Description          |
| ------------------------------------------ | ------ | -------------------- |
| reff\_id<mark style="color:red;">\*</mark> | String |                      |
| sender                                     | Int    | Nomer pengirim pulsa |

{% tabs %}
{% tab title="200: OK Respon Sukses" %}

```json
{
  "data": {
    "respon": "sukses",
    "hash": "0cac895dc4aec69e48c4e3d2e0b400c2cd2d868c",
    "reff_id": "trx68164teewfske2",
    "payment": "telkomsel",
    "rate": "0.82",
    "nominal": "10000",
    "total_tf": "13000",
    "return_url": "https://domainkamu/redirect",
    "sender": "6281238846015",
    "status": "PAID",
    "saldo_ahir": 20000
  }
}
```

{% endtab %}

{% tab title="200: OK Respon Jika Status TRX PAID" %}

```json
{
  "data": {
    "respon": "sukses",
    "pesan": "Pembayaran sudah di selesaikan reff trx8833",
    "return_url": "https://domain.com/riwayat/8833"
  }
}
```

{% endtab %}
{% endtabs %}

### Contoh Untuk PHP&#x20;

```php
<?php

$api_key    = 'Production Key';
$reff_id    = 'trx68164343'; // $_POST['reff_id'];
$sender     = '081234567828'; // $_POST['sender'];

$curl = curl_init();
curl_setopt_array($curl, [
    CURLOPT_FRESH_CONNECT  => true,
    CURLOPT_URL            => 'https://api.ilenpay.co.id/v1/konfirmasi/pembayaran',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HEADER         => false,
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_POSTFIELDS     => http_build_query(array(
        'sender'    => $sender,
        'reff_id'   => $reff_id
    )),

    CURLOPT_HTTPHEADER     => array(
        'Content-Type: application/x-www-form-urlencoded',
        'Authorization: ' . $api_key
    ),
    CURLOPT_FAILONERROR    => false,
    CURLOPT_IPRESOLVE      => CURL_IPRESOLVE_V4
]);

$response = curl_exec($curl);
$error = curl_error($curl);
curl_close($curl);
print_r(empty($error) ? $response : $error);


```


---

# 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/konfirmasi.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.
