Skip to content
Paykit
Esc
↑↓navigate↵open⌘Jpreview
On this page

Cancel

Exports `ScheduleCancellation`, `Resume`.

Source: packages/paykit/src/Billing/Cancel.binding.ts

ScheduleCancellation

Kind: Binding · Product: Subscription · Provides: Paykit.ScheduleCancellation

End the standing at the period boundary. Nothing is billed for the time after the close, and the account keeps what it bought until then — which is why this is a schedule and not a destroy: money outlives the click.

Scheduling a cancellation

const cancel = yield* Paykit.ScheduleCancellation(account);
const { cancelAtPeriodEnd } = yield* cancel({ dedupeKey: `cancel:${requestId}` });

Resume

Kind: Binding · Product: Subscription · Provides: Paykit.Resume

Take a scheduled cancellation back. The standing keeps running to its next boundary, so a resume before the close is the whole undo.

Resuming

const resume = yield* Paykit.Resume(account);
yield* resume({ dedupeKey: `resume:${requestId}` });

Was this page helpful?