Skip to main content

Change plan

METHODURL
POST/subscriptions/{subscriptionId}/change-plan
EXAMPLEhttps://test.api.macropay.com/v2/subscriptions/{subscriptionId}/change-plan

Endpoint for changing a subscription plan. Changing the plan is only allowed if the subscription currency is also among the allowed currencies for the new plan. The subscription only accepts plan changes if it is active or paused, and the change will take effect in the next cycle, not in the current one.


REQUEST BODY EXAMPLE - CHANGE PLAN

{
"targetPlanId": "22f71498-d518-49e4-aae4-2585e0800e8e"
}

SUCCESS RESPONSES - CHANGE PLAN

HTTP CODEDESCRIPTION
200Subscription plan has been changed and the response is in the body in JSON format.

SUCCESS RESPONSE EXAMPLE - CHANGE PLAN

{
"id": "0195146b-fb77-73b4-bb92-ba8bc2180433",
"planId": "22f71498-d518-49e4-aae4-2585e0800e8e",
"status": "fulfilled",
"cycle": 1,
"createdAt": "2025-02-17T15:00:12.491953Z",
"modifiedAt": "2025-02-17T15:07:14.095555Z"
}

ERROR RESPONSES - CHANGE PLAN

HTTP CODEERROR CODEERROR MESSAGEDESCRIPTION
5000900Internal Server ErrorThe server experienced an unexpected error.
4040020Subscription not foundSubscription %s not found
4090021Subscription status invalidThe subscription only accepts plan changes if it is active or paused
4000022Plan ID not foundThe new plan must exist
4090023Currency mismatchThe subscription currency is not in the allowed currencies for the new plan