Skip to content

Commit fa32c0d

Browse files
committed
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.
1 parent effd81f commit fa32c0d

5 files changed

Lines changed: 42 additions & 10 deletions

File tree

packages/agent-docs/content/skills/billing-steps/billing-steps.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ This covers the majority of cases. Load skills upfront when needed:
1414

1515
## 1. Read the customer's current state
1616

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.
1818
- `verify` diffs what Autumn expects against live Stripe. If it returns mismatches, flag them to the user.
1919
- Then decide which operation the request needs based on the current state and the target plan ID:
2020
- Is the target plan ID already active on that customer or entity? → updateSubscription
2121
- Moving the customer onto a different plan ID? → `attach` or `multiAttach`
2222
- Moving them onto a plan(s) in several phases (ramps, staged pricing) → `createSchedule`
2323

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:
2525

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+
<part file="../billing/references/billing-behavior.md" inline="true" />
2727

2828
## 2. Build the request body
2929

packages/agent-docs/content/skills/concepts/references/balances.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
- If neither is set, `included` IS the cap: usage stops at 0 and `check` returns `allowed: false`. Nothing extra is needed to enforce it.
88
- 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.
99

10-
### Billing controls
10+
### How controls interact with balances
1111

1212
- Only `overage_allowed` changes whether usage may pass 0. The rest just bound usage that is already permitted.
1313
- `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.

packages/agent-docs/generated/skills/balances/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ description: How a balance behaves at zero — what makes an included allowance
1414
- If neither is set, `included` IS the cap: usage stops at 0 and `check` returns `allowed: false`. Nothing extra is needed to enforce it.
1515
- 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.
1616

17-
### Billing controls
17+
### How controls interact with balances
1818

1919
- Only `overage_allowed` changes whether usage may pass 0. The rest just bound usage that is already permitted.
2020
- `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.

packages/agent-docs/generated/skills/billing/SKILL.md

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,48 @@ This covers the majority of cases. Load skills upfront when needed:
1414

1515
## 1. Read the customer's current state
1616

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.
1818
- `verify` diffs what Autumn expects against live Stripe. If it returns mismatches, flag them to the user.
1919
- Then decide which operation the request needs based on the current state and the target plan ID:
2020
- Is the target plan ID already active on that customer or entity? → updateSubscription
2121
- Moving the customer onto a different plan ID? → `attach` or `multiAttach`
2222
- Moving them onto a plan(s) in several phases (ramps, staged pricing) → `createSchedule`
2323

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:
2525

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.
2759

2860
## 2. Build the request body
2961

0 commit comments

Comments
 (0)