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

# Work with charged-type metric

> Suitable for usage-based plans, It allows you to charge additional amounts based on actual usage, ensuring that your revenue matches customer engagement.

The charged-type metric (numeric type) is used to track user usage, calculate and charge the amount at period end.

The metric system integrates with the UniBee API, which provides event-based statistics.

You can report usage data by sending events to the [Event API](/api-reference/metric-event/new-merchant-metric-event).

The metric counting for each product, you may need specified for the `productId` at Event API, default product will used if not specified

Aggregation Type of Count metric event, it increases 1 usage number

```shellscript theme={null}
curl --location --request POST "$UniBee_API_Host/merchant/merchant_metric/merchant_metric_event" \
  --header "Authorization: Bearer $YOUR_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "metricCode": "folder_count_limit", // code needs to be configured in advance in the UniBee portal
    "externalUserId": "$YOUR_USER_ID",
    "externalEventId": "string", // string, **unique**, e.m. [folderId]
    "metricProperties": {}
}'
```

same externalEventId , no double counting

Aggregation Type of Latest metric event, it Inspect 5, event of Latest type will not be add up

```shellscript theme={null}
curl --location --request POST "$UniBee_API_Host/merchant/merchant_metric/merchant_metric_event" \
  --header "Authorization: Bearer $YOUR_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "metricCode": "active_profile_limit", // code needs to be configured in advance in the UniBee portal
    "externalUserId": "$YOUR_USER_ID",
    "externalEventId": "string", // string, **unique**, e.m. [folderId]
    "metricProperties": {
      "active_profile": 5
    }
}'
```

### Define how much cost for every event at Plan definision after complete set-up your billable metric

* Go to the **Plan Definition** page
* Navigate to **Advanced Setup**, add a billing model under **Usage-based billing**, and choose your **Pricing type**:
  * **Standard pricing**
    A fixed rate is applied for each unit of usage. For example, if the unit price is $0.05 and a user generates 100 events, they will be charged $5.
  * **Graduated pricing**
    Usage is divided into tiers, and each tier has a different rate. For example:
    * First 100 events: \$0.05 each
    * Next 200 events: \$0.03 each
    * Remaining events: \$0.01 each\
      This model encourages higher usage by reducing unit costs at higher volumes.

### Check the customer's current metric statistics

* Go to **User-Detail** Page at **UniBee Admin Portal**
* Tab to **Metering-Usage** Page, check current billing period charged metered usage data
* Charged metered usage amount will append to next invoice items automatically

<img src="https://mintcdn.com/aaaabmero/PAQKVjj86U1Qa7E1/images/customer-charged-metric.jpg?fit=max&auto=format&n=PAQKVjj86U1Qa7E1&q=85&s=fe88632c1dd9988ba1f78aa6309b2345" alt="UniBee Customer Charged Metric Page" width="2772" height="2034" data-path="images/customer-charged-metric.jpg" />
