# The publish gate

URL: /code/builders/startup/publish-gate · Id: `page:code/builders/startup/publish-gate`

> Publishing an Offer emits every way to buy it, computes tax, and refuses an Offer that loses money on its median Customer.

[`Offer.publish`](/business/nouns/offer/publish) is where a [Startup](/business/nouns/startup)'s business compiles. One call emits every way to buy on the Startup's [Publication](/business/nouns/publication), computes tax, and refuses an [Offer](/business/nouns/offer) that loses money on its median [Customer](/business/nouns/customer).

## What it emits
| Buy link | Who buys through it |
| --- | --- |
| Hosted checkout | A person paying by card, on the Startup's [Domain](/business/nouns/domain). |
| Payment link | A [Lead](/business/nouns/lead) who said yes: one link takes the money. |
| Pricing table component | A [Visitor](/business/nouns/visitor) on the Startup's [Sites](/business/nouns/site) and [Apps](/business/nouns/app). |
| [Portal](/business/nouns/portal) entry | A Customer changing or canceling a [Subscription](/business/nouns/subscription). |
| MCP `buy` tool | An [Agent](/business/nouns/agent) buying from a chat or coding tool. |
| HTTP 402 endpoint | An Agent that pays per call. |

`prices.json`, linked from `agents.json`, lists every Offer, [Price](/business/nouns/price) and [Meter](/business/nouns/meter) for Agents that read before they buy.

Stripe is the rail. Each charge runs through the Startup's own Stripe account, and Stripe Tax computes tax on every [Order](/business/nouns/order), because the Startup is the seller of record.

## The contribution floor
Before it writes, `Offer.publish` runs one [Guard](/business/nouns/guard). The Guard reads the [Cost](/business/nouns/cost) per [Verb](/business/nouns/verb) of each [Entitlement](/business/nouns/entitlement) the Offer grants.

It starts from the [Portfolio](/business/nouns/portfolio)'s prior and shrinks toward the Startup's own readings as they arrive. The floor is the lowest Price that keeps the Startup's target margin: Cost ÷ (1 − target margin).

- When the median Customer falls below the floor, the call is refused with [`below-contribution-floor`](/code/api/errors/below-contribution-floor), which names the floor Price.
- When the median clears it and the 95th-percentile Customer does not, the Offer publishes with a usage [Limit](/business/nouns/limit) at break-even. The Offer's `atBound` behavior applies there.

## Example
A $29 monthly Offer transcribes audio at $0.02 a minute; its median Customer uses 450 minutes ($9) and its 95th-percentile Customer 2,050 ($41). At a 60% target margin the floor is $9 ÷ 0.4 = $22.50, so the Offer publishes. The heavy Customer outspends the Price, so the Offer gains a Limit of 1,450 minutes, where Cost meets $29.