---
title: "Usage controls"
description: "Keep spend in check and bill usage early: spend limits that the access check enforces, alerts with a state per threshold, credit runway, automatic top-up, invoices raised when unbilled usage reaches…"
canonical_url: "https://twominutebilling.com/help/developers/api-reference/usage-controls"
---
# Usage controls

> Keep spend in check and bill usage early: spend limits that the access check enforces, alerts with a state per threshold, credit runway, automatic top-up, invoices raised when unbilled usage reaches…

Keep spend in check and bill usage early: spend limits that the access check enforces, alerts with a state per threshold, credit runway, automatic top-up, invoices raised when unbilled usage reaches an amount, a preview of a rate change on real usage, and an embeddable usage widget for your own app.

## Endpoints

<table>
<thead>
  <tr>
    <th>
      Method
    </th>
    
    <th>
      Endpoint
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        GET
      </code>
    </td>
    
    <td>
      <a href="https://twominutebilling.com/help/developers/api-reference/usage-controls/retrieve-a-customer-s-automatic-top-up">
        <code>
          /v1/businesses/{biz}/customers/{cus}/auto_topup
        </code>
      </a>
    </td>
    
    <td>
      Retrieve a customer's automatic top-up
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        PUT
      </code>
    </td>
    
    <td>
      <a href="https://twominutebilling.com/help/developers/api-reference/usage-controls/set-a-customer-s-automatic-top-up">
        <code>
          /v1/businesses/{biz}/customers/{cus}/auto_topup
        </code>
      </a>
    </td>
    
    <td>
      Set a customer's automatic top-up
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        POST
      </code>
    </td>
    
    <td>
      <a href="https://twominutebilling.com/help/developers/api-reference/usage-controls/turn-off-a-customer-s-automatic-top-up">
        <code>
          /v1/businesses/{biz}/customers/{cus}/auto_topup/disable
        </code>
      </a>
    </td>
    
    <td>
      Turn off a customer's automatic top-up
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        POST
      </code>
    </td>
    
    <td>
      <a href="https://twominutebilling.com/help/developers/api-reference/usage-controls/turn-on-a-customer-s-automatic-top-up">
        <code>
          /v1/businesses/{biz}/customers/{cus}/auto_topup/enable
        </code>
      </a>
    </td>
    
    <td>
      Turn on a customer's automatic top-up
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        GET
      </code>
    </td>
    
    <td>
      <a href="https://twominutebilling.com/help/developers/api-reference/usage-controls/list-a-customer-s-automatic-top-up-runs">
        <code>
          /v1/businesses/{biz}/customers/{cus}/auto_topup/runs
        </code>
      </a>
    </td>
    
    <td>
      List a customer's automatic top-up runs
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        GET
      </code>
    </td>
    
    <td>
      <a href="https://twominutebilling.com/help/developers/api-reference/usage-controls/estimate-the-credit-runway">
        <code>
          /v1/businesses/{biz}/customers/{cus}/credit_runway
        </code>
      </a>
    </td>
    
    <td>
      Estimate the credit runway
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        GET
      </code>
    </td>
    
    <td>
      <a href="https://twominutebilling.com/help/developers/api-reference/usage-controls/list-a-customer-s-spend-limits">
        <code>
          /v1/businesses/{biz}/customers/{cus}/spend_limits
        </code>
      </a>
    </td>
    
    <td>
      List a customer's spend limits
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        POST
      </code>
    </td>
    
    <td>
      <a href="https://twominutebilling.com/help/developers/api-reference/usage-controls/create-a-spend-limit">
        <code>
          /v1/businesses/{biz}/customers/{cus}/spend_limits
        </code>
      </a>
    </td>
    
    <td>
      Create a spend limit
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        GET
      </code>
    </td>
    
    <td>
      <a href="https://twominutebilling.com/help/developers/api-reference/usage-controls/retrieve-a-spend-limit">
        <code>
          /v1/businesses/{biz}/customers/{cus}/spend_limits/{limit}
        </code>
      </a>
    </td>
    
    <td>
      Retrieve a spend limit
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        PATCH
      </code>
    </td>
    
    <td>
      <a href="https://twominutebilling.com/help/developers/api-reference/usage-controls/update-a-spend-limit">
        <code>
          /v1/businesses/{biz}/customers/{cus}/spend_limits/{limit}
        </code>
      </a>
    </td>
    
    <td>
      Update a spend limit
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        DELETE
      </code>
    </td>
    
    <td>
      <a href="https://twominutebilling.com/help/developers/api-reference/usage-controls/delete-a-spend-limit">
        <code>
          /v1/businesses/{biz}/customers/{cus}/spend_limits/{limit}
        </code>
      </a>
    </td>
    
    <td>
      Delete a spend limit
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        POST
      </code>
    </td>
    
    <td>
      <a href="https://twominutebilling.com/help/developers/api-reference/usage-controls/create-a-usage-widget-token">
        <code>
          /v1/businesses/{biz}/customers/{cus}/usage_widget_tokens
        </code>
      </a>
    </td>
    
    <td>
      Create a usage widget token
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        POST
      </code>
    </td>
    
    <td>
      <a href="https://twominutebilling.com/help/developers/api-reference/usage-controls/preview-a-rate-change">
        <code>
          /v1/businesses/{biz}/prices/{price}/rate_change_preview
        </code>
      </a>
    </td>
    
    <td>
      Preview a rate change
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        PUT
      </code>
    </td>
    
    <td>
      <a href="https://twominutebilling.com/help/developers/api-reference/usage-controls/set-a-plan-s-usage-invoice-threshold">
        <code>
          /v1/businesses/{biz}/products/{product}/usage_invoice_thresholds/{currency}
        </code>
      </a>
    </td>
    
    <td>
      Set a plan's usage invoice threshold
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        DELETE
      </code>
    </td>
    
    <td>
      <a href="https://twominutebilling.com/help/developers/api-reference/usage-controls/remove-a-plan-s-usage-invoice-threshold">
        <code>
          /v1/businesses/{biz}/products/{product}/usage_invoice_thresholds/{currency}
        </code>
      </a>
    </td>
    
    <td>
      Remove a plan's usage invoice threshold
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        GET
      </code>
    </td>
    
    <td>
      <a href="https://twominutebilling.com/help/developers/api-reference/usage-controls/get-the-usage-widget-settings">
        <code>
          /v1/businesses/{biz}/settings/usage_widget
        </code>
      </a>
    </td>
    
    <td>
      Get the usage widget settings
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        PUT
      </code>
    </td>
    
    <td>
      <a href="https://twominutebilling.com/help/developers/api-reference/usage-controls/set-the-usage-widget-origins">
        <code>
          /v1/businesses/{biz}/settings/usage_widget
        </code>
      </a>
    </td>
    
    <td>
      Set the usage widget origins
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        GET
      </code>
    </td>
    
    <td>
      <a href="https://twominutebilling.com/help/developers/api-reference/usage-controls/list-limit-tiers">
        <code>
          /v1/businesses/{biz}/spend_limit_tiers
        </code>
      </a>
    </td>
    
    <td>
      List limit tiers
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        POST
      </code>
    </td>
    
    <td>
      <a href="https://twominutebilling.com/help/developers/api-reference/usage-controls/create-a-limit-tier">
        <code>
          /v1/businesses/{biz}/spend_limit_tiers
        </code>
      </a>
    </td>
    
    <td>
      Create a limit tier
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        GET
      </code>
    </td>
    
    <td>
      <a href="https://twominutebilling.com/help/developers/api-reference/usage-controls/retrieve-a-limit-tier">
        <code>
          /v1/businesses/{biz}/spend_limit_tiers/{tier}
        </code>
      </a>
    </td>
    
    <td>
      Retrieve a limit tier
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        PATCH
      </code>
    </td>
    
    <td>
      <a href="https://twominutebilling.com/help/developers/api-reference/usage-controls/update-a-limit-tier">
        <code>
          /v1/businesses/{biz}/spend_limit_tiers/{tier}
        </code>
      </a>
    </td>
    
    <td>
      Update a limit tier
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        DELETE
      </code>
    </td>
    
    <td>
      <a href="https://twominutebilling.com/help/developers/api-reference/usage-controls/archive-a-limit-tier">
        <code>
          /v1/businesses/{biz}/spend_limit_tiers/{tier}
        </code>
      </a>
    </td>
    
    <td>
      Archive a limit tier
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        PUT
      </code>
    </td>
    
    <td>
      <a href="https://twominutebilling.com/help/developers/api-reference/usage-controls/set-a-subscription-s-usage-invoice-threshold">
        <code>
          /v1/businesses/{biz}/subscriptions/{sub}/usage_invoice_threshold
        </code>
      </a>
    </td>
    
    <td>
      Set a subscription's usage invoice threshold
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        DELETE
      </code>
    </td>
    
    <td>
      <a href="https://twominutebilling.com/help/developers/api-reference/usage-controls/remove-a-subscription-s-override">
        <code>
          /v1/businesses/{biz}/subscriptions/{sub}/usage_invoice_threshold
        </code>
      </a>
    </td>
    
    <td>
      Remove a subscription's override
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        GET
      </code>
    </td>
    
    <td>
      <a href="https://twominutebilling.com/help/developers/api-reference/usage-controls/list-usage-alerts">
        <code>
          /v1/businesses/{biz}/usage_alerts
        </code>
      </a>
    </td>
    
    <td>
      List usage alerts
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        POST
      </code>
    </td>
    
    <td>
      <a href="https://twominutebilling.com/help/developers/api-reference/usage-controls/create-a-usage-alert">
        <code>
          /v1/businesses/{biz}/usage_alerts
        </code>
      </a>
    </td>
    
    <td>
      Create a usage alert
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        GET
      </code>
    </td>
    
    <td>
      <a href="https://twominutebilling.com/help/developers/api-reference/usage-controls/retrieve-a-usage-alert">
        <code>
          /v1/businesses/{biz}/usage_alerts/{alert}
        </code>
      </a>
    </td>
    
    <td>
      Retrieve a usage alert
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        PATCH
      </code>
    </td>
    
    <td>
      <a href="https://twominutebilling.com/help/developers/api-reference/usage-controls/update-a-usage-alert">
        <code>
          /v1/businesses/{biz}/usage_alerts/{alert}
        </code>
      </a>
    </td>
    
    <td>
      Update a usage alert
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        DELETE
      </code>
    </td>
    
    <td>
      <a href="https://twominutebilling.com/help/developers/api-reference/usage-controls/delete-a-usage-alert">
        <code>
          /v1/businesses/{biz}/usage_alerts/{alert}
        </code>
      </a>
    </td>
    
    <td>
      Delete a usage alert
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        GET
      </code>
    </td>
    
    <td>
      <a href="https://twominutebilling.com/help/developers/api-reference/usage-controls/get-the-state-of-each-threshold">
        <code>
          /v1/businesses/{biz}/usage_alerts/{alert}/states
        </code>
      </a>
    </td>
    
    <td>
      Get the state of each threshold
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        GET
      </code>
    </td>
    
    <td>
      <a href="https://twominutebilling.com/help/developers/api-reference/usage-controls/list-usage-invoice-thresholds">
        <code>
          /v1/businesses/{biz}/usage_invoice_thresholds
        </code>
      </a>
    </td>
    
    <td>
      List usage invoice thresholds
    </td>
  </tr>
</tbody>
</table>


## Sitemap

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