Switch subscription plan
post
https://app.iteras.dk/api/customers/switchsubscriptionplan/
The /api/customers/switchsubscriptionplan/ endpoint switches a subscription over to a new campaign. The switch is done immediately: the ongoing period is stopped and a successor is created with the new campaign.
Parameters
-
id string requiredID of the customer the subscription belongs to.
-
subscription_id string requiredID of the subscription to switch plan for.
-
new_campaign_id string requiredID of the campaign to switch to.
-
renewed booleanVery rarely useful. Can be set to
falsein the specific case where you want the newly created period to be treated as if it was the first period of the subscription - e.g. inside Iteras you can set up the invoice timing machinery to advance or delay invoicing of the first period.
Examples
POST /api/customers/switchsubscriptionplan/ HTTP/1.1
Content-Type: application/json{
"id": "12345",
"subscription_id": "32142532",
"new_campaign_id": "3months"
}The endpoint returns the ID of the switched subscription:
{ "subscription_id": "32142532" }
Errors
Invalid requests due to programming error, e.g. invalid JSON, returns 400.
A well-formed operation where a supplied value is invalid is not executed and returns an HTTP 422 error. Errors that are not specific to a field are returned with the empty string as key, e.g. an unknown subscription, an unknown campaign, a subscription that is not active, or a campaign that cannot be used for the subscription:
{
"": ["The subscription is not active."]
}