Cancel a subscription
You can cancel a subscription with its associated subscriptionUuid
.
- Node.js
- cURL
info
The second argument to subscriptions.cancel
represents when you want the
subscription to cancel.
When | Description |
---|---|
now | Immediately cancels the Subscription |
end | Cancels the Subscription at the end of it's billing period |
import { Salable } from '@salable/node-sdk';
const salable = new Salable('your-salable-api-key');
await salable.subscriptions.cancel('your-subscription-uuid', 'end');
info
The when
query parameter represents when you want the subscription to cancel.
When | Description |
---|---|
now | Immediately cancels the Subscription |
end | Cancels the Subscription at the end of it's billing period |
curl
-XPUT
-H 'x-api-key: your-salable-api-key'
'https://api.salable.app/subscriptions/{subscriptionUuid}/cancel?when=end'