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

# Usage Examples

> Example requests and responses for the Reseller API

Examples for using the Reseller API are shown below.

<Tip>
  You can use **Postman** to easily test the Reseller API. It lets you quickly validate your requests and move your integration forward smoothly.
</Tip>

Every request must:

* Use the **`POST`** method
* Send and accept **`application/json`**
* Include your API key in the JSON body as the `key` field

## Example cURL request

```bash theme={null}
curl --location 'https://client.hostrox.net/api/reseller/me' \
  --header 'Content-Type: application/json' \
  --data '{
    "key": "UzZBSlBWeWk0UEcrVWxlU0RjS1B1dz09"
  }'
```

## Example JSON response

```json theme={null}
{
  "status": "successful",
  "balance": "12921.6200",
  "currency": "USD",
  "balance_formatted": "$12,921.62"
}
```

## More languages

<CodeGroup>
  ```php PHP theme={null}
  <?php
  $ch = curl_init('https://client.hostrox.net/api/reseller/me');

  curl_setopt($ch, CURLOPT_POST, true);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_HTTPHEADER, [
      'Content-Type: application/json',
      'Accept: application/json',
  ]);
  curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
      'key' => 'YOUR_API_KEY',
  ]));

  $response = curl_exec($ch);
  curl_close($ch);

  $data = json_decode($response, true);
  print_r($data);
  ```

  ```js Node.js theme={null}
  const res = await fetch('https://client.hostrox.net/api/reseller/me', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
    },
    body: JSON.stringify({
      key: 'YOUR_API_KEY',
    }),
  });

  const data = await res.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  resp = requests.post(
      'https://client.hostrox.net/api/reseller/me',
      headers={
          'Content-Type': 'application/json',
          'Accept': 'application/json',
      },
      json={
          'key': 'YOUR_API_KEY',
      },
  )

  print(resp.json())
  ```
</CodeGroup>

## Response status

Every response includes a `status` field. A value of `successful` indicates the request was handled correctly; any other value indicates an error and the response will include a descriptive message.
