# Checking Usage & Statistics

Businesses using the WhatsApp Business Platform are being [charged per conversation](https://docs.360dialog.com/partner/~/changes/1051/messaging/sending-and-receiving-messages/conversations) until 2025, which includes all messages delivered in a 24-hour session with a particular WhatsApp user. [See Conversations documentation](https://docs.360dialog.com/partner/~/changes/1051/messaging/sending-and-receiving-messages/conversations).

Through the Monthly usage data, you get to see the number of conversations the phone number had and when; it includes All, Free, and Paid Conversations.&#x20;

**This information is an estimate and can slightly differ from invoices.** It can be checked in the 360dialog Hub (by Partners and Clients), via Partner API (by Partners only, which can be used to create personalized dashboards for their clients) and via Webhook notifications (which requires development of an additional counter).

Please note that final information about charges in only available in the invoices sent after the month has ended.

## In the 360dialog Hub

Clients and Partners can see a specific WABA usage in the Funds dashboard. To access it, click in *Show details* in the specific WABA you wish to use and select *Insights* on the top menu.

Through the Monthly usage graphs, you get to see the number of conversations the phone number had and when; it includes All, Free, and Paid Conversations.

![](https://2248475362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuyAl2S0lSHJaNDXJHo7A%2Fuploads%2FjuXwDajr5IMusZo1W0Sp%2FScreen%20Shot%202022-06-13%20at%2017.32.29.png?alt=media\&token=c8cd3951-5eb2-44b7-8928-797de3324534)

Here, you can also estimate costs for the future through the Approximate charges graph, which shows the estimation of the costs of charges.

<figure><img src="https://2248475362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuyAl2S0lSHJaNDXJHo7A%2Fuploads%2FIalYHRm4xAyJqAoOG3Po%2Fimage.png?alt=media&#x26;token=f03af42e-f415-4083-93b9-cfd96d970174" alt=""><figcaption></figcaption></figure>

If the client is registered under [Direct Payment](https://docs.360dialog.com/partner/~/changes/1051/partner-and-account-management/solutions-for-partners#payment-management-and-options), you will also be able to see their balance settings in this same page.

{% hint style="info" %}
Please be aware that the Approximate Charges displayed in the 360dialog Hub is financially binding in its totality. The precise amount due will be determined by Meta's invoice at the end of the month, which will serve as the authoritative record of charges.
{% endhint %}

## In the Partner API

If your clients are registered with direct payment, you can use the check balance endpoint to get usage information.&#x20;

[Please see how to use this here.](https://docs.360dialog.com/partner/~/changes/1051/waba-management/managing-your-clients#get-clients-balance)

### Granularity

You can use the granularity parameter to retrieve metrics about the conversations associated with the WhatsApp Business Account (WABA).&#x20;

Specifically, you can get the number of messages sent and delivered as well as conversation and cost information for a given period. This parameter works together with the `/balance` endpoint in the Partner API. See below how to parse your request.&#x20;

## Get balance of Client Hub&#x20;

<mark style="color:blue;">`GET`</mark> `https://hub.360dialog.io/api/v2/partners/{partner_id}/clients/{client_id}/info/balance`

<mark style="color:red;">Rate limit:</mark> 5 requests per 30 seconds.

**Request example**

`curl --request GET`\
`--url https://hub.360dialog.io/api/v2/partners/{partner_id}/clients/{client_id}/info/balance`**`?`**<mark style="color:blue;">**`start_date`**</mark><mark style="color:red;">**`=1664582400`**</mark>**`&`**<mark style="color:blue;">**`end_date`**</mark><mark style="color:red;">**`=1667260799`**</mark>**`&`**<mark style="color:blue;">**`granularity`**</mark><mark style="color:red;">**`=day`**</mark>\
`--header 'Authorization: '`\
`--header 'Content-Type: application/json'`

#### Path Parameters

| Name                                          | Type   | Description       |
| --------------------------------------------- | ------ | ----------------- |
| client\_id<mark style="color:red;">\*</mark>  | string | ID of the client  |
| partner\_id<mark style="color:red;">\*</mark> | string | ID of the partner |

#### Query Parameters

| Name        | Type           | Description                                                                                                                                                                                                                     |
| ----------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| end\_date   | UNIX Timestamp | <p>The end date in UNIX Timestamp (UTC). Returned data will be equal to or older than the specified date.<br></p><p>Example: <code>1672531200</code></p>                                                                        |
| start\_date | UNIX Timestamp | <p>The start date in UNIX Timestamp (UTC). Returned data will be equal to or newer than the specified date.<br></p><p>Example: <code>1672531200</code></p>                                                                      |
| granularity | string         | <p>The granularity by which you would like to retrieve the analytics.<br><br>Supported Options:<br><code>DAY</code> , <code>MONTH</code><br></p><p>Defaults with <code>MONTH</code> if no value is provided in the request.</p> |

{% tabs %}
{% tab title="200: OK " %}
The `balance` field is only relevant for clients who are registered with direct payment.

`usage`: The response contains an array called "usage" that provides a breakdown of the channel's usage in different categories. These categories may include [authentication, marketing, service, utility](https://docs.360dialog.com/partner/~/changes/1051/messaging/template-messages). Each category within the array includes details such as paid quantity, price, and quantity. This allows you to analyze the usage patterns and associated costs for different aspects of the channel's messaging services.

```json
{
        "balance": 50.00,
        "currency": "eur",
        "last_renewal": {
          "date": "2023-08-01T00:00:00Z,
          "amount": 20.00
        },
        "bi_price_for_currency_and_client_country": 0.2,
        "ui_price_for_currency_and_client_country": 0.02,
        "estimated_template_cost": 0.03,
        "granularity": "day",
        "usage": [
          {
            "authentication_paid_quantity": 0,
            "authentication_price": 0.0,
            "authentication_quantity": 0,
            "marketing_paid_quantity": 0,
            "marketing_price": 0.0,
            "marketing_quantity": 0,
            "service_paid_quantity": 0,
            "service_price": 0.0,
            "service_quantity": 0,
            "utility_paid_quantity": 0,
            "utility_price": 0.0,
            "utility_quantity": 0,
            "business_initiated_paid_quantity": 5,
            "business_initiated_price": 1.0,
            "business_initiated_quantity": 5,
            "free_entry_point": 0,
            "free_quantity": 0,
            "free_tier": 0,
            "paid_quantity": 5,
            "period_date": "2023-08-10T00:00:00Z",
            "quantity": 5,
            "total_price": 1.0,
            "user_initiated_paid_quantity": 0,
            "user_initiated_price": 0.00,
            "user_initiated_quantity": 0
          },
          {
            "authentication_paid_quantity": 0,
            "authentication_price": 0.0,
            "authentication_quantity": 0,
            "marketing_paid_quantity": 0,
            "marketing_price": 0.0,
            "marketing_quantity": 0,
            "service_paid_quantity": 0,
            "service_price": 0.0,
            "service_quantity": 0,
            "utility_paid_quantity": 0,
            "utility_price": 0.0,
            "utility_quantity": 0,
            "business_initiated_paid_quantity": 0,
            "business_initiated_price": 0,
            "business_initiated_quantity": 0,
            "free_entry_point": 0,
            "free_quantity": 0,
            "free_tier": 0,
            "paid_quantity": 5,
            "period_date": "2023-08-11T00:00:00Z",
            "quantity": 5,
            "total_price": 0.05,
            "user_initiated_paid_quantity": 5,
            "user_initiated_price": 0.05,
            "user_initiated_quantity": 5
          }
        ]
      }
```

{% endtab %}

{% tab title="404: Not Found " %}

```
{
  "meta": {
    "success": false,
    "http_code": 400,
    "developer_message": "There was an error with your request",
    "details": [
      "string"
    ],
    "error_data": {
      "code": "string",
      "message": "string",
      "real_message": "string",
      "status": 0
    }
  }
}
```

{% endtab %}
{% endtabs %}

## Get Channel Balance

<mark style="color:blue;">`GET`</mark> `https://hub.360dialog.io/api/v2/partners/{partner_id}/clients/{client_id}/channels/{channel_id}/info/balance`

**Request Example**\
\
`curl --request GET`\
`--url https://hub.360dialog.io/api/v2/partners/partner_id/clients/client_id/channels/channel_id/info/balance`\
`--header 'Accept: application/json'`\
`--header 'Authorization: '`

#### Path Parameters

| Name                                          | Type   | Description |
| --------------------------------------------- | ------ | ----------- |
| partner\_id<mark style="color:red;">\*</mark> | string |             |
| client\_id<mark style="color:red;">\*</mark>  | string |             |
| channel\_id<mark style="color:red;">\*</mark> | string |             |

#### Query Parameters

| Name        | Type   | Description                                                                                                                                                                                                                     |
| ----------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| start\_date | string | <p>The start date in UNIX Timestamp (UTC). Returned data will be equal to or newer than the specified date.<br></p><p>Example: <code>1672531200</code></p>                                                                      |
| end\_date   | string | <p>The end date in UNIX Timestamp (UTC). Returned data will be equal to or older than the specified date.<br></p><p>Example: <code>1672531200</code></p>                                                                        |
| granularity | string | <p>The granularity by which you would like to retrieve the analytics.<br><br>Supported Options:<br><code>DAY</code> , <code>MONTH</code><br></p><p>Defaults with <code>MONTH</code> if no value is provided in the request.</p> |
| app\_ids    |        | To get usage accumulated from selected app\_ids (e.g. `?app_ids=100,200)`                                                                                                                                                       |

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

```json
{
  "balance": 123.5,
  "bi_price_for_currency_and_client_country": 0.01,
  "currency": "EUR",
  "estimated_template_cost": 0.02,
  "last_renewal": {
    "amount": 100.5,
    "date": "2019-08-24T14:15:22Z"
  },
  "ui_price_for_currency_and_client_country": 0.05,
  "usage": [
    {
      "authentication_paid_quantity": 0,
      "authentication_price": 0,
      "authentication_quantity": 0,
      "marketing_paid_quantity": 1300,
      "marketing_price": 13,
      "marketing_quantity": 1800,
      "service_paid_quantity": 500,
      "service_price": 2.5,
      "service_quantity": 1000,
      "utility_paid_quantity": 0,
      "utility_price": 0,
      "utility_quantity": 0,
      "business_initiated_paid_quantity": 0,
      "business_initiated_price": 0,
      "business_initiated_quantity": 0,
      "free_entry_point": 20,
      "free_quantity": 1020,
      "free_tier": 1000,
      "paid_quantity": 1800,
      "period_date": "2023-08-24T14:15:22Z",
      "quantity": 2800,
      "total_price": 12.5,
      "user_initiated_paid_quantity": 0,
      "user_initiated_price": 0,
      "user_initiated_quantity": 0
    }
  ]
}
```

{% endtab %}
{% endtabs %}

#### Query Syntax

#### GE&#x54;*`/info/balance`*`?`**`<FILTERING_PARAMETER>`**

#### **Example:**

`https://hub.360dialog.io/api/v2/partners/{partner_id}/clients/{client_id}/info/balance`**`?`**<mark style="color:blue;">**`start_date`**</mark><mark style="color:red;">**`=1664582400`**</mark>**`&`**<mark style="color:blue;">**`end_date`**</mark><mark style="color:red;">**`=1667260799`**</mark>**`&`**<mark style="color:blue;">**`granularity`**</mark><mark style="color:red;">**`=day`**</mark>

#### Query String Parameters <a href="#query-string-parameters" id="query-string-parameters"></a>

<table><thead><tr><th width="284">Placeholder</th><th width="271.3333333333333">Description</th><th>Example Value</th></tr></thead><tbody><tr><td><code>&#x3C;FILTERING_PARAMATERS></code></td><td><p><strong>Required.</strong></p><p></p><p>Metric filtering parameter. Append additional filtering parameters using dots.</p><p></p><p>For possible values, see:</p><p></p><p><a href="#conversation-analytics-parameters">Filtering Parameters</a></p></td><td><code>start_date=1664582400&#x26;end_date=1667260799&#x26;granularity=day</code></td></tr></tbody></table>

When calling the **GET** request, you can attach the following`{filtering-parameters}`to retrieve the cost and [conversation](https://docs.360dialog.com/partner/~/changes/1051/messaging/sending-and-receiving-messages/conversations) information for a specific WABA.&#x20;

#### Filtering Parameters <a href="#conversation-analytics-parameters" id="conversation-analytics-parameters"></a>

<table><thead><tr><th width="279">Name</th><th>Description </th></tr></thead><tbody><tr><td><p><code>start_date</code></p><p>type: UNIX Timestamp</p></td><td><p><strong>Required.</strong><br><br>The start date in UNIX Timestamp (UTC). Returned data will be equal to or newer than the specified date.<br></p><p>Example: 1672531200</p></td></tr><tr><td><p><code>end_date</code></p><p>type: UNIX Timestamp</p></td><td><p><strong>Required.</strong></p><p><br>The end date in UNIX Timestamp (UTC). Returned data will be equal to or older than the specified date.<br></p><p>Example: 1672531200</p></td></tr><tr><td><p><code>granularity</code></p><p>type: String</p></td><td><p><strong>Required.</strong></p><p>The granularity by which you would like to retrieve the analytics.<br><br>Supported Options:</p><ul><li><code>DAY</code></li><li><code>MONTH</code></li></ul><p>Defaults with <code>MONTH</code> if no value is provided in the request.</p></td></tr><tr><td><code>app_id</code><br>type: array</td><td><p><strong>Available only for Get Client Balance endpoint.</strong> </p><p></p><p>An array of <code>app_ids</code> for which you would like to retrieve usage. If not provided, all <code>app ids</code> in the WABA are included.</p></td></tr></tbody></table>

{% hint style="info" %}
Usage data is approximate and may differ from what’s shown on invoices due to small variations in data processing.
{% endhint %}

#### Examples <a href="#examples" id="examples"></a>

With granularity parameters, you can filter and break down your results. See the code sample below for examples.

```json
GET info/balance?start_date=1691629200&end_date=1691758799&granularity=day
```

A successful response returns the `usage` object with the data you have requested.

```json
{
        "balance": 50.00,
        "currency": "eur",
        "last_renewal": {
          "date": "2023-08-01T00:00:00Z,
          "amount": 20.00
        },
        "bi_price_for_currency_and_client_country": 0.2,
        "ui_price_for_currency_and_client_country": 0.02,
        "estimated_template_cost": 0.03,
        "granularity": "day",
        "usage": [
          {
            "authentication_paid_quantity": 0,
            "authentication_price": 0.0,
            "authentication_quantity": 0,
            "marketing_paid_quantity": 0,
            "marketing_price": 0.0,
            "marketing_quantity": 0,
            "service_paid_quantity": 0,
            "service_price": 0.0,
            "service_quantity": 0,
            "utility_paid_quantity": 0,
            "utility_price": 0.0,
            "utility_quantity": 0,
            "business_initiated_paid_quantity": 5,
            "business_initiated_price": 1.0,
            "business_initiated_quantity": 5,
            "free_entry_point": 0,
            "free_quantity": 0,
            "free_tier": 0,
            "paid_quantity": 5,
            "period_date": "2023-08-10T00:00:00Z",
            "quantity": 5,
            "total_price": 1.0,
            "user_initiated_paid_quantity": 0,
            "user_initiated_price": 0.00,
            "user_initiated_quantity": 0
          },
          {
            "authentication_paid_quantity": 0,
            "authentication_price": 0.0,
            "authentication_quantity": 0,
            "marketing_paid_quantity": 0,
            "marketing_price": 0.0,
            "marketing_quantity": 0,
            "service_paid_quantity": 0,
            "service_price": 0.0,
            "service_quantity": 0,
            "utility_paid_quantity": 0,
            "utility_price": 0.0,
            "utility_quantity": 0,
            "business_initiated_paid_quantity": 0,
            "business_initiated_price": 0,
            "business_initiated_quantity": 0,
            "free_entry_point": 0,
            "free_quantity": 0,
            "free_tier": 0,
            "paid_quantity": 5,
            "period_date": "2023-08-11T00:00:00Z",
            "quantity": 5,
            "total_price": 0.05,
            "user_initiated_paid_quantity": 5,
            "user_initiated_price": 0.05,
            "user_initiated_quantity": 5
          }
        ]
      }
```

## Via Webhook

Every time a message is sent, you can see the conversation information in the webhook. You can build a counter to understand usage and statistics based on this objects.

[Please see how this is presented in this specific documentation.](https://docs.360dialog.com/partner/~/changes/1051/messaging/sending-and-receiving-messages/conversations#understanding-the-conversations-via-webhook)
