Subscription programs: resume, switch, unsubscribe
The Subscription Verbs resume, switch, unsubscribe as MCP do programs, with inputs, result, refusals and an example.
Reference for Subscription, one group of Subscription programs.
Subscription.resume
Resume restarts billing and Entitlements on a paused Subscription before its pause ends. Verb page.
do: return await $.Subscription.resume(input)Emits Subscription.resumed.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
subscription | Subscription | required | The paused Subscription. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
subscription | Subscription | required | The active Subscription. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
{
"name": "do",
"arguments": {
"code": "return await $.Subscription.resume({ subscription: 'sub_0Ij6oxjf6k' })"
}
}Subscription.switch
Switch moves a Subscription to another Offer and prorates the current period. Verb page.
do: return await $.Subscription.switch(input)Emits Subscription.switched.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
subscription | Subscription | required | The Subscription to move. |
offer | Offer | required | The Offer to move to. |
effectiveAt | datetime | When the move takes effect; moving existing Customers to a higher Price waits at least the notice period. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
subscription | Subscription | required | The Subscription on its new Offer. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The input does not match the schema of the operation. | invalid-input | Read the schema of the operation, then send every required field with the right type. | None. |
| The operation is part of an Offer the caller has not accepted or paid for. | payment-required | Accept the Offer named in the response, then retry the call. | Offer.accept |
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
| The record is not in a state that allows this Verb, so the call is refused. | refused | Read the record, run the Verb that moves it to an allowed state, then retry. | None. |
Example
{
"name": "do",
"arguments": {
"code": "return await $.Subscription.switch({ subscription: 'sub_whVFaHKWIV', offer: 'offer_2hzYe1ERo0' })"
}
}Subscription.unsubscribe
Unsubscribe ends a Subscription at the close of its current period, and the Customer keeps access until then. Verb page.
do: return await $.Subscription.unsubscribe(input)Emits Subscription.unsubscribed.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
subscription | Subscription | required | The Subscription to end. |
reason | text | Why the Customer leaves. | |
comment | text | The Customer’s own words, kept verbatim as the Evidence quote. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
subscription | Subscription | required | The Subscription, ending. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
| The record is not in a state that allows this Verb, so the call is refused. | refused | Read the record, run the Verb that moves it to an allowed state, then retry. | None. |
Example
{
"name": "do",
"arguments": {
"code": "return await $.Subscription.unsubscribe({ subscription: 'sub_whVFaHKWIV' })"
}
}