Offer commands: trial, withdraw
The Offer Verbs trial, withdraw as CLI commands, with inputs, result, refusals and an example.
Reference for Offer, one group of Offer commands.
Offer.trial
Trial starts a Customer on an Offer free for a set number of days, with or without a card, converting or ending by its terms. Verb page.
npx startup-builder do Offer.trial --json '<input>' [--try | --send | --do]Emits Offer.trialed.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
offer | Offer | required | The Offer to try. |
customer | Customer | required | The Customer who tries it. |
days | integer | required | How long the trial runs. Never randomized. |
card | boolean | True to take a card up front and charge it when the trial ends. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
subscription | Subscription | required | The Subscription, free until the trial ends. |
offer | Offer | required | The Offer the trial is on. |
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
npx startup-builder do Offer.trial --json '{"offer": "offer_2hzYe1ERo0", "customer": "cus_K1BROJhqzZ", "days": 1}'Offer.withdraw
Withdraw closes a published Offer to new Customers and leaves every existing Order and Subscription in force. Verb page.
npx startup-builder do Offer.withdraw --json '<input>' [--try | --send | --do]Emits Offer.withdrawn.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
offer | Offer | required | The Offer to withdraw. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
offer | Offer | required | The Offer, closed to new acceptance. |
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
npx startup-builder do Offer.withdraw --json '{"offer": "offer_2hzYe1ERo0"}'