IllyVoIPdevelopers Back to IllyVoIP

WhatsApp

Read usage and fee totals

Read usage and fee totals

Try in API Playground ↗Sign in to prepare and run this request.
GET/api/v1/whatsapp/usage

Before you start

Connect your business and number in Portal → WhatsApp → Numbers & accounts first. Use an account-owner Production API key. Create templates in the Portal.

Result

from is inclusive and until exclusive, in UTC epoch seconds; the interval must be positive and at most 31 days. message_cohorts groups messages CREATED in that interval by CURRENT delivery and settlement state. It is not a charge-posting-period invoice. exact_platform_fee is a decimal string. account_totals are ALL-TIME: earned_fee, pending_fee, confirmed_wallet_net and reconciliation_pending. Meta bills its charges separately. Requires an account-owner Production API credential.

Charges and safe retries

Inspect uncertain operations before retrying. A queued message is not delivered. IllyVoIP reserves its fee at queue admission and charges only delivered outbound messages; incoming messages are free.

Authentication

Send your account API key in the X-Api-Key header. Keep it on your server; never embed it in browser code.

Request examples

Replace the example values with your own inputs. Examples do not run on this page. Production requests can change your account or incur charges.

cURL

cURL
curl -X GET "https://app.illyvoip.com/api/v1/whatsapp/usage?from=YOUR_FROM&until=YOUR_UNTIL" \
  -H "X-Api-Key: ${ILLYVOIP_API_KEY:?Set ILLYVOIP_API_KEY}"

Node.js

Node.js
const response = await fetch("https://app.illyvoip.com/api/v1/whatsapp/usage?from=YOUR_FROM&until=YOUR_UNTIL", {
  method: "GET",
  headers: {
    "X-Api-Key": process.env.ILLYVOIP_API_KEY
  }
});

const data = await response.json();
console.log(response.status, data);

PHP

PHP
<?php
$ch = curl_init('https://app.illyvoip.com/api/v1/whatsapp/usage?from=YOUR_FROM&until=YOUR_UNTIL');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'X-Api-Key: ' . getenv('ILLYVOIP_API_KEY')
    ],
]);

$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

echo $status . PHP_EOL;
echo $response;

Python

Python
import os
import json
import requests

response = requests.request(
    "GET",
    "https://app.illyvoip.com/api/v1/whatsapp/usage?from=YOUR_FROM&until=YOUR_UNTIL",
    headers={
        "X-Api-Key": os.environ["ILLYVOIP_API_KEY"]
    },
)

print(response.status_code)
print(response.json())

Node.js examples run on the server (Node.js 22.17+). Python examples require requests; PHP examples require cURL. Set the environment variables referenced in each example.

Request parameters

Query parameters

fromintegerrequired
minimum 0
untilintegerrequired
minimum 0

Request behavior

from is inclusive and until exclusive, in UTC epoch seconds; the interval must be positive and at most 31 days. message_cohorts groups messages CREATED in that interval by CURRENT delivery and settlement state. It is not a charge-posting-period invoice. exact_platform_fee is a decimal string. account_totals are ALL-TIME: earned_fee, pending_fee, confirmed_wallet_net and reconciliation_pending. Meta bills its charges separately. Requires an account-owner Production API credential.

Conditions and examples

Production only; no WhatsApp Sandbox is available. Replace placeholders with your own account data. Response examples are abbreviated; use the OpenAPI schemas for the full contract. Meta bills its charges separately.

Response fields

  • data: Endpoint-specific result object. Its nested fields are shown in the sample response.

HTTP responses

Expand a status to inspect its documented response format and examples. Example prices, IDs and timestamps are illustrative values, not quotes or account records.

200 Owner-scoped result.

application/json

successbooleanrequired
dataobjectrequired
Full schema
Schema
{
  "type": "object",
  "required": [
    "success",
    "data"
  ],
  "properties": {
    "success": {
      "type": "boolean"
    },
    "data": {
      "type": "object"
    }
  }
}
400 Invalid input.
401 Invalid API credential.
403 Account access denied.
409 Operation unavailable or request identity conflict.
503 Temporarily unavailable; a mutation outcome may be unknown. Preserve its request identity.

Production only

This operation is not available in Sandbox. Use an enabled Production account and review its effects before executing.

Search API operations, parameters, SDK and webhooks.