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

# Fetching a Summary (Total) of Unbilled Rated Unit Events

Calling `fetchUnbilledRatedUnitsTotal` calculates the number of Units and the currency amount billable for a given AutoBill (or AutoBills) at the moment of the call. This call returns a `RatedUnitSummary` object, which contains the totals for a single `AutoBillItem`.

**Note:** This call returns the number of unbilled Units at the moment of the call. This call will not reflect the amount for which your customer will be billed if more Events are reported before the end of the current Billing Cycle.

This example requests a report for all the unbilled Rated Units for a specified AutoBill, and returns an array of one Summary for each rated `AutoBillItem` included on the AutoBill. For example, if an `AutoBill` has two rated `AutoBillItems`, the call will return an array of two `RatedUnitSummary` objects.

## Fetch a summary of unbilled Rated Unit Events

```

$rateplan = new RatePlan;
$response = $rateplan->fetchUnbilledRatedUnitsTotal(
    null, # $account 
    $myAutoBill, # $myAutoBill 
    null, # $product 
    null, # $ratePlan 
    null, # $startTimestamp 
    null, # $endTimestamp     
    0, # $page 
    50, # $pageSize 
);
$summaries = $response->['data']->ratedUnitSummary;
foreach ($summaries as $sum) {
    print $sum->ratedUnitTotal; 
    print $sum->currentTotalRatedUnitsBill;
}
```

## Fetch a summary of unbilled Events for a specified AutoBill and Product

```

$rateplan = new RatePlan;
$response = $rateplan->fetchUnbilledRatedUnitsTotal(
    null, # $account 
    $myAutoBill, # $myAutoBill 
    $myProduct, # $myProduct 
    null, # $ratePlan 
    null, # $startTimestamp 
    null, # $endTimestamp 
    0, # $page 
    50, # $pageSize 
);
$summaries = $response->['data']->ratedUnitSummary;
foreach ($summaries as $sum) {
    print $sum->ratedUnitTotal;
    print $sum->currentTotalRatedUnitsBill;
}
```

This call returns two Summary objects, as shown below.

| 1st object | |
| - | - |
| accountVid | 0b69d0... |
| autoBillItemVid | ae3992... |
| autoBillVid | 60263a... |
| productVid | 8479ce9... |
| ratePlanVid | b4130b... |
| merchantAccountId | account\_13345386734 |
| merchantAutoBillId | autobill\_13345386734 |
| merchantAutoBillItemId | autobillitem\_13345386734 |
| merchantProductId | product\_13345386734 |
| merchantRatePlanId | rateplan\_13345386734 |
| currentTier | basic |
| currentTotalRatedUnitsBill | 4.27 |
| eventCount | 1 |
| ratedUnit | 'namePlural' => 'minutes' 'nameSingular' => 'minute' |
| ratedUnitTotal | 37 |

| 2nd object | |
| - | - |
| accountVid | 0b69d0... |
| autoBillItemVid | 370de7... |
| autoBillVid | 60263a... |
| productVid | 8479ce... |
| ratePlanVid | 496c89... |
| merchantAccountId | account\_13345386734 |
| merchantAutoBillId | autobill\_13345386734 |
| merchantAutoBillItemId | autobillitem\_23345386734 |
| merchantProductId | product\_13345386734 |
| merchantRatePlanId | rateplan\_13345386734 |
| currentTier | basic |
| currentTotalRatedUnitsBill | 3.15 |
| eventCount | 1 |
| ratedUnit | namePlural' => 'hour' nameSingular' => 'hours’ |
| ratedUnitTotal | 21 |
| This example returns two `RatedUnitSummary` objects, because there are two different `AutoBillItems` that match the query. The first bills for 37, and the second for 21 minutes of use on different Rate Plans. There is one event for each. If the customer were to be billed now, they would be charged for one minute at $4.27, and one hour at $3.15. | |

**Parent topic:**[Fetching and Reporting Rated Units](../topics/Fetching_and_Reporting_R)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.