---
title: "Verify a midcycle upgrade matches the previewed proration"
description: "Upgrade a sandbox subscription during a controlled billing period and reconcile the displayed adjustment with the resulting invoice and new entitlements."
canonical_url: "https://vostride.com/agent-library/billing-subscriptions/midcycle-upgrade-proration.md"
md_url: "https://vostride.com/agent-library/billing-subscriptions/midcycle-upgrade-proration.md"
content_kind: "recipe"
topic: "billing-subscriptions"
---

# Verify a midcycle upgrade matches the previewed proration

Upgrade a sandbox subscription during a controlled billing period and reconcile the displayed adjustment with the resulting invoice and new entitlements.

## Risk

Proration errors arise when preview and commit use different prices, quantities, or effective times. Exact expected amounts should come from an independent fixture calculation under the application policy, not from copying the displayed total.

## Fixtures

- A sandbox subscription halfway through a fixed period with known old and new plan prices.
- A controlled billing clock and documented rounding, tax, credit, and effective-time rules.
- An independent expected-proration fixture and hooks reading the resulting invoice and entitlement state.

## Steps

1. Open the upgrade dialog and verify the existing plan, selected replacement plan, billing interval, and effective date.
2. Compare the previewed credit, new-plan charge, tax, and net due against the independent fixture values at the controlled timestamp.
3. Confirm the upgrade once and verify the interface shows the new plan and documented renewal amount.
4. Exercise one feature newly included in the upgraded plan and verify a persisted allowed result.
5. Inspect the invoice and subscription hooks; verify line amounts, quantity, effective timestamp, and active plan match the accepted preview and fixture calculation.

## Expected results

- The upgrade invoice implements the documented proration and rounding rules.
- The subscription switches to the intended plan at the intended time.
- Newly included capabilities become usable without creating a second active subscription.

## False-pass traps

- Comparing two UI totals generated by the same faulty calculation is not an independent oracle.
- An uncontrolled clock near a billing boundary can explain a legitimate preview change and must not be mistaken for deterministic evidence.

## Cleanup

- Restore or cancel the disposable sandbox subscription and remove the feature-check resource.

## Use with agent-qa

Adapt this test design to your application's acceptance criteria and configured target using the [recipe execution guide](/agent-library/software-factory/turn-a-recipe-into-an-agent-qa-test.md). External fixture setup and non-UI checks require your own supported hooks or test tooling. Validate the authored test, execute it, and inspect the completed evidence; this recipe is not a recorded test result.

## References

- [agent-qa test](/docs/agent-qa/configuration/test.md)
- [agent-qa hooks](/docs/agent-qa/guides/hooks.md)
- [agent-qa auth state](/docs/agent-qa/guides/auth-state.md)

- [Billing and subscription QA recipes](/agent-library/billing-subscriptions.md)
- [Software factory QA library](/agent-library.md)
