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

# Scheduled downgrades

## Canceling scheduled downgrades

Customers can cancel their scheduled downgrades in a fully self-served manner. This gives them an opportunity to stay on their current (higher-priced) plan if they change their mind.

Users with access to the [Stigg app](https://app.stigg.io) can also cancel scheduled downgrades on the customer's behalf.

<img src="https://mintcdn.com/stigg/cwvUR-sZ1iKIoz2m/images/docs/a59cb55-image.png?fit=max&auto=format&n=cwvUR-sZ1iKIoz2m&q=85&s=6e010ca42d8fad269973703a79d17c6f" alt="" width="1804" height="600" data-path="images/docs/a59cb55-image.png" />

## Purchasing additional seats when a downgrade is scheduled

If a customer who has a scheduled downgrade purchases additional seats **before** the downgrade takes effect:

1. They are **immediately charged** the **prorated** amount for the additional seats using their *current* plan’s pricing.
2. The scheduled downgrade is automatically updated to reflect the new seat quantity.

<img src="https://mintcdn.com/stigg/8tviKNnHCor59SIf/images/docs/fc58754-image.png?fit=max&auto=format&n=8tviKNnHCor59SIf&q=85&s=a662db3eaf9116a25bb3c955fb6329f4" alt="" width="1804" height="600" data-path="images/docs/fc58754-image.png" />

## Updating the unit quantity when another quantity update is already scheduled

<img src="https://mintcdn.com/stigg/zZAY_sXPTSVMcwio/images/docs/c247dde-image.png?fit=max&auto=format&n=zZAY_sXPTSVMcwio&q=85&s=7bfc3534ab99ad92fc037d740b6d2cb9" alt="" width="1804" height="600" data-path="images/docs/c247dde-image.png" />

When scheduled downgrades are enabled and:

* The customer has an original quantity **Q0**
* They request a reduction to **Q1** → a downgrade is scheduled
* They later request another quantity change to **Q2**

Stigg compares **Q2** to the **original** quantity **Q0**:

1. **If Q2 \< Q0**\
   → The scheduled update is modified from Q1 to Q2.

2. **If Q2 = Q0**\
   → The scheduled update is canceled.

3. **If Q2 > Q0**\
   → This is treated as an **upgrade**:
   * The scheduled downgrade is canceled.
   * The quantity is updated **immediately**.
   * The customer is **immediately charged** the prorated difference.

<img src="https://mintcdn.com/stigg/_E1NPxWRKvYZ5hDE/images/docs/80e8ee9-image.png?fit=max&auto=format&n=_E1NPxWRKvYZ5hDE&q=85&s=76ced0b043bacb91ca31d38d97979f74" alt="" width="1880" height="1080" data-path="images/docs/80e8ee9-image.png" />

## Example code snippet

<CodeGroup>
  ```javascript JavaScript theme={null}
  // users.length == 5

  // update seat count to 4
  users.remove(userA);
  stiggClient.reportUsage(customerId, 'feature-seats', -1);
  stiggClient.updateSubscription(subscriptionId, users.length);

  // update seat count to 3
  users.remove(userB);
  stiggClient.reportUsage(customerId, 'feature-seats', -1);
  stiggClient.updateSubscription(subscriptionId, users.length);

  // usageLimit == 5, currentUsage == 3
  const entitlement = await stiggClient.getMeteredEntitlement({  
    customerId: customerId,  
    featureId: 'feature-seats'  
  });

  // update seat count to 4
  users.Add(userC);
  stiggClient.updateSubscription(subscriptionId, users.length);
  stiggClient.reportUsage(customerId, 'feature-seats', 1);

  // end result:
  // 1. the customer will be subscribed to 4 seats at the end of the current billing cycle
  // 2. since they still didn't go over the original limit of the current billing cycle (= 5 seats), they will *not* pay for any new seat
  ```
</CodeGroup>

<Note>
  For information about how scheduled updates interact with plan/add-on changes and their visibility in the Stigg app and Customer Portal, see [Scheduled updates](./scheduled-updates).
</Note>
