Change the plan of an existing subscription
curl --request POST \
--url https://api.sitespy.app/api/v1/billing/change-plan \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"billing_period": "monthly",
"confirm_leave_legacy": true
}
'import requests
url = "https://api.sitespy.app/api/v1/billing/change-plan"
payload = {
"billing_period": "monthly",
"confirm_leave_legacy": True
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({billing_period: 'monthly', confirm_leave_legacy: true})
};
fetch('https://api.sitespy.app/api/v1/billing/change-plan', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"ok": true,
"plan": "<string>",
"invoiced_now": true,
"portal_url": "<string>"
}Billing
Change the plan of an existing subscription
Moves the account’s current Lemon Squeezy subscription to another plan instead of opening a
second one. The switch is immediate: upgrades are invoiced now (prorated), downgrades leave a
credit on the next invoice. Leaving the grandfathered €8 Pro needs confirm_leave_legacy: true.
A PayPal subscription cannot be changed through the API; the response then carries
portal_url, where the customer finishes the change.
POST
/
billing
/
change-plan
Change the plan of an existing subscription
curl --request POST \
--url https://api.sitespy.app/api/v1/billing/change-plan \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"billing_period": "monthly",
"confirm_leave_legacy": true
}
'import requests
url = "https://api.sitespy.app/api/v1/billing/change-plan"
payload = {
"billing_period": "monthly",
"confirm_leave_legacy": True
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({billing_period: 'monthly', confirm_leave_legacy: true})
};
fetch('https://api.sitespy.app/api/v1/billing/change-plan', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"ok": true,
"plan": "<string>",
"invoiced_now": true,
"portal_url": "<string>"
}Authorizations
API key for authentication. You can find your API key in the Site Spy dashboard under Settings → API.
Body
application/json

