Pay for posterly from an agent
How an agent pays posterly's Stripe-hosted Checkout with its own approved payment credential, so the user never types a card into chat.
start_signup (or POST /api/v1/signup) always returns a payment object alongside the Stripe-hosted Checkout link. It describes the amount, the merchant, and how an agent holding its own approved payment credential, for example a Link agent wallet, can complete that same Checkout page itself: create a spend request, get the user's approval in their wallet, then pay the page. If the agent has no such credential, it sends the user checkout_redirect_url as before.
Terms acceptance is implicit in paying Checkout. Password setup, social account connect, and publish approval still happen with a human in the browser.
What the agent gets back
Every checkout_required response, and every poll while checkout is still open, includes payment:
{
"amount": 1000,
"currency": "usd",
"amount_display": "$10.00",
"billing": "monthly_subscription",
"description": "posterly Starter plan + API access, billed monthly",
"merchant_name": "posterly",
"merchant_url": "https://www.poster.ly",
"checkout_redirect_url": "https://www.poster.ly/agents/signup/checkout?session_id=cs_live_123",
"pay_with": "stripe_hosted_checkout",
"agent_wallet": {
"supported": true,
"how": "...",
"spend_request": {
"merchant_name": "posterly",
"merchant_url": "https://www.poster.ly",
"amount": 1000,
"currency": "usd",
"context": "First month of posterly Starter plan + API access"
}
}
}
payment is null once payment is confirmed or checkout has expired, since there is nothing left to pay.
What the agent needs
An agent-issued payment credential that a Stripe-hosted Checkout form will accept. Link's agent wallet is the credential this was written against; it is currently available to US Link accounts, issues either a one-time virtual card or, where the wallet supports it, a Link Pay Token for Stripe-hosted forms, and caps a spend request at $500 with a 12-hour approval window. Any other wallet that can complete a standard Stripe Checkout page works the same way.
Step by step
- Ask the user for their email, then call
start_signup(orPOST /api/v1/signup) with the Starter plan andapi_addon=trueunless they chose another plan. - Read
payment.amount,payment.currency,payment.merchant_name, andpayment.checkout_redirect_url. - Create a spend request in the agent's wallet for exactly
payment.agent_wallet.spend_request.amount,.currency, and.merchant_name/.merchant_url. Use.contextas the human-readable reason. - Get the user's explicit approval of that spend request in their wallet.
- Complete
checkout_redirect_urlwith the approved credential: a Link Pay Token if the wallet offers one for Stripe-hosted forms, otherwise the one-time virtual card entered into the checkout form. Never ask the user to type card details into chat, and never send card numbers to posterly. - Poll
get_signup_session(orGET /api/v1/signup/sessions/{id}) until payment is confirmed. - Tell the user to open the posterly password setup email. After they set a password, continue connect and first-post onboarding in the same chat.
If the agent has no payment credential, skip straight to sending the user checkout_redirect_url.
What the user should be told
This starts a recurring subscription, not a one-time purchase:
- The credential used at signup only covers the first billing period.
- A one-time card cannot be charged again, so the user should add a card in billing settings before the next period. If the renewal cannot be charged, posterly emails them to update their payment method.
- The user can cancel any time from the dashboard.
Tell the user this before they approve the spend request, not after.
What stays with the human
- Explicit approval of the wallet spend request
- Password setup
- Social OAuth connect
- Publish approval for live posts
The agent must not ask for a posterly password, social passwords, or OAuth codes.
Direct PaymentIntent confirmation
Some responses may also include agent_pay: a Stripe PaymentIntent an agent can confirm directly with a payment method id, bypassing the hosted Checkout page. This is not currently enabled. Ignore agent_pay when it is null.
Browser fallback
If the agent has no payment credential, the credential is declined, confirmation fails, or the user prefers the website, send checkout_redirect_url. That is the same hosted Checkout handoff posterly already uses for agent signup.
Stripe WebMCP on hosted Checkout
Agents that pay via checkout_redirect_url (Stripe-hosted Checkout) may get structured page tools, WebMCP, for free when their browser agent supports WebMCP. posterly does not register those tools. Stripe registers them on Checkout.
WebMCP is optional efficiency on the same Checkout URL we already return. It is not a new posterly API, and it does not replace payment.agent_wallet or the human handoff.
If the agent browser exposes a WebMCP consumer API:
- Discover the tools on the Checkout page.
- Re-list or rediscover tools after each state change. Selecting a payment method can change the fill schema, and a submit tool may only appear when the form is valid.
- Do not hard-code tool names, and do not assume
submit_paymentis always present.
If the browser has no WebMCP consumer API, which is common today, fall back to filling the form with the approved wallet credential, or send the user checkout_redirect_url as today.
Stripe's agent guide is Use WebMCP to complete Stripe payments in a browser.