---
title: "Void a usage event"
description: "Allowed while no finalized invoice bills the event's period."
canonical_url: "https://twominutebilling.com/help/developers/api-reference/usage/void-a-usage-event"
---
# Void a usage event

> Allowed while no finalized invoice bills the event's period.

<api-operation method="POST" path="/v1/businesses/{biz}/usage_events/void">
<template v-slot:docs="">

The event stays on record with `voided_at`; send a replacement with a new key. `timestamp` is required for an event older than 35 days.

## Path parameters

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        biz
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <strong>
        yes
      </strong>
    </td>
    
    <td>
      The business's id (biz_…).
    </td>
  </tr>
</tbody>
</table>

## Headers

<table>
<thead>
  <tr>
    <th>
      Parameter
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        Idempotency-Key
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Safely retry writes — repeats return the original response. If a write FAILED after it had already taken effect, that failure is what repeats: the key is spent, and a new attempt needs a new key.
    </td>
  </tr>
</tbody>
</table>

## Body

The request body is **required**.

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Required
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        key
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <strong>
        yes
      </strong>
    </td>
    
    <td>
      The usage event void's key.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        timestamp
      </code>
    </td>
    
    <td>
      <code>
        string · ISO-8601
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      The event's timestamp. Required past 35 days.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        reason
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Why the event is voided.
    </td>
  </tr>
</tbody>
</table>

## Response

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        event
      </code>
    </td>
    
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      The usage event result's event.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        status
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The usage event result's status. One of <code>
        created
      </code>
      
      , <code>
        duplicate
      </code>
      
      , <code>
        voided
      </code>
      
      .
    </td>
  </tr>
</tbody>
</table>

## Status codes

<table>
<thead>
  <tr>
    <th>
      Status
    </th>
    
    <th>
      Meaning
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        200
      </code>
    </td>
    
    <td>
      The voided event.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        404
      </code>
    </td>
    
    <td>
      No such event.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        409
      </code>
    </td>
    
    <td>
      An invoice already bills its period. Issue a credit note instead.
    </td>
  </tr>
</tbody>
</table>
</template>

<template v-slot:request="">

```bash [Request]
curl -X POST "$TMBILLING_URL/v1/businesses/biz_XXXXXXXXXXXX01/usage_events/void" \
  -H "Authorization: Bearer $TMBILLING_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "key": "seats"
  }'
```

</template>

<template v-slot:response="">
<code-group>

```json [200 OK]
{
  "event": {
    "object": "usage_event",
    "id": "evt_XXXXXXXXXXXX01",
    "key": "resp_XXXXXXXXXXXX01:input",
    "customer": "cus_XXXXXXXXXXXX01",
    "event_name": "ai_tokens",
    "timestamp": "2026-03-14T09:30:00Z",
    "properties": {
      "model": "large-v2",
      "token_type": "input",
      "tokens": 1200
    },
    "amount": "Amount",
    "cost": "Cost",
    "currency": "USD",
    "customer_key": "Customer key",
    "status": "matched",
    "meters": [
      "Meter"
    ],
    "flags": [
      "Flag"
    ],
    "created_at": "2026-03-14T09:30:00Z",
    "voided_at": null,
    "void_reason": null
  },
  "status": "created"
}
```

```json [404 Not Found]
{
  "error": {
    "type": "invalid_request_error",
    "message": "No such event."
  }
}
```

```json [409 Conflict]
{
  "error": {
    "type": "conflict_error",
    "message": "An invoice already bills its period."
  }
}
```

</code-group>
</template>
</api-operation>


## Sitemap

See the full [sitemap](https://twominutebilling.com/sitemap.md) for all pages.
