Cancel subscription
METHOD | URL |
---|---|
POST | /subscriptions/{subscriptionId}/cancel |
EXAMPLE | https://test.api.macropay.com/v2/subscriptions/{subscriptionId}/cancel |
Endpoint to cancel a subscription.
REQUEST BODY EXAMPLE - CANCEL SUBSCRIPTION
{
"cancellationDetail”: "Testing cancellation"
}
SUCCESS RESPONSES - CANCEL SUBSCRIPTION PAYMENTS
HTTP CODE | DESCRIPTION |
---|---|
200 | Subscription has been cancelled and the response is in the body in JSON format. |
SUCCESS RESPONSE EXAMPLE - CANCEL SUBSCRIPTION
{
"id": "0195146b-fb77-73b4-bb92-ba8bc2180433",
"planId": "4aa7c1e4-cf8c-4d1c-a6ad-451dd07411ee",
"status": "cancelled",
"cycle": 1,
"cancellation": {
"reason": "merchant_api",
"detail": "Testing cancellation",
"requestedAt": "2025-02-17T15:07:14.095549Z"
},
"createdAt": "2025-02-17T15:00:12.491953Z",
"modifiedAt": "2025-02-17T15:07:14.095555Z"
}
ERROR RESPONSES - CANCEL SUBSCRIPTION
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 |