Skip to content
ProductWhat you sellOffer

Offer commands: list, update, delete

The Offer Verbs list, update, delete as CLI commands, with inputs, result, refusals and an example.

Offer.publishMode do
curl -X POST https://api.sb/leaseline.app/offers/offer_2hzYe1ERo0/publish \
  -H "Authorization: Bearer $SB_TOKEN"
API referenceOffer.publish
npx startup-builder do Offer.publish --data '{"offer":"offer_2hzYe1ERo0"}'
CLI referenceOffer.publish
{
  "name": "do",
  "arguments": {
    "code": "return await $.Offer.publish({ offer: 'offer_2hzYe1ERo0' })"
  }
}
MCP referenceOffer.publish
import { $ } from 'startup-builder'

const offer = await $.Offer.publish({ offer: 'offer_2hzYe1ERo0' })
SDK referenceOffer.publish

Reference for Offer, one group of Offer commands.

Offer.list

Returns Offers, newest first, one page at a time. Verb page.

Text
npx startup-builder do Offer.list --data '<input>' [--try]

Reads only: it emits no Event.

Inputs

InputTypeRequiredDescription
limitintegerAt most this many records, up to 100. The default is 20.
afterstringThe cursor from the previous page.
wherestringA filter over the properties in the where grammar, such as paidAt = null and total.amount > 500 (/code/api/guides/pagination-and-filtering#the-where-grammar).
sortstringProperties to sort by, comma-separated; a leading minus sorts descending.
totalbooleanTrue adds the match count as meta.total, exact up to 10,000 matches and estimated above.
facetsstringProperties to count by value, comma-separated, returned as meta.facets.
fieldsstringProperties to return on each record, comma-separated; $id and $type always return.
includestringRelated records to embed in place of their URLs, comma-separated.
depthintegerHow many levels of related records to embed. The default is 1.
qstringWords to match across the text properties, ranked by relevance.
matchstringRanks the search by words, or meaning; words is the default.

Returns

OutputTypeRequiredDescription
offerslist of OfferrequiredOne page of Offers.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operationforbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.
match is not one of words or meaninginvalid-inputSend match as one of words or meaning.None.

Example

Terminal
npx startup-builder do Offer.list --data '{"limit":20}'

Offer.update

Changes the given properties of an Offer. Verb page.

Text
npx startup-builder do Offer.update --data '<input>' [--try | --send | --do]

Emits Offer.updated.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Offer.
pricemoneyThe amount and currency per period, or per unit its meter counts. Zero is a price. Never randomized.
termstextThe conditions the Customer accepts, refund rights included. Never randomized.
fromstringLineage: the slot it compiles from, as Hypothesis#<slot>@v<version>.
activationjsonThe Event, count and window that mark a Customer activated, such as Reminder.sent 20 times within 7 days.
creditmoneyThe Credit Grant each purchase issues, for an Offer that sells prepaid credit, such as $50 of calls.
namestringThe name buyers see on the pricing table and the invoice, such as Pro. A declared Offer answers to its file name as its slug.
atBoundstringWhat 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).
intervalstringHow often it bills: once, day, week, month or year.
availableFromdatetimeWhen it can first be bought. Unset: from when it is published.
availableUntildatetimeWhen it can last be bought. Existing Subscriptions continue past it.
trialjsonThe free trial every new Customer starts with: days, and card true to take a card up front. Unset: no trial.
seatsstringHow a per-seat Price counts: manual (the buyer sets the quantity) or members (people in the Customer’s Tenant, prorated as they change).
uptimejsonThe monthly uptime it promises, and the share of that month’s charge credited back below each level.
licensestringWhat a buyer may do with the records it sells: use them internally, display them to its own users, or redistribute them.
attributiontextThe credit line a buyer shows wherever the records appear.
privateToPartyThe one Party who sees it and may accept it, making it a private Offer; no pricing page lists it.
meterMeterThe Meter whose count it bills, for a usage-priced Offer: each unit the Meter counts bills at price.
refundablebooleanTrue for a refundable deposit: refunded in full on request before shipBy, and to every buyer when shipBy passes unshipped.
shipBydateThe date a deposit Offer promises to ship by; past it unshipped, every deposit refunds on its own.
productProductThe Product it sells. Omitted on create: the Startup’s only Product; with several, the call is refused with invalid-input until one is named.
convertsTostringWhat a deposit pays at ship: firstInvoice (the first period of a Subscription) or firstOrder (the first Order).

Returns

OutputTypeRequiredDescription
offerOfferrequiredThe Offer.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operationforbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.
id is missing, or is not a stringinvalid-inputSend id as a string, then call it again.None.
atBound is not one of stop, overage or upgradeinvalid-inputSend atBound as one of stop, overage or upgrade.None.
interval is not one of once, day, week, month or yearinvalid-inputSend interval as one of once, day, week, month or year.None.
seats is not one of manual or membersinvalid-inputSend seats as one of manual or members.None.
license is not one of internal, display or redistributeinvalid-inputSend license as one of internal, display or redistribute.None.
product: omitted on create: the Startup’s only Product; with several, the call is refused with invalid-input until one is namedinvalid-inputSend product, then call it again.None.
convertsTo is not one of firstInvoice or firstOrderinvalid-inputSend convertsTo as one of firstInvoice or firstOrder.None.
The Idempotency-Key was sent before with another operation or other inputidempotency-mismatchSend a new key for new input; reuse a key only to retry the same request.None.

Example

Terminal
npx startup-builder do Offer.update --data '{"id":"offer_2hzYe1ERo0","price":{"amount":29,"currency":"USD"}}' \
  --idempotency-key leaseline-offer-update-1

Offer.delete

Deletes an Offer: a soft delete that keeps its history, undone by Thing.restore. Verb page.

Text
npx startup-builder do Offer.delete --data '<input>' [--try | --send | --do]

Emits Offer.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Offer.

Returns

OutputTypeRequiredDescription
offerOfferrequiredThe Offer.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operationforbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.
id is missing, or is not a stringinvalid-inputSend id as a string, then call it again.None.
The Idempotency-Key was sent before with another operation or other inputidempotency-mismatchSend a new key for new input; reuse a key only to retry the same request.None.

Example

Terminal
npx startup-builder do Offer.delete --data '{"id":"offer_2hzYe1ERo0"}' \
  --idempotency-key leaseline-offer-delete-1