Subscriptions

Preview a plan change

Quote moving a subscription to another plan. Read-only: nothing is charged or scheduled. The target must be a different subscription product in the same currency and billing interval, and the subscription must be active or trialing. An upgrade (higher price) is charged now, prorated; a downgrade switches at the current period end with nothing due today. Pass the returned prorationDate to the apply call so the charge matches this quote.

get/gateway/subscriptions/{id}/plan-change/preview

Request

  • Base URL: https://api.agentaos.ai/api/v1
  • URL: https://api.agentaos.ai/api/v1/gateway/subscriptions/{id}/plan-change/preview
  • Auth: API key in header x-api-key

Path parameters

idstring uuid required

Subscription id.

Query parameters

targetLinkIdstring uuid required

The target product's payment-link id.

Response

The quote. Money fields are integer minor units.

direction'upgrade' | 'downgrade' | 'revert' required

upgrade when the new plan costs more per cycle; downgrade otherwise; revert when the target is the current plan while a downgrade is pending (cancels it, nothing due).

currencystring required
dueTodayMinorinteger required

Charged now. Always 0 for a downgrade.

dueTodayVatMinorinteger required
effectiveAtstring date-time required

Upgrade: now. Downgrade: the current period end.

nextInvoiceMinorinteger required

The next regular cycle invoice on the new plan.

nextInvoiceVatMinorinteger required
nextInvoiceAtstring date-time required
prorationDateinteger required

Unix seconds. Echo it in the apply request so the charge matches this quote.

Changes

No recorded changes to this operation across all 1 revision of this API.