Billing

Proration preview of a plan change: what is charged now and what changes (billing:read)

post/billing/subscription/preview

Request

  • Base URL: https://hostingsurge.com/api/v1
  • URL: https://hostingsurge.com/api/v1/billing/subscription/preview
  • Auth: one of:
    • HTTP bearer
    • API key in cookie __Host-hs_session

Query parameters

orgIdstring

Organization id (required when you belong to several)

lang'en' | 'sv'

Language of labels and Stripe pages (default en)

Request body

planId'free' | 'pro' | 'business' required
interval'month' | 'year'

Response

Preview

planId'free' | 'pro' | 'business' required
interval'month' | 'year' required
change'upgrade' | 'downgrade' | 'interval' | 'cancel' | 'resume' | 'none' required
effective'immediately' | 'period_end' required
prorationDateinteger nullable required

unix seconds; send it back when confirming so the charge matches this preview

currencystring required
amountDueNowinteger required

charged right away (upgrades are invoiced immediately; downgrades become a credit on the next invoice)

subtotalinteger required

minor units (cents)

taxinteger nullable required

minor units (cents)

totalinteger required

minor units (cents)

trialboolean required

the subscription is in its free trial: nothing is charged until it ends

Changes

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