Skip to content

Subscription methods: keep, pause, renew, resize

The Subscription Verbs keep, pause, renew, resize as typed SDK methods, with inputs, result, refusals and an example.

Reference for Subscription, one group of Subscription methods.

Subscription.keep

Keep takes back a cancel before the period closes, so the Subscription renews on its date at the same terms. Verb page.

TypeScript
interface SubscriptionVerbs {
  keep(input: SubscriptionKeepInput, options?: SB.CallOptions): SB.Call<Subscription>
}

Emits Subscription.kept.

Inputs

InputTypeRequiredDescription
subscriptionSubscriptionrequiredThe ending Subscription.
offerOfferThe Offer to renew on, when the Customer took the save offer.

Returns

OutputTypeRequiredDescription
subscriptionSubscriptionrequiredThe Subscription, active again.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.
Once the period has closed; a canceled Subscription starts again as a new onerefusedClear what the check names, then call it again.None.

Example

TypeScript
import { $ } from 'startup-builder'

const subscription = await $.Subscription.keep({ subscription: 'sub_whVFaHKWIV' })

Subscription.pause

Pause stops billing and Entitlements on a Subscription until a date, without ending it. Verb page.

TypeScript
interface SubscriptionVerbs {
  pause(input: SubscriptionPauseInput, options?: SB.CallOptions): SB.Call<Subscription>
}

Emits Subscription.paused.

Inputs

InputTypeRequiredDescription
subscriptionSubscriptionrequiredThe active Subscription.
untildaterequiredWhen billing resumes on its own.

Returns

OutputTypeRequiredDescription
subscriptionSubscriptionrequiredThe paused Subscription.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

TypeScript
import { $ } from 'startup-builder'

const subscription = await $.Subscription.pause({ subscription: 'sub_whVFaHKWIV', until: '2026-10-22' })

Subscription.renew

Renew starts a Subscription’s next period and bills it at the Offer Version the Customer accepted. Verb page.

TypeScript
interface SubscriptionVerbs {
  renew(input: SubscriptionRenewInput, options?: SB.CallOptions): SB.Call<SubscriptionRenewOutput>
}

Emits Subscription.renewed.

Inputs

InputTypeRequiredDescription
subscriptionSubscriptionrequiredThe Subscription to renew.

Returns

OutputTypeRequiredDescription
invoiceInvoicerequiredThe Invoice for the new period.
subscriptionSubscriptionrequiredThe Subscription in its new period.

Refuses when

CheckErrorFixThen call
The operation is part of an Offer the caller has not accepted or paid for.payment-requiredAccept the Offer named in the response, then retry the call.Offer.accept
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

TypeScript
import { $ } from 'startup-builder'

const { invoice, subscription } = await $.Subscription.renew({ subscription: 'sub_zgJUx08kwY' })

Subscription.resize

Resize changes how many units a Subscription holds and prorates the current period. Verb page.

TypeScript
interface SubscriptionVerbs {
  resize(input: SubscriptionResizeInput, options?: SB.CallOptions): SB.Call<Subscription>
}

Emits Subscription.resized.

Inputs

InputTypeRequiredDescription
subscriptionSubscriptionrequiredThe Subscription to change.
quantityintegerrequiredThe new unit count.

Returns

OutputTypeRequiredDescription
subscriptionSubscriptionrequiredThe Subscription at its new quantity.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

TypeScript
import { $ } from 'startup-builder'

const subscription = await $.Subscription.resize({ subscription: 'sub_whVFaHKWIV', quantity: 1 })