Claude-skill-registry autumn-add-payments
Skill for adding Stripe checkout and payment flows using Autumn.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/autumn-add-payments" ~/.claude/skills/majiayu000-claude-skill-registry-autumn-add-payments && rm -rf "$T"
manifest:
skills/data/autumn-add-payments/SKILL.mdsource content
Autumn Payments
Always consult docs.useautumn.com for code examples and latest API.
Autumn handles Stripe checkout, upgrades, downgrades, and cancellations automatically.
Quick Reference
Payment Flow
- Returns Stripe URL (new) or preview data (returning customer)checkout
- Confirms purchase when card already on fileattach
Checkout Result
| Field | Description |
|---|---|
| Stripe checkout URL (null if card on file) |
| Target product with scenario |
| Customer's current product |
| Invoice line items |
| Amount in major currency units |
| Currency code |
Product Scenarios
| Scenario | Meaning | Action |
|---|---|---|
| Not subscribed | Subscribe |
| Current plan | Current Plan |
| Scheduled | Already Scheduled |
| Higher tier | Upgrade |
| Lower tier | Downgrade |
| Cancelled | Renew |
React Implementation
import { useCustomer, usePricingTable } from "autumn-js/react"; const { checkout, attach } = useCustomer(); const { products } = usePricingTable(); // Checkout flow const data = await checkout({ productId: "pro" }); if (data.url) { window.location.href = data.url; // New customer } else { // Show confirmation dialog, then: await attach({ productId: "pro" }); } // Cancel const { cancel } = useCustomer(); await cancel({ productId: "pro" }); // Or downgrade to free: await attach({ productId: "free" });
Backend Implementation
import { Autumn } from "autumn-js"; const autumn = new Autumn({ secretKey: process.env.AUTUMN_SECRET_KEY }); // Checkout const { data } = await autumn.checkout({ customer_id, product_id: "pro" }); if (data.url) return redirect(data.url); // Attach (after user confirms) await autumn.attach({ customer_id, product_id: "pro" }); // Get products with scenarios const { data: productsData } = await autumn.products.list({ customer_id });
Prepaid Pricing
For seat-based or prepaid products, pass quantities:
await autumn.checkout({ customer_id, product_id: "credits_pack", options: [{ feature_id: "credits", quantity: 500 }], });
Button Text Pattern
function getButtonText(product: Product): string { const { scenario, properties } = product; if (properties?.has_trial) return "Start Trial"; if (scenario === "active") return "Current Plan"; const text = { upgrade: "Upgrade", downgrade: "Downgrade", new: "Subscribe" }; return text[scenario] ?? "Enable"; }
Common Gotchas
- URL field - It's
, notdata.urldata.checkout_url - Don't build custom logic - Use
for scenariosproducts.list - Proration automatic - Autumn handles upgrade/downgrade proration
- Cancel via free - Prefer attaching free plan over hard cancel
- Success URL - Pass
to redirect after Stripe checkoutsuccess_url