Change plan
| METHOD | URL |
|---|---|
| POST | /subscriptions/{subscriptionId}/change-plan |
| EXAMPLE | https://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 CODE | DESCRIPTION |
|---|---|
| 200 | Subscription 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 CODE | ERROR CODE | ERROR MESSAGE | DESCRIPTION |
|---|---|---|---|
| 500 | 0900 | Internal Server Error | The server experienced an unexpected error. |
| 404 | 0020 | Subscription not found | Subscription %s not found |
| 409 | 0021 | Subscription status invalid | The subscription only accepts plan changes if it is active or paused |
| 400 | 0022 | Plan ID not found | The new plan must exist |
| 409 | 0023 | Currency mismatch | The subscription currency is not in the allowed currencies for the new plan |