Offer programs: create, get, list
The Offer Verbs create, get, list as MCP do programs, with inputs, result, refusals and an example.
Reference for Offer, one group of Offer programs.
Offer.create
Creates an Offer. Verb page.
do: return await $.Offer.create(input)Emits Offer.created.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
price | money | required | The amount, currency, and unit. Zero is a price. Never randomized. |
terms | text | The conditions the Customer accepts, refund rights included. Never randomized. | |
from | string | Lineage: the slot it compiles from, as Hypothesis#<slot>@v<version>. | |
activation | json | The Event, count and window that mark a Customer activated, such as Reminder.sent 20 times within 7 days. | |
credit | money | The Credit Grant each purchase issues, for an Offer that sells prepaid credit, such as $50 of calls. | |
atBound | string | What a call past an Entitlement’s Limit gets: stop, overage or upgrade (refuse it, bill it through the Meter, or move to the next Offer). | |
interval | string | How often it bills: once, day, week, month or year. | |
availableFrom | datetime | When it can first be bought. Unset: from when it is published. | |
availableUntil | datetime | When it can last be bought. Existing Subscriptions continue past it. | |
trial | json | The free trial every new Customer starts with: days, and card true to take a card up front. Unset: no trial. | |
seats | string | How a per-seat Price counts: manual (the buyer sets the quantity) or members (people in the Customer’s Tenant, prorated as they change). | |
uptime | json | The monthly uptime it promises, and the share of that month’s charge credited back below each level. | |
license | string | What a buyer may do with the records it sells: use them internally, display them to its own users, or redistribute them. | |
attribution | text | The credit line a buyer shows wherever the records appear. | |
privateTo | Party | The one Party who sees it and may accept it, making it a private Offer; no pricing page lists it. | |
product | Product | Each Offer sells one Product; one Product sits inside many Offers at different prices and terms. | |
brand | Brand | Each Offer carries exactly one Brand, whose name, voice and logo the buyer sees. | |
motion | Motion | Each Offer sells through one Motion, which says who buys and who acts for them. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
offer | Offer | required | The Offer. |
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 $.Offer.create({ price: { amount: 29, currency: 'USD' } })"
}
}Offer.get
Returns one Offer by id. Verb page.
do: return await $.Offer.get(input)Reads only: it emits no Event.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
id | string | required | The id of the Offer. |
at | string | A time or Version name: the record as it stood then. Unset: as it stands now. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
offer | Offer | required | The Offer. |
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 $.Offer.get({ id: 'offer_2hzYe1ERo0' })"
}
}Offer.list
Returns Offers, newest first, one page at a time. Verb page.
do: return await $.Offer.list(input)Reads only: it emits no Event.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
limit | integer | At most this many records, up to 100. The default is 20. | |
after | string | The cursor from the previous page. | |
where | string | A filter over the properties, such as paidAt = null and total.amount > 500. | |
sort | string | Properties to sort by, comma-separated; a leading minus sorts descending. | |
total | boolean | True adds the match count as meta.total, exact up to 10,000 matches and estimated above. | |
facets | string | Properties to count by value, comma-separated, returned as meta.facets. | |
fields | string | Properties to return on each record, comma-separated; $id and $type always return. | |
include | string | Related records to embed in place of their URLs, comma-separated. | |
depth | integer | How many levels of related records to embed. The default is 1. | |
q | string | Words to match across the text properties, ranked by relevance. | |
match | string | Ranks the search by words, or meaning; words is the default. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
offers | list of Offer | required | One page of Offers. |
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 $.Offer.list({ limit: 20 })"
}
}