Skip to main content Home Creators aiskillstore marketplace stripe-agent
stripe-agent Manages all Stripe billing operations for Unite-Hub including product/price creation, subscription management, checkout sessions, webhooks, and dual-mode (test/live) billing for staff vs. customer ...
Jump to install Skills Marketplace Discover and explore AI skills built by the community.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Copy promptShow prompt details A direct command skips the review prompt. Inspect the source before running it.
npx skills add https://github.com/aiskillstore/marketplace --skill stripe-agentThe command stays on one line. Scroll horizontally to inspect it before copying.
Prefer a local copy? Download the files currently available to SkillsMP.
Download Zip Downloading... More from this repository Related occupations SOC
Based on SOC occupation classification
name stripe-agent description Manages all Stripe billing operations for Unite-Hub including product/price creation, subscription management, checkout sessions, webhooks, and dual-mode (test/live) billing for staff vs. customer ...
Stripe Agent Skill
Agent ID : unite-hub.stripe-agent
Model : claude-sonnet-4-5-20250929
MCP Server : stripe (via @stripe/mcp)
Role
Manages all Stripe billing operations for Unite-Hub including product/price creation, subscription management, checkout sessions, webhooks, and dual-mode (test/live) billing for staff vs. customer separation.
Capabilities
1. Product & Price Management
Create Products
mcp__stripe__create_product ({
name : "Unite Hub Professional" ,
description : "Full CRM and AI marketing automation" ,
metadata : {
tier : "professional" ,
features : "unlimited_contacts,ai_scoring,drip_campaigns"
}
})
Create Prices
mcp__stripe__create_price ({
product : "prod_xxx" ,
unit_amount : ,
: ,
: { : },
: { : , : , : }
})
({
: ,
: ,
: ,
: { : },
: { : , : , : }
})
89500
currency
"aud"
recurring
interval
"month"
metadata
tier
"professional"
billing
"monthly"
gst_included
"true"
mcp__stripe__create_price
product
"prod_xxx"
unit_amount
895000
currency
"aud"
recurring
interval
"year"
metadata
tier
"professional"
billing
"annual"
gst_included
"true"
2. Checkout Sessions mcp__stripe__create_checkout_session ({
mode : "subscription" ,
customer_email : "customer@example.com" ,
line_items : [{
price : "price_xxx" ,
quantity : 1
}],
success_url : "https://synthex.social/dashboard?success=true" ,
cancel_url : "https://synthex.social/pricing?cancelled=true" ,
metadata : {
workspace_id : "uuid" ,
tier : "professional"
}
})
3. Subscription Management mcp__stripe__list_subscriptions ({
customer : "cus_xxx" ,
status : "active"
})
Update Subscription (upgrade/downgrade)
4. Customer Management mcp__stripe__create_customer ({
email : "new@customer.com" ,
name : "John Doe" ,
metadata : {
user_id : "uuid" ,
workspace_id : "uuid"
}
})
mcp__stripe__list_customers ({
email : "customer@example.com"
})
5. Invoice Management mcp__stripe__list_invoices ({
customer : "cus_xxx" ,
status : "paid"
})
mcp__stripe__create_invoice ({
customer : "cus_xxx" ,
auto_advance : true ,
metadata : {
workspace_id : "uuid"
}
})
Dual-Mode Billing Architecture Unite-Hub uses a dual-mode billing system to separate staff testing from real customer payments.
Mode Determination Logic
Environment Variables Required # TEST Mode (for staff/internal)
STRIPE_TEST_SECRET_KEY=sk_test_...
STRIPE_TEST_WEBHOOK_SECRET=whsec_test_...
STRIPE_TEST_PRICE_STARTER=price_...
STRIPE_TEST_PRICE_PRO=price_...
STRIPE_TEST_PRICE_ELITE=price_...
NEXT_PUBLIC_STRIPE_TEST_PUBLISHABLE_KEY=pk_test_...
# LIVE Mode (for customers)
STRIPE_LIVE_SECRET_KEY=sk_live_...
STRIPE_LIVE_WEBHOOK_SECRET=whsec_live_...
STRIPE_LIVE_PRICE_STARTER=price_...
STRIPE_LIVE_PRICE_PRO=price_...
STRIPE_LIVE_PRICE_ELITE=price_...
NEXT_PUBLIC_STRIPE_LIVE_PUBLISHABLE_KEY=pk_live_...
Pricing Tiers (AUD, GST Included) Tier Monthly Annual Features Starter $495 $4,950 Basic CRM, 500 contacts, Email integration Professional $895 $8,950 Full CRM, Unlimited contacts, AI scoring, Drip campaigns Elite $1,295 $12,950 Everything + White-label, Priority support, Custom integrations
Currency : Australian Dollars (AUD)
Tax : All prices include 10% GST
Tasks This Agent Performs
Task 1: Setup Complete Stripe Products Trigger : "Setup Stripe products" or first-time billing initialization
Create Starter product and prices (monthly + annual)
Create Professional product and prices
Create Elite product and prices
Store price IDs in environment
Configure webhook endpoints
{
"products" : {
"starter" : "prod_xxx" ,
"professional" : "prod_yyy" ,
"elite" : "prod_zzz"
} ,
"prices" : {
"starter_monthly" : "price_xxx" ,
"starter_annual" : "price_xxy" ,
"professional_monthly" : "price_yyy" ,
"professional_annual" : "price_yyz" ,
"elite_monthly" : "price_zzz" ,
"elite_annual" : "price_zza"
}
}
Task 2: Create Checkout for User Trigger : User clicks "Subscribe" on pricing page
{
"email" : "user@example.com" ,
"tier" : "professional" ,
"billing" : "monthly" ,
"workspaceId" : "uuid" ,
"userId" : "uuid"
}
Determine billing mode (test/live based on email)
Get or create Stripe customer
Create checkout session with correct price
Return checkout URL
Task 3: Handle Subscription Upgrade Trigger : User clicks "Upgrade" in billing settings
{
"currentTier" : "starter" ,
"targetTier" : "professional" ,
"subscriptionId" : "sub_xxx" ,
"workspaceId" : "uuid"
}
Get current subscription
Calculate proration
Update subscription items
Handle billing adjustment
Update workspace tier in database
Task 4: Process Webhook Events Trigger : Stripe webhook received
checkout.session.completed → Activate subscription
customer.subscription.created → Create subscription record
customer.subscription.updated → Update tier, sync status
customer.subscription.deleted → Deactivate subscription
invoice.paid → Mark paid, extend access
invoice.payment_failed → Flag account, send notification
Task 5: Generate Billing Report Trigger : "Generate billing report" or scheduled monthly
{
"period" : "2025-11" ,
"revenue" : {
"total" : 15890.00 ,
"byTier" : {
"starter" : 4850.00 ,
"professional" : 8910.00 ,
"elite" : 2130.00
}
} ,
"subscriptions" : {
"active" : 87 ,
"new" : 12 ,
"churned" : 3 ,
"mrr" : 15890.00
} ,
"trials" : {
"active" : 23 ,
"converted" : 8 ,
"expired" : 5
}
}
Task 6: Audit Stripe Configuration Trigger : "Audit Stripe setup" or health check
All environment variables present
Products exist in Stripe dashboard
Prices are correctly configured
Webhooks are registered
Test mode products match live mode structure
{
"status" : "healthy" | "degraded" | "critical" ,
"checks" : {
"env_vars" : { "status" : "pass" , "missing" : [ ] } ,
"products" : { "status" : "pass" , "count" : 3 } ,
"prices" : { "status" : "pass" , "count" : 6 } ,
"webhooks" : { "status" : "warn" , "message" : "Live webhook not configured" }
} ,
"recommendations" : [
"Add STRIPE_LIVE_WEBHOOK_SECRET to production environment"
]
}
Webhook Endpoints
Test Mode
URL : https://your-domain.com/api/webhooks/stripe/test
Events : All subscription and invoice events
Secret : STRIPE_TEST_WEBHOOK_SECRET
Live Mode
URL : https://your-domain.com/api/webhooks/stripe/live
Events : All subscription and invoice events
Secret : STRIPE_LIVE_WEBHOOK_SECRET
Error Handling
Common Errors Error Cause Resolution StripeCardErrorCard declined Notify customer, request new card StripeInvalidRequestErrorBad API call Check parameters, log for debugging StripeAuthenticationErrorInvalid API key Verify environment variables StripeRateLimitErrorToo many requests Implement exponential backoff
Retry Strategy const MAX_RETRIES = 3 ;
const RETRY_DELAYS = [1000 , 2000 , 4000 ];
async function stripeWithRetry (operation ) {
for (let i = 0 ; i < MAX_RETRIES ; i++) {
try {
return await operation ();
} catch (error) {
if (error.type === 'StripeRateLimitError' && i < MAX_RETRIES - 1 ) {
await sleep (RETRY_DELAYS [i]);
continue ;
}
throw error;
}
}
}
Integration with Other Agents
Orchestrator → Stripe Agent Orchestrator
├─→ [On new signup] → Stripe Agent: Create customer
├─→ [On upgrade request] → Stripe Agent: Process upgrade
├─→ [On webhook] → Stripe Agent: Handle event
└─→ [On audit] → Stripe Agent: Audit configuration
Database Sync After Stripe operations, sync to Supabase:
await supabase.from ('subscriptions' ).upsert ({
workspace_id : workspaceId,
stripe_customer_id : customerId,
stripe_subscription_id : subscriptionId,
tier : tier,
status : 'active' ,
current_period_end : periodEnd
});
Testing
Test Cards Card Number Scenario 4242424242424242Success 4000000000000002Decline 4000000000009995Insufficient funds 40000025000031553D Secure required
Manual Testing
stripe trigger checkout.session.completed
stripe listen --forward-to localhost:3008/api/webhooks/stripe/test
Files Reference File Purpose src/lib/billing/stripe-router.tsDual-mode routing logic src/lib/billing/pricing-config.tsPricing tier definitions src/lib/payments/stripeClient.tsStripe client wrapper src/app/api/billing/subscription/route.tsSubscription API src/app/api/webhooks/stripe/[mode]/route.tsWebhook handlers src/app/api/stripe/checkout/route.tsCheckout session creation
Quick Commands
npm run stripe:setup
npm run stripe:audit
npm run stripe:sync
npm run stripe:webhook-test
Skill file created: 2025-11-28