You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: restore the dev billing defaults the flatten dropped
billing-steps told the agent to charge stored cards directly and
finalize invoices, contradicting billing-behavior.md — dev's documented
default. The payment step now inlines billing-behavior.md, and step one
regains the getAgentRules call dev's billing skill instructs. Fixes the
mcp-attach-approval CI eval (all scorers green locally); also
disambiguates the balances section heading from the inlined controls
doc.
Copy file name to clipboardExpand all lines: packages/agent-docs/content/skills/billing-steps/billing-steps.mdx
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,16 +14,16 @@ This covers the majority of cases. Load skills upfront when needed:
14
14
15
15
## 1. Read the customer's current state
16
16
17
-
- Call `getCustomer`, `listEntities`, and `verify` in ONE batch — never one after another.
17
+
- Call `getAgentRules`, `getCustomer`, `listEntities`, and `verify` in ONE batch — never one after another. The org's agent rules can override any default below.
18
18
-`verify` diffs what Autumn expects against live Stripe. If it returns mismatches, flag them to the user.
19
19
- Then decide which operation the request needs based on the current state and the target plan ID:
20
20
- Is the target plan ID already active on that customer or entity? → updateSubscription
21
21
- Moving the customer onto a different plan ID? → `attach` or `multiAttach`
22
22
- Moving them onto a plan(s) in several phases (ramps, staged pricing) → `createSchedule`
23
23
24
-
Then decide how it is paid. Follow the user's instructions or the org rules. If neither says, first check if there is a payment method (from the `getCustomer` call).
24
+
Then decide how it is paid. Follow the user's instructions or the org rules. If neither says:
25
25
26
-
If payment method exists, just attach directly to charge it. If there is none, use invoice mode, finalized, with the plan enabled immediately.
Copy file name to clipboardExpand all lines: packages/agent-docs/content/skills/concepts/references/balances.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@
7
7
- If neither is set, `included` IS the cap: usage stops at 0 and `check` returns `allowed: false`. Nothing extra is needed to enforce it.
8
8
- So never add a `spend_limit` to "cap" a feature that has no overage price and no `overage_allowed` — it is already capped, and the limit does nothing.
9
9
10
-
### Billing controls
10
+
### How controls interact with balances
11
11
12
12
- Only `overage_allowed` changes whether usage may pass 0. The rest just bound usage that is already permitted.
13
13
-`usage_limits`: a separate gate on TOTAL usage per time window, counted independently of the balance. This one bites whether or not overage exists, and can sit below the included amount.
Copy file name to clipboardExpand all lines: packages/agent-docs/generated/skills/balances/SKILL.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ description: How a balance behaves at zero — what makes an included allowance
14
14
- If neither is set, `included` IS the cap: usage stops at 0 and `check` returns `allowed: false`. Nothing extra is needed to enforce it.
15
15
- So never add a `spend_limit` to "cap" a feature that has no overage price and no `overage_allowed` — it is already capped, and the limit does nothing.
16
16
17
-
### Billing controls
17
+
### How controls interact with balances
18
18
19
19
- Only `overage_allowed` changes whether usage may pass 0. The rest just bound usage that is already permitted.
20
20
-`usage_limits`: a separate gate on TOTAL usage per time window, counted independently of the balance. This one bites whether or not overage exists, and can sit below the included amount.
Copy file name to clipboardExpand all lines: packages/agent-docs/generated/skills/billing/SKILL.md
+35-3Lines changed: 35 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,16 +14,48 @@ This covers the majority of cases. Load skills upfront when needed:
14
14
15
15
## 1. Read the customer's current state
16
16
17
-
- Call `getCustomer`, `listEntities`, and `verify` in ONE batch — never one after another.
17
+
- Call `getAgentRules`, `getCustomer`, `listEntities`, and `verify` in ONE batch — never one after another. The org's agent rules can override any default below.
18
18
-`verify` diffs what Autumn expects against live Stripe. If it returns mismatches, flag them to the user.
19
19
- Then decide which operation the request needs based on the current state and the target plan ID:
20
20
- Is the target plan ID already active on that customer or entity? → updateSubscription
21
21
- Moving the customer onto a different plan ID? → `attach` or `multiAttach`
22
22
- Moving them onto a plan(s) in several phases (ramps, staged pricing) → `createSchedule`
23
23
24
-
Then decide how it is paid. Follow the user's instructions or the org rules. If neither says, first check if there is a payment method (from the `getCustomer` call).
24
+
Then decide how it is paid. Follow the user's instructions or the org rules. If neither says:
25
25
26
-
If payment method exists, just attach directly to charge it. If there is none, use invoice mode, finalized, with the plan enabled immediately.
26
+
## Billing behavior
27
+
28
+
### Invoice default
29
+
30
+
- Default operator-led billing actions to invoice mode: `invoice_mode.enabled: true` and `invoice_mode.finalize: false`, and grant access now (see Enable plan immediately for which field).
31
+
- Use invoice mode even when the immediate charge is $0, unless the user asks for checkout, self-serve, or direct charging.
32
+
- This grants access now while creating a draft Stripe invoice that the operator can review, edit, and send.
33
+
- Use explicit net terms from the user or contract in `invoice_mode.net_terms_days`; otherwise do not ask just to set net terms.
34
+
- If the customer has no email, ask for it and update the customer before previewing invoice or checkout flows.
35
+
36
+
### Enable plan immediately
37
+
38
+
- Top-level `enable_plan_immediately` grants access now whenever payment is deferred or pending (invoice unpaid, checkout incomplete, or future `starts_at`) — a superset of `invoice_mode.enable_plan_immediately`, which only covers the invoice-unpaid case.
39
+
- For `createSchedule` and `attach`, set top-level `enable_plan_immediately: true` instead of `invoice_mode.enable_plan_immediately`.
40
+
-`updateSubscription` has no top-level field; keep using `invoice_mode.enable_plan_immediately` there.
41
+
42
+
### Checkout flow
43
+
44
+
- Use checkout only when the user wants a payment link or checkout session to send to the customer.
45
+
- For checkout, omit `invoice_mode`, set `redirect_mode: "always"`, and set `enable_plan_immediately: true`.
46
+
- If the user might be asking for checkout but did not say so clearly, clarify before previewing.
47
+
48
+
### Direct charge flow
49
+
50
+
- If the user wants self-serve-style billing or immediate card charging, clarify before omitting `invoice_mode`.
51
+
- Without `invoice_mode`, eligible plan changes may charge the customer immediately.
52
+
53
+
### Proration
54
+
55
+
- Default proration to `none` so the preview starts with no immediate prorated charge or credit.
56
+
- If the customer has no existing subscriptions, do not pass `proration_behavior: "none"`; new subscriptions do not allow it.
57
+
- Use the endpoint's field name: `proration_behavior` for attach/updateSubscription, `billing_behavior` for createSchedule.
58
+
- Use `prorate_immediately` only when the user asks for prorations, immediate true-up, or immediate credits/charges.
0 commit comments