post https://api.reepay.com/v1/subscription//expire
Expire the subscription instantly. The operation will fail if the subscription has pending or dunning invoices. Handle these separately, e.g. by cancelling all dunning and pending. Expire can be given an optional argument describing how to compensate for the current period if already paid for with settled invoice.
Errors
The operation can generate the following errors beside the generic HTTP error codes described here.
Error code | HTTP code | Description |
---|---|---|
12 | 404 | Subscription not found |
13 | 400 | Subscription already expired |
63 | 400 | Subscription has pending or dunning invoices, these needs to be handled first |
64 | 400 | Refund compensation is used but the current billing period invoice is not in required state settled |
65 | 400 | Refund compensation is used but the refund amount exceeds the refundable amount on the current billing period invoice. The refundable amount is the setlled invoice amount minus already refunded and credited amounts. |
81 | 400 | Refund compensation is not allowed for asynchronous refund payment method |
66 | 500 | The refund compensation failed because of error at the acquirer. See transaction_error See transaction errors. |