# Cek Harga

<mark style="color:blue;">`GET`</mark> `https://api.ilenpay.co.id/v1/info/harga`

#### Query Parameters

| Name                                       | Type   | Description                     |
| ------------------------------------------ | ------ | ------------------------------- |
| operator<mark style="color:red;">\*</mark> | String | (telkomsel, xl, tri, smartfren) |
| nominal<mark style="color:red;">\*</mark>  | Int    |                                 |

#### Headers

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

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

```json
{
    "data": {
        "respon": "sukses",
        "operator": "smartfren",
        "rate": "0.77",
        "nominal": "20000",
        "total_tf": "Rp26,000",
        "total_tf_int": "26000"
    }
}
```

{% endtab %}
{% endtabs %}

### Contoh Untuk PHP&#x20;

```php
<?php

$api_key    = 'fb59f88534bd4c8e2559f885345trdbd81e4bd10';
$operator   = 'smartfren';
$nominal    = '20000';
$params     = array(
                'operator'  => $operator,
                'nominal'   => $nominal
            );

$curl = curl_init();
curl_setopt_array($curl, [
    CURLOPT_FRESH_CONNECT  => true,
    CURLOPT_URL            => 'https://api.ilenpay.co.id/v1/info/harga?' . http_build_query($params),
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HEADER         => false,
    CURLOPT_CUSTOMREQUEST  => 'GET',
    CURLOPT_HTTPHEADER     => ['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);

?>
```
