Skip to main content
collectPayment opens a hosted Stripe Checkout session for a workspace-defined billing plan. When a user triggers it — typically by clicking a pricing CTA — the runtime calls Stripe on the workspace’s behalf, returns a short-lived checkout_url, and your page redirects the user there. Revenue settles directly into the workspace owner’s Stripe Connect account; the platform holds no funds in transit. By the end of this page you can wire a CTA to charge a customer for a published plan.

Invoke from a CTA

The canonical pattern is collectPayment on a Cta block’s on_click. Pass success_url and cancel_url as absolute URLs:
cta-pricing.json
{
  "block": "Cta",
  "props": {
    "headline": "Start your Pro trial",
    "cta_label": "Subscribe",
    "on_click": {
      "capability": "collectPayment",
      "args": {
        "plan_id": "plan_pro_monthly",
        "success_url": "https://app.acme.com/welcome",
        "cancel_url": "https://app.acme.com/pricing",
        "customer_email": "ada@acme.com"
      }
    }
  }
}
The runtime validates the args, creates a Stripe Checkout session under the workspace’s Connect account, and returns a checkout_url. The block redirects the browser to that URL — the user lands on Stripe’s hosted page, completes payment, and Stripe sends them to success_url (or cancel_url if they back out).

Inputs

Outputs

Provisioning

The workspace must complete Stripe Connect onboarding before collectPayment can dispatch. The Builder walks the workspace owner through the flow. Until onboarding is complete, every call returns stripe_not_connected. The programmatic onboarding endpoints live in the Monetization API.

Error codes

Every error returns the standard envelope:

listPlans

Fetch the workspace’s published billing plans to populate a pricing UI.

Accept payments guide

End-to-end walkthrough: Stripe Connect, plan setup, and CTA wiring.