billing
Installation
SKILL.md
Billing
Follow these steps carefully for every request that updates a customer's billing state.
This covers the majority of cases. Load skills upfront when needed:
- Load the
trialsskill first if the request involves a trial, or the customer is already trialing. - Load the
schedulesskill first if the request moves the customer between plans over time, or the customer already has a schedule. - Load the
balancesskill first if the request mentions a cap, limit, overage, or credit allowance, or the customer already has billing controls set.
1. Read the customer's current state
- Call
getAgentRules,getCustomer,listEntities, andverifyin ONE batch — never one after another. The org's agent rules can override any default below. verifydiffs what Autumn expects against live Stripe. If it returns mismatches, flag them to the user.- Then decide which operation the request needs based on the current state and the target plan ID:
- Is the target plan ID already active on that customer or entity? → updateSubscription
- Moving the customer onto a different plan ID? →
attachormultiAttach - Moving them onto a plan(s) in several phases (ramps, staged pricing) →
createSchedule
Then decide how it is paid. Follow the user's instructions or the org rules. If neither says: