Overview
The/attach endpoint is Autumn’s unified purchase flow handler. With one function call, you can:
- Create new subscriptions with Stripe Checkout
- Handle upgrades and downgrades between plans
- Apply discounts, free trials, and custom pricing
- Process immediate or deferred billing
Quick Start
Parameters
string
required
The ID of the customer attaching to the plan.
string
required
The ID of the plan to attach.
string
The ID of the entity for entity-scoped plans (e.g., per-workspace billing).
array
Customize feature quantities (e.g., number of seats).
object
Override plan pricing, items, or trial configuration.
array
Apply promotional discounts or rewards.
string
URL to redirect to after successful checkout (defaults to current page in frontend).
object
Control deferred invoicing behavior.
string
How to handle prorations on upgrades/downgrades:
"create_prorations" (default), "none", or "always_invoice".Response
Common Use Cases
New Subscription with Free Trial
Seat-Based Plan with Custom Quantity
Custom Pricing for Enterprise Customer
Error Handling
Preview Before Attaching
UsepreviewAttach to show customers what they’ll be charged before confirming:
Related Endpoints
- Check Endpoint - Verify feature access before showing upgrade prompts
- Track Endpoint - Record usage events after subscription
- Webhooks - Listen for subscription changes
Next Steps
Check Access
Learn how to verify customer access to features
Track Usage
Record usage events for metered billing