Preview prorated cost for a plan upgrade
POST
/billing/upgrade/preview
const url = 'https://api.krakenkey.io/billing/upgrade/preview';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"plan":"pro","interval":"month","prorationDate":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.krakenkey.io/billing/upgrade/preview \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "plan": "pro", "interval": "month", "prorationDate": 1 }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
plan
required
Plan to upgrade to
string
Example
businessinterval
Billing interval after the upgrade; the current one when left out
string
prorationDate
The prorationDate from the upgrade preview, so the charge matches what it showed. Ignored when older than an hour
number
Responses
Section titled “Responses”Upgrade preview details
Invalid upgrade path
Unauthorized
No active subscription