> ## 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.

# Deducting Rated Units

Subscribe also allows you to deduct unbilled Rated Units from an AutoBill.

Use the `deductEvent` method to reduce the outstanding, unbilled balance of `Events`for an AutoBill, by creating a new Event, with a negative value. Use the `reverseEvent` call to remove a specific, previously recorded Event.

**Note:** Calling `deductEvent` will fail if it results in a negative Rated Unit balance on the `AutoBillItem`. Subscribe does not support negative balances on Rated Units.

Use `reverseEvent` to credit an Account for previously billed Events.

## Deduct Events:

```

$rateplan = new RatePlan;
$event = new Event;

$event->setMerchantEventId('rating_129');
$event->setMerchantAutoBillId('ab_715');
$event->setAmount(2);

$response = $rateplan->deductEvent(array($event));
```

Subscribe tracks this deduction as a distinct Event, available in any audit trail of Events.

**Parent topic:**[Working with Rate Plans](../topics/ProgGuide_RatePlans)


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