Subscriptions

Preview subscription plan change

Changed on

Use when showing a customer the cost of a plan change before they confirm (e.g. upgrade/downgrade preview with proration).

post/subscriptions/{id}/change/preview

Request

  • Base URL
    https://us.api.flexprice.io/v1
  • URL
    https://us.api.flexprice.io/v1/subscriptions/{id}/change/preview
  • Auth
    API key in header x-api-key

Path parameters

idstring required

Subscription ID

Request body

billing_cadence'RECURRING' required
billing_cycle'anniversary' | 'calendar' required
billing_period'MONTHLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY' | 'QUARTERLY' | 'HALF_YEARLY' | 'ONETIME' required
billing_period_countinteger

billing_period_count is the billing period count for the new subscription

change_at'immediate' | 'end_of_period'
metadataobject

metadata contains additional key-value pairs for storing extra information

proration_behavior'create_prorations' | 'none' required
target_plan_idstring required

target_plan_id is the ID of the new plan to change to (required)

Response

OK

change_type'upgrade' | 'downgrade' | 'lateral'
effective_datestring date-time

effective_date is when the change would take effect

metadataobject

metadata from the request

subscription_idstring

subscription_id is the ID of the subscription being changed

warningsstring[]

warnings contains any warnings about the change

Changes

    • warning

      added the new not_implemented enum value to the response property for the response status

    • warning

      added the new not_implemented enum value to the response property for the response status

    • warning

      added the new not_implemented enum value to the response property for the response status

    • info

      the request property default value 1 was removed

    • info

      the response's property default value 1 was removed for the status