Closed augustynglowacki closed 10 months ago
Turns out it was just a typo bug, I used "cancelled" instead of "canceled", for anyone in the future, the method for cancelation is:
await swell.put('/subscriptions/{id}', {
id: subscription.id,
canceled: true,
});
Hello!
I was wondering how to cancel a subscription plan using the Swell's backend api. With the frontend-api, there seems to be an easy method, documented here: https://developers.swell.is/frontend-api/subscriptions#cancel-a-subscription
However, for the backend, I can't find a way to cancel the subscription plan in any other way than to just use the admin panel manually.
You can change non-critical fields of the subscription plan using swell.put method, just like the one below:
However, using this code results in the API throwing errors about read-only fields.
Additionally, Swell docs mention a more "Raw" methods for updating the subscription plans, without the swell-node wrapper. https://developers.swell.is/backend-api/subscription-plans/update-a-subscription I sadly couldn't get any of the requests without the swell-node wrapper to return 200 for me - it is always either 401 or 404. I guess logically,
swell.put('/subscriptions/{id}')
should be an equivalent of the raw request method.It would be wonderful to get a feedback on the possibilities of the backend subscription plan status manipulation. Thanks!