---
title: "Preview a rate change"
description: "Re-rates each customer's last closed period of usage on this price under a draft rate card, before you save it."
canonical_url: "https://twominutebilling.com/help/developers/api-reference/usage-controls/preview-a-rate-change"
---
# Preview a rate change

> Re-rates each customer's last closed period of usage on this price under a draft rate card, before you save it.

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

The period is the window of the customer's last finalized period invoice. `old_minor` rates that usage under the customer's current rate (the invoiced amount when the rate did not change in that period); `new_minor` under the draft. Fields you leave out keep their current values. Sorted by `diff_minor`, largest increase first, in pages of up to 200; at most 5,000 customers per request (`truncated` says when there are more). Writes nothing. Tax, discounts, credits and minimums are not applied.

## 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>
  
  <tr>
    <td>
      <code>
        price
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      <strong>
        yes
      </strong>
    </td>
    
    <td>
      The usage price (<code>
        pro-monthly-usd
      </code>
      
      ).
    </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>
        unit_amount_decimal
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Meter prices: the default rate, minor units per <code>
        quantity_divisor
      </code>
      
       units. A decimal string with at most 12 decimal places and no exponent, for example <code>
        "0.25"
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        quantity_divisor
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Meter prices: the number of units the rate is for, a whole number of 1 or more.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        tiers
      </code>
    </td>
    
    <td>
      <code>
        array of object
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      The tiers. Meter prices take <code>
        {up_to, unit_amount_decimal, flat_amount_minor}
      </code>
      
      ; other usage prices take <code>
        {upToMinor, unitAmountMinor, flatAmountMinor}
      </code>
      
      , as on the price.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        rates
      </code>
    </td>
    
    <td>
      <code>
        array of object
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Meter prices: the whole rate card. It replaces the current one.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        rates.match
      </code>
    </td>
    
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      <strong>
        yes
      </strong>
    </td>
    
    <td>
      The rate's match.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        rates.unit_amount_decimal
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      The rate's unit amount decimal.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        rates.tiers
      </code>
    </td>
    
    <td>
      <code>
        array of object
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      The rate's tiers.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        amount_minor
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Usage prices not on a meter: the unit amount in minor units.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        limit
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Page size, 1–200 (default 200).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        starting_after
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      no
    </td>
    
    <td>
      Cursor: the last row's <code>
        customer
      </code>
      
       from the previous page.
    </td>
  </tr>
</tbody>
</table>

## Response

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

<tbody>
  <tr>
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The object type; always <code>
        rate_change_preview
      </code>
      
      . One of <code>
        rate_change_preview
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        price
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The price's id (a slug id, e.g. <code>
        pro-monthly-usd
      </code>
      
      ).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        currency
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The rate change preview's currency (ISO-4217 code).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        basis
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The rate change preview's basis. One of <code>
        last_closed_period
      </code>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        totals
      </code>
    </td>
    
    <td>
      <code>
        object
      </code>
    </td>
    
    <td>
      The rate change preview's totals.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        customers_without_usage
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      Customers on the price with no finalized period invoice yet.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        truncated
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      More than 5,000 customers are on the price.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        data
      </code>
    </td>
    
    <td>
      <code>
        array of object
      </code>
    </td>
    
    <td>
      The rows on this page.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        data.customer
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The customer's id (cus_…).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        data.customer_name
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      The rate change preview's customer name.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        data.subscriptions
      </code>
    </td>
    
    <td>
      <code>
        array of string
      </code>
    </td>
    
    <td>
      The rate change preview's subscriptions.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        data.period_start
      </code>
    </td>
    
    <td>
      <code>
        string · ISO-8601
      </code>
    </td>
    
    <td>
      The start of the period the rate change preview covers (ISO-8601 UTC).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        data.period_end
      </code>
    </td>
    
    <td>
      <code>
        string · ISO-8601
      </code>
    </td>
    
    <td>
      The rate change preview's period end.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        data.old_minor
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      The old in minor units (integer), e.g. 2900 = $29.00.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        data.new_minor
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      The new in minor units (integer), e.g. 2900 = $29.00.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        data.diff_minor
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      The diff in minor units (integer), e.g. 2900 = $29.00.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        data.diff_bps
      </code>
    </td>
    
    <td>
      <code>
        integer
      </code>
    </td>
    
    <td>
      The change in basis points of <code>
        old_minor
      </code>
      
      ; null when <code>
        old_minor
      </code>
      
       is 0.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        has_more
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      Whether more rows exist after this page.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        next_cursor
      </code>
    </td>
    
    <td>
      <code>
        string
      </code>
    </td>
    
    <td>
      Pass as <code>
        starting_after
      </code>
      
       to get the next page. Null on the last page.
    </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 preview.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        400
      </code>
    </td>
    
    <td>
      The price has no rate, or the draft is not a valid rate card. <code>
        param
      </code>
      
       names the field.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        404
      </code>
    </td>
    
    <td>
      No such price.
    </td>
  </tr>
</tbody>
</table>
</template>

<template v-slot:request="">

```bash [Request]
curl -X POST "$TMBILLING_URL/v1/businesses/biz_XXXXXXXXXXXX01/prices/pro-monthly-usd/rate_change_preview" \
  -H "Authorization: Bearer $TMBILLING_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount_minor": 2900
  }'
```

</template>

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

```json [200 OK]
{
  "object": "rate_change_preview",
  "price": "pro-monthly-usd",
  "currency": "USD",
  "basis": "last_closed_period",
  "totals": {
    "customers": 1,
    "old_minor": 2900,
    "new_minor": 2900,
    "diff_minor": 2900,
    "diff_bps": 1000
  },
  "customers_without_usage": 1,
  "truncated": false,
  "data": [
    {
      "customer": "cus_XXXXXXXXXXXX01",
      "customer_name": "Maya Castillo",
      "subscriptions": [
        "sub_XXXXXXXXXXXX01"
      ],
      "period_start": "2026-03-14T09:30:00Z",
      "period_end": "2026-04-14T09:30:00Z",
      "old_minor": 2900
    }
  ],
  "has_more": false,
  "next_cursor": null
}
```

```json [400 Bad Request]
{
  "error": {
    "type": "invalid_request_error",
    "message": "The price has no rate, or the draft is not a valid rate card."
  }
}
```

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

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


## Sitemap

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