# Payments AI — exhaustive agent index Site: https://doc.stage.managed.payments.ai Product: Payments AI MoR (Merchant of Record for AI-built apps) MCP: https://mor.payments.ai/api/mcp Start with https://doc.stage.managed.payments.ai/llms.txt if you only need navigation. This file is the longer reference. ================================================================================ DISCOVERY (no auth) ================================================================================ - GET /SKILL.md — Agent Skills file - GET /auth.md — OAuth + bearer walkthrough - GET /llms.txt — concise index - GET /llms-full.txt — this file - GET /openapi-public.json — Merchant Public API + buyer checkout - GET /.well-known/agent-skills/index.json — Agent Skills Discovery RFC v0.2.0 - GET /.well-known/agent-skills.json — legacy skills card - GET https://mor.payments.ai/.well-known/mcp/server-card.json — SEP-1649 - GET https://mor.payments.ai/.well-known/mcp.json — alias of the server card - GET https://mor.payments.ai/.well-known/oauth-authorization-server - GET https://mor.payments.ai/.well-known/oauth-protected-resource/api/mcp Install skill: mkdir -p "$HOME/.payments-ai" && curl --fail --show-error --location \ --output "$HOME/.payments-ai/SKILL.md" \ "https://doc.stage.managed.payments.ai/SKILL.md" Plugins: https://github.com/paymentsai/Payments-AI-skills npx skills add paymentsai/Payments-AI-skills ================================================================================ MCP ================================================================================ Transport: Streamable HTTP (no SSE) URL: https://mor.payments.ai/api/mcp Auth: OAuth 2.1 + PKCE S256 (preferred) or User MCP Key Bearer pai_mcp_* Human setup: https://doc.stage.managed.payments.ai/mcp Agent auth: https://doc.stage.managed.payments.ai/auth.md Host config (OAuth): { "mcpServers": { "payments-ai": { "url": "https://mor.payments.ai/api/mcp" } } } Bearer fallback (client without OAuth, or the developer can't sign in through the client): a pai_mcp_* User MCP Key from Developer Tools → MCP Tokens (https://mor.payments.ai/developer-tools), generated on the tab (Sandbox or Live) that matches the MCP URL. No browser and no terminal (headless agent, CI, container): run the OAuth device authorization grant (RFC 8628) yourself, then send the token as a bearer header. 1. POST https://mor.payments.ai/api/v1/oauth/register with grant_types ["urn:ietf:params:oauth:grant-type:device_code"] and no redirect_uris. 2. POST https://mor.payments.ai/api/v1/oauth/device_authorization (form) with client_id and resource=https://mor.payments.ai/api/mcp; show the human user_code and verification_uri as returned. 3. Poll POST https://mor.payments.ai/api/v1/oauth/token with grant_type urn:ietf:params:oauth:grant-type:device_code every interval seconds (5); slow_down adds 5 s; access_denied = declined; expired_token = the 30 minutes passed. 429 temporarily_unavailable: back off for Retry-After (60 s). Token lifetime 90 days. Per client: Claude Code, Cursor, Codex, Gemini CLI, Antigravity and VS Code take the token as a header. Claude web/Desktop has no shell: use the connector's own browser sign-in (90-day credential); fallback is a User MCP Key under Request headers (at most 7 days; on Team and Enterprise the Owner sets the headers, so every member acts as the key owner's account). Grok and ChatGPT: use their connector browser sign-in; no device grant (no shell), header path not verified; fallback https://doc.stage.managed.payments.ai/connect on a device with a browser. Details: https://doc.stage.managed.payments.ai/auth.md and https://doc.stage.managed.payments.ai/SKILL.md. Renewal after a device grant: when whoami warns or token_expired comes back, run the grant again and replace the Authorization header (nothing to re-approve in the client). The warning's link is https://doc.stage.managed.payments.ai/connect; the headless steps are at https://doc.stage.managed.payments.ai/connect#connect-without-a-terminal. Tools (underscore names): whoami — accountName (business name of the account, never an email; null = no label), userId, scopes (null = every scope except transaction:read), host (sandbox | live: the MCP URL connected to, not the merchant deployment), endpoint, merchantIds, credentialExpiresAt, credentialExpiresInSeconds, credentialExpiryWarning (OAuth connections, last 14 days; tool results carry it as _meta["ai.payments/credentialExpiryWarning"] plus a closing text block); needs no scope, call it to verify the connection get_my_merchant — merchants this connection owns search_payments_ai_docs create_merchant_account — name, email, optional phone (E.164); returns merchantId get_merchant_activation_status — pending | verification_pending | active | not_provisioned go_live — promote sandbox merchant to live; idempotent, returns current status; copies nothing (see below) create_product — product + plans; amount is decimal USD not cents create_order — multi-item or caller-priced checkout; needs checkout:write update_product — merge update: name, description, status; omit unchanged fields update_plan — merge update: name, description, amount, billing, freeTrial list_products — includes checkoutUrl per plan list_transactions — transactions by customerEmail, order, status, date range, deployment; needs transaction:read get_transaction — one transaction's details + line items get_product_image_upload_url — presigned POST; file field last; then confirm confirm_product_image get_checkout_customization update_checkout_customization — merge patch; omit unchanged fields; fields nested: {merchantId, customization: {buttonColor: "#2563EB"}} set_checkout_logo — action mint | confirm; bytes never through MCP Mutating product/checkout tools target sandbox until go_live. go_live does not copy products, plans, or checkout customization — the live side starts with an empty catalog. Re-create products/plans with create_product and re-apply branding with update_checkout_customization after promoting. set_checkout_logo writes to sandbox only; set the live logo in https://mor.payments.ai/checkout-builder with Live selected. A sandbox checkout link keeps ?isSandbox=true forever and never becomes a live link. Sandbox needs no KYC/KYB. Live can process up to $5,000 in card transactions before identity verification is required; payouts always require completed KYC/KYB regardless of that threshold, before adding a payout method and before the first live payout. Checkout URL: use the link the tool returns verbatim: planCheckoutUrls[i].checkoutUrl from create_product or plans[i].checkoutUrl from list_products. The top-level checkoutUrl is the first plan's link only. Never build one from a planId. Sandbox plans do not exist on live (go_live copies nothing): after go_live, call create_product again and use the checkoutUrl it returns. Test card (Sandbox): 4242 4242 4242 4242, any future expiry, any CVC. Refused-payment card (Sandbox): 4000 0000 0000 0002. Test cards never work on Live: live checkout links take real cards only. Scopes: merchant:create, merchant:read, merchant:go_live, product:create, product:read, docs:read, checkout:read, checkout:write, transaction:read, customer:read, invoice:read, webhook:listen transaction:read, customer:read, invoice:read, and webhook:listen are granted only by name (never by default or by null scopes). Only a "succeeded" transaction is paid; never report "pending" as paid. No destructive MCP tools (no payout, refund, revoke, delete). For a refund, send the merchant to the transaction's transactionDetailsUrl. ================================================================================ REST — Merchant Public API ================================================================================ Sandbox base: https://sandbox.mor.payments.ai/api Auth: Authorization: Bearer pai_test_<64 hex> Live: pai_live_* on the live API host. Docs Try It blocks live keys. Prefix: /v1/public-api/merchants/{merchantId}/… Platform onboarding (not merchant-scoped): POST /v1/public-api/merchants Auth: Bearer pai_test_* / pai_live_* (the calling merchant becomes the parent) Assign team member (scoped): POST /v1/public-api/merchants/{merchantId}/members body: { email, role: owner|admin|editor|viewer } — user must be active on caller's team API keys (scoped): GET/POST /api-keys; DELETE /api-keys/{id} Guide: /platform-onboarding Single-merchant create can also go through the dashboard or MCP, then use merchantId in every merchant-scoped Public API path. Buyer checkout (no merchant key): /v1/checkout/plans/{planId}/… includes POST …/confirm used by the embed Guides: Quickstart /quickstart Public API /public-api Platform onboarding /platform-onboarding Webhooks /webhooks API Reference /api Errors /errors/{slug} Error docUrl: https://doc.stage.managed.payments.ai/errors/{slug} slug = code with `.` and `_` replaced by `-`, lowercased ================================================================================ WEBHOOKS ================================================================================ Dashboard: Developer Tools → Webhooks Guide: https://doc.stage.managed.payments.ai/webhooks Verify signatures before acting. Destination CRUD is owner/admin on the authenticated API, not the merchant public API. ================================================================================ SAFETY ================================================================================ - Prefer sandbox keys and sandbox checkout query param while exploring - Do not log or commit pai_mcp_*, pai_test_*, pai_live_*, or OAuth codes - Phone is optional; when given, it must be E.164 with country code - Product name max 80 characters, plan name max 30 characters - Product images: POST multipart to presigned URL, file field last, ≤ 5 MB - Checkout logo: PUT raw bytes to mint uploadUrl with matching Content-Type