How it works
Your app never collects card details and never tells Allternit what to charge. It describes a purchase, and Allternit prices, charges, and reports back.- Onboard. You connect a Stripe Connect Express account through Allternit. Charges for your app go to that account.
- Create a session. Your MCP server builds a checkout session: line items, totals, currency, your connected account as the merchant, and legal links.
- Request checkout. Your View sends the session to the host with
x-allternit/requestCheckout. - Validate. The Allternit API validates the session and recomputes every total. It stores its own copy. If any amount you supplied disagrees with the recomputation, the request fails with
422. Allternit does not correct it. - Pay. The host shows a payment sheet outside your View, built from the server’s copy: line items, totals, merchant, your legal links, and an explicit Pay button. The View cannot draw or alter it.
- Charge. When the user pays, only the payment method is sent. The server charges the total it stored.
- Fulfil. Allternit calls your server’s
complete_checkouttool, once, and records the order.
The checkout session
Amounts are integers in the currency’s minor unit (cents for USD).
Only one-time charges are supported. There are no subscriptions, partial refunds, or tax calculation.
requestCheckout
Send the session from your View:
The host shows the payment sheet itself, outside your View, using the server’s validated copy of your session. You get
{ "error": "unavailable" } instead when commerce is not enabled for that Allternit deployment or the host has no payment sheet. Feature-detect and handle it.complete_checkout
Your server must expose a tool named complete_checkout. After a successful payment, Allternit calls it with:
- Allternit calls it once per session. Concurrent pay requests are collapsed so you are told once.
- If your tool returns an error, the order is marked
fulfillment_failed. It can be retried, so make the tool idempotent oncheckout_session_id. - Verify the
payment_intent_idwith Stripe before granting anything you cannot take back.
Server-computed totals
The View is untrusted. That is why the model works this way:- The amount charged is the total Allternit stored after recomputing, never a number the View sent.
- The payment sheet shows the server’s copy, not the View’s.
- The session’s merchant must be your own connected account. A session naming another account is rejected.
- Payment idempotency keys are derived from the session id, so a repeated request cannot double-charge.
Refunds
Refunds are full refunds only. They reverse the transfer to your account and refund the platform fee. Today they are started by Allternit operators, not by developers through an API. Yourrefund_url must describe your refund policy honestly, because it is shown to the buyer at checkout.