Payments
host.payments.checkout({ price }) lets an app sell something and be paid
into the app owner's own Stripe account. You create the Prices in your
Stripe dashboard, enable them for the app in Settings > Sales, and the app
asks for one by its id. The platform opens Stripe's hosted page outside the
app's frame and tells the app whether the sale went through.
You are the seller. Robutler takes a fee on each sale, deducted by Stripe, and never holds the money. Refunds and disputes are handled in your Stripe account. Nothing here touches credits: a sale never becomes credits, and credits never pay for a sale.
Set up
- In Settings > Sales, connect your Stripe account (a Stripe-hosted onboarding; you keep your own dashboard and agreement).
- In your Stripe dashboard, create a Product with a one-time Price.
- Back in Settings > Sales, tick the Prices the app may sell. The fee Robutler takes on each sale is shown there.
Recurring Prices are listed but cannot be enabled yet.
Ask for a payment
button.addEventListener('click', async () => {
const r = await host.payments.checkout({ price: 'price_1Q...' });
if (r.status === 'paid') unlockTheThing();
else showNotBought(r.reason);
});Call it from a click. The platform shows its own confirmation naming you, the app and the price, then opens Stripe's page in a new tab. The promise resolves when Stripe has confirmed the payment, when the person gives up, or after thirty minutes.
| Result | Meaning |
|---|---|
{ status: 'paid', id } | Stripe confirmed the payment on your account. id is the Checkout Session id, which you can match in your Stripe dashboard. |
{ status: 'cancelled', reason: 'declined' } | The person chose not to continue. |
{ status: 'cancelled', reason: 'not_connected' } | The owner has no Stripe account connected that can take payments. Show a "not available" state. |
{ status: 'cancelled', reason: 'price_not_enabled' } | That Price is not enabled for this app. |
{ status: 'cancelled', reason: 'price_not_found' } | Not an active one-time Price on the owner's account. |
{ status: 'cancelled', reason: 'not_available' } | Payments are not available on this platform or surface. |
{ status: 'cancelled', reason: 'sign_in_required' } | The person is not signed in; offer host.ui.signIn style sign-in. |
{ status: 'cancelled', reason: 'busy' } | Another checkout from this app is still open. |
{ status: 'cancelled', reason: 'timeout' } | No verdict within the wait. |
What the app cannot do
The app names a Price and, optionally, a quantity, and nothing else. These
keys are refused by name, each with its own message: amount, unit_amount,
currency, fee, account, seller, success_url, cancel_url, url,
customer, email, metadata, shipping, shipping_options,
shipping_address_collection, tax, automatic_tax. The amount is the
Price's, the seller is the owner, the return pages are the platform's, and
the buyer is whoever is using the app.
Physical goods
For goods you ship, set how the app sells in Settings > Sales: physical goods, the countries you ship to, your own Stripe Shipping Rates, the most units per order, and Stripe Tax. Stripe's page then asks the buyer for a delivery address and adds shipping and any tax. Each size or colour is its own Price that you enable. The app may pass how many the person wants:
const r = await host.payments.checkout({ price: 'price_1Q...', quantity: 2 });quantity is a whole number; above your maximum the checkout is refused
before Stripe's page opens. Robutler's fee is taken from the item total only,
never from shipping or tax.
The app never sees who paid and gets no amount back. Stripe sends the receipt from your account. If you need to know what was bought, the Price id you asked for is what was bought.
Copies
A remix of your app is a different app with a different owner. It cannot sell on your Prices: its owner connects their own Stripe account and enables their own.
host.ui
The MCP Apps UI bridge that lets bundles authored for external MCP hosts (Claude, ChatGPT, MCP-UI) run in-portal unchanged.
Attribution
How an app's rewards are shared with the code it runs on. How kept code is measured in a remix, how marks are counted, how a contributor accepts credit, and how a library author claims a library.