Skip to main content
Cancels a subscription. Cancellation is immediate and irreversible. The subscription status is set to Cancelled and no further charges can be processed. Either the subscriber or the merchant who owns the plan can cancel.

Parameters


Authorization

The caller must be either:
  • The subscriber on the subscription, or
  • The merchant on the plan the subscription belongs to.
Any other caller will fail with Unauthorized.

Return value

None (void).

Events emitted


Error cases


Examples

Cancellation does not issue a refund. If the merchant wants to refund remaining time, they should call refund() separately. The token allowance remains on-chain but becomes irrelevant since the contract will never call transfer_from on a cancelled subscription.