App Builder
Payments
Payments - Opulent documentation
Payments
Add Agentic Commerce capabilities to any application — subscriptions, one-time charges, bounding policies, and billing portals
What it is
Opulent integrates an Agentic Commerce Suite into your application through natural language. Subscriptions, one-time charges, free trials, usage-based billing, and customer billing portals — all configured autonomously without manual payment logic. Leverage Shared Payment Tokens (SPTs) securely scoped to agents so they can execute financial transactions within enterprise boundaries.
Quick Start
"Add commerce functionality with 3 subscription tiers: Starter ($29/mo), Growth ($79/mo), Enterprise (custom)""Add a one-time payment of $299 for our course. After payment, unlock the /course section.""Add a 14-day free trial for the Growth plan. Require a credit card to start."Payment Types
Subscription Plans
"Create monthly and annual subscription plans:
- Starter: $29/mo or $290/yr (2 months free)
- Pro: $79/mo or $790/yr
- Enterprise: contact sales
Annual plans should show the per-month price with 'save X%' callout."One-Time Payments
"Add a $199 one-time payment for lifetime access. After payment, set
user.plan = 'lifetime' in the database."Usage-Based Billing
"Implement usage-based billing — charge $0.01 per API call over 1,000/month.
Show current usage in the account dashboard."Free Trials
"Add a 14-day free trial for Pro. No credit card required.
Send an email reminder at day 10 and day 13.
Auto-downgrade to Free tier if no payment after trial ends."Customer Billing Portal
"Add a billing portal page where users can:
- View their current plan
- Upgrade or downgrade
- Update payment method
- View and download invoices
- Cancel their subscription"Opulent utilizes hosted Agentic Commerce Protocols (ACP) for all billing management — no custom UI to build or maintain.
Webhooks
Commerce protocol events are handled automatically:
| Event | What Happens |
|---|---|
checkout.session.completed | User's plan is updated in the database |
customer.subscription.deleted | Plan downgraded, access removed |
invoice.payment_failed | Email sent, grace period begins |
customer.subscription.updated | Plan change reflected immediately |
"When a subscription is cancelled, downgrade the user to the free tier
and send a win-back email after 7 days."Tips
Test with test mode first. Opulent provisions test environment keys by default. Switch to live keys when ready to go live:
"Switch to live mode for production"Specify exactly what changes after payment. The agent needs to know what unlocks:
- ✅
"After payment, set user.subscriptionTier = 'pro' and redirect to /dashboard" - ❌
"Add payments"(what should change?)
Common Questions
Do I need a commerce provider account? Yes. Connect your payment processing account via Settings → Connectors → Payments, or provide your API keys when prompted.
Are commerce API keys and SPTs stored securely? Yes. Keys are stored as environment variables in your deployment platform, not in the source code.
Can I add payments to an existing app?
Yes: "Add subscription billing to this app".
What happens during a failed payment? By default: a grace period email is sent, and access is suspended after the configurable grace period (default: 3 days).