Cancels a subscription using its ID. Defaults to cancel at next billing period unless `effective_from` is set to "immediately".

paddle_cancel_subscription(id, effective_from = NULL)

Arguments

id

Character. Required. Paddle subscription ID, e.g. "sub_abc123".

effective_from

Character or NULL. Optional. One of `"next_billing_period"` or `"immediately"`. Defaults to `"next_billing_period"`.

Value

A list with the updated subscription entity and metadata.

Examples

if (FALSE) { # paddle_has_token()
set_paddle_mode("sandbox")
result <- paddle_cancel_subscription(
 id = "sub_123",
 effective_from = "immediately"
)
}