# Billing and renewal

> Paying for an Orbit plan from your Base wallet, moving up a plan and renewing automatically, in plain words first, then how the agent reads billing state and handles every renewal outcome.
>
> Describes Orbit 0.1.8. Web page: https://dialectic-orbit-docs.vercel.app/0.1.8/using/billing-and-renewal/

This page covers paying for Orbit: plans, how a payment is made, moving to the next plan, and automatic renewal. The first part is in plain words; the rest is the agent's workflow.

## In plain words

Orbit has three plans: **free**, **basic** and **pro**. A bigger plan lets your agent use more kinds of packages for your style. Paid plans are paid in USDC from your wallet on Base, one period at a time. Your agent reads the current prices from Dialectic's signed terms; this site never quotes them.

- **Paying.** Your agent shows you the plan, price, period and dates, and asks once. With your yes, it lets the Dialectic service collect exactly one period from your Base wallet. It never approves more than one period. All paid plans pay the same receiving wallet; each approval is for exactly your plan's price, and the collection names your plan.
- **Plan terms can change.** A payment is judged by the terms in force when it was made, so a change never shortens a period you already paid for. Your agent and the Billing page always show the current terms.
- **Moving up a plan.** This adds the new plan's parts to your wallet's permissions, so you sign it once, like any permission change.
- **Automatic renewal** is your choice, written into your signed rules as a plan and the most one period may cost. Without it, your agent asks you each period. Moving to a smaller plan is not available as of Orbit 0.1.8; turning off renewal is the way to stop paying.
- **If a plan lapses,** your agent stops adding risk on the positions that need it, but closing positions and taking money out still work.
- **If your Base wallet is short of USDC** for a renewal, your agent may free some within your rules (for example by taking it out of a position) or tells you.

## For agents: plans, payment and renewal

This part is for agents handling the owner's plan: reading it, paying for it, moving to the next plan, and renewing it automatically. It goes deeper than the `orbit-billing` guide, especially on `renew_subscription` outcomes. As of Orbit 0.1.8.

Billing state lives with the curator service at feed.dialectic.com; Orbit reads it and passes it through. `get_billing_status` and each tool's `status_line` and `next` win over this page. Never quote a price from memory: read it.

## Plans, layers and what decides access

- **Plans (tiers):** `free`, `basic`, `pro`, with ranks 0, 1, 2. Paid plans are paid in USDC on Base, by the owner's Base Safe (the payer).
- **Layers:** the packages each plan adds for the owner's style: `dialectic/orbit-free` (shown as the Orbit Starter Package), `dialectic/orbit-basic`, `dialectic/orbit-pro`, `dialectic/orbit-pro-trading`, `dialectic/orbit-pro-perps`. The style (Saving, Investing, Trading) picks the asset classes; the plan picks how wide.
- **Utilities**, whatever the plan: Starter Kit (`dialectic/starter-kit`, a different package from the Orbit Starter Package), Gas Top Up, Token Transfers, and the subscription payment package (`dialectic/basic-ops-subscribe`).
- **Only the package's own signed tier decides** what a plan can use (`access.min_tier` in its manifest). A package id says nothing.

| Read | Gives |
|---|---|
| `get_plans` with `safe` (the Base payer) | `tiers` (each `amount` per period as signed, `token_symbol`, `period_s`, `grace_s`; free has no price), `current` (this Safe's plan, `paid_until`, `next_payment_due`, `auto_renew`), and `packages` with `min_tier`. A `min_tier` of `null` means the package does not say; never call it free |
| `get_plan_layout` with `safe` | The plan, the style, the next plan's parts (`upgrade`) and the new layout beside old packages (`layout_move`) |
| `list_packages` with `tier` | What a plan can use |
| `get_billing_status` with `safe` | The live billing picture (below) |

Payment amounts actually paid are shown to the owner in Activity on the owner page; no tool returns them.

**Terms change over time.** A plan's terms (price, period, grace) can change. A payment is judged by the terms in force when it was made, so a change never shortens a period already paid for. Read the current terms from `get_plans` or `get_billing_status`, never from an earlier answer. When the price or period changed since the last payment, automatic renewal stops at `needs_owner` (see [Renewal outcomes](#renewal-outcomes)).

## Reading billing: `get_billing_status`

Per curator whose feed-bearing package is installed, a `plan` block with `state`, tier, `paid_until`, `next_payment_due`, and a top-level `status_line` to relay as it stands. It also warns when the Base payer Safe holds less USDC than the next renewal's price.

| `plan.state` | Meaning |
|---|---|
| `current` | Paid and not yet due |
| `free`, `granted` | No payment needed. A plan granted by an access code shows `granted` with words such as "From your access code". If a paid plan ended while a grant is active, `ended_paid_tier` names it and `status_line` says the paid plan has ended; renewing brings paid access back |
| `due` | The next payment date has passed; access continues until the date shown (grace) |
| `ended` | The plan has lapsed |
| `activating` | A payment went through and is not visible yet; check again in a little while |
| `unconfirmed` | Orbit could not read the plan. Not "free" and not "lapsed" |
| `not_this_safe` | The plan belongs to another Safe. Plans and credentials never carry across Safes |

Other fields:

- `renewal`: `next_payment_due`, `due`, and `auto_renew` (the owner's signed consent `{tier, max_price_per_period}`, or `null`).
- `package_access`: a validated access rank for this Safe, or unknown.
- `feed_access`: paid feeds a confirmed plan reopened, or that the curator still refuses.
- `older_answer_ignored`: the curator returned an older payment index than one Orbit already saw; Orbit kept the newer one.
- `safe_binding`, `key_scope`: whether the curator key is tied to this Safe.

`refresh_index` defaults to reconciling a recorded pending payment once; `refresh_index: false` is a passive read. Reading billing never spends and never requests collection.

## What a lapsed plan blocks

When a plan ends, the curator refuses the data feed for its packages. Market data goes stale, so anything that adds risk on those positions is held, and the refusal names the package and the billing cause. Exits, repayments and closes still run, and risk alerts keep arriving. Tell the owner the plan needs paying, not to wait for a feed. Orbit asks the curator less often while lapsed and again as soon as billing shows the plan paid.

## Paying for a plan

Follow `get_onboarding_status.paid_plan.next` when the owner asks to upgrade. The usual shape:

1. `present_subscription_quote` with `safe` (a configured **Base** Safe; never infer a Base payer from a Safe on another network) and the `tier`. It returns the signed terms and a payment reference with its expiry; the price is checked against the current signed terms again at payment.
2. Show the facts: tier, price and token, payer Safe, period and dates. Get the owner's yes once.
3. `confirm_subscription` with the payment reference: records the owner's consent. It approves nothing on chain.
4. `prepare_subscription_approval` with `safe`, `tier` and the `payment` reference (the one confirmed in step 3; `checkout_id` is optional): prepares the exact one-period USDC approval from the payer Safe. `quote_window.valid_for_s` is the time left on the quote.
5. `execute_subscription_approval` with the `review_id`: simulates and executes that approval through the normal signed pipeline. Approval is not payment.
6. `check_now` with `safe`, `tier` and the `payment` reference: asks the curator to collect. `tier` is what makes the curator collect: always pass the plan being paid. A request that reaches the curator without a tier only refreshes its index and never collects. A 200 answer is not proof: read `collect.outcome`, then `get_billing_status` until the plan is `current`.

Never collect an attempt that is pending, unknown or already paid. For a prior pending or unknown payment, use `get_billing_status` (with its default index reconciliation) instead of collecting again.

If the Safe's permissions do not yet include the payment package's current approval, `get_change_plan` shows a `subscription_needs_root` step: a permission update comes first. See [Package changes](https://dialectic-orbit-docs.vercel.app/0.1.8/using/package-changes/).

### One receiving wallet for every paid plan

All paid plans pay one receiving wallet. The approval is for exactly the price of the plan being paid, and `check_now` names that plan with `tier`, so a shared receiver is never ambiguous. The Subscription Payment Rail package (`dialectic/basic-ops-subscribe`) approves exactly each plan's price to that receiver; `present_subscription_quote` names that receiver as the spender.

If the owner approved an older receiver, that approval does not pay the current one. The fix is to update the package, then approve again: `prepare_subscription_approval` and `prepare_checkout` say which update is needed (and `renew_subscription` carries the same code inside `approval_unavailable`) with `package_reinstall_required` (`install_package` for `dialectic/basic-ops-subscribe`, local, no signature) or `permissions_update_required` (a permission update the owner signs). Then prepare the one-period approval again; with automatic renewal, the next `renew_subscription` prepares it. See [`approval_unavailable`](#approval_unavailable) for both codes.

### After `check_now`

The curator's billing index can lag behind a collection that went through. Orbit adds no cache or delay: every `get_billing_status` is a live read of the curator's answer, and the answer's `indexed_as_of` shows how fresh the curator's index is. With the default `refresh_index`, a recorded pending payment also triggers one bounded index reconciliation.

If `get_billing_status` still shows the old state right after `check_now`, wait and read again before doing anything else. Do not call `check_now` again for the same payment.

A paid plan that ended with nothing waiting to be paid shows its payment progress as `expired`, judged on the curator's clock. To subscribe again, show the owner the price with `present_subscription_quote`, then `confirm_subscription` once they agree.

### When paid access is declined

Paid access can be declined for a wallet. Orbit's message then says so in plain words, and that nothing was charged. Relay it as written; do not add a reason of your own.

- **Declined for this wallet** (setting up paid access, or a collection): the message says paid access can't be set up for this wallet and that trying again will not change it. A collection shows `not_collected`. Do not retry; tell the owner.
- **Declined for another reason**: the message says the request was declined and nothing was charged. Tell the owner. One case can be fixed: when it adds "Sign with one of the wallet's approval keys.", the signature came from a wallet that isn't one of them; the owner signs again with one of the wallet's approval keys.
- **Checks not finished**: the message says Orbit couldn't finish the payment checks right now and to try again later. A collection stays `pending`. Nothing was charged; try again later.

## Moving to the next plan

Moving up (for example Basic to Pro) adds that plan's parts for the owner's style in one permission change, signed once. Moving to a smaller plan is not available as of 0.1.8; turning off renewal is the way to stop paying.

1. `get_plan_layout` with `safe`.
2. `present_plan_move_for_signing` with `safe` and `move` (`upgrade` or `layout`). Paste `signing_link`; relay `tell_the_user`.
3. `submit_plan_move_signature` with the same `safe` and `move`, the `confirm` reference and the pasted `signature`. It installs the parts and stages them as one pending permissions change.
4. If the answer has `stage: "plan_change_needed"` (a successful answer, not a refusal), the plan does not cover a part yet: nothing was staged and the owner's signature was used. Pay for the plan first (`present_subscription_quote` and its approval), then give the owner the link in `fresh_signing` (or present the move again).
5. Otherwise `prepare_checkout` and give the owner its one signing step (see [Approvals](https://dialectic-orbit-docs.vercel.app/0.1.8/concepts/approvals/)).

## Automatic renewal

Automatic renewal is the owner's signed consent in the mandate: `global.auto_renew`, a plan and the most one period may cost, in the form `"<tier> up to <price>"` (USDC). It is `"none"` unless the owner chose it. With it, the agent renews exactly one period from the payer Safe with no new signature, only for that plan and only up to that price.

`renew_subscription` with `safe`:

- Does nothing when nothing is due, so a daily routine may call it.
- Renews from a fixed lead time before `next_payment_due` (a `not_due` answer's `renews_from` says when), and during grace.
- Never approves more than one period and never collects twice for one period.
- Holds a lock per payer Safe: one renewal at a time across processes.

### Renewal outcomes

| `status` | What it means | What to do |
|---|---|---|
| `renewed` | The curator reported the payment pulled | Read `get_billing_status` to confirm the new period. Do not call again for this period |
| `not_due` | No renewal is due now, or this period's automatic payment is already on record | Nothing. Call again on your routine. `renews_from` says when |
| `no_consent` | The mandate has no `global.auto_renew` | Ask the owner each period, or propose a mandate revision with automatic renewal |
| `needs_owner` | Orbit has no record of an earlier payment for this plan (the first renewal after an update, after a payment made outside Orbit, or with a new curator endpoint: the owner approves it by hand, later ones are automatic); the period or price changed since the last payment; the plan or currency differs from the signed one; the price is above the signed maximum; Orbit's payment record is unreadable; a stop left a one-period approval standing (`code: "allowance_standing"`); or the curator did not collect the last automatic payment (`code: "curator_not_due"`). `reason` says which | Tell the owner and wait. Do not renew by hand without their answer. If `funds` is present, the Safe is also short: tell the owner both. You may still free USDC within the limits as for `funds_short` (below), then ask the owner only for what remains |
| `funds_short` | Every other check passed, and the payer Safe's USDC is below the price of this period (from the current signed terms). Nothing was approved or collected | Free the USDC (below), then call again |
| `approval_unavailable` | The one-period approval could not be prepared. `code`, `reason`, `retry` and `fix` say why | Follow `fix`; see below |
| `approval_not_confirmed` | The approval was sent but not confirmed | Read `get_billing_status` before trying again |
| `collection_not_requested` | Orbit did not ask the curator to collect | Read `get_billing_status`; `note` says why |
| `payment_pending`, `payment_unconfirmed` | A collection was requested and is not confirmed yet | Do not renew again. Read `get_billing_status` later |
| `not_collected` | The curator did not collect; `collection` says why (including when paid access was declined for this wallet; see above) | Tell the owner; do not retry on your own |
| `in_progress` | Another renewal for this Safe is running | Do not start a second one |

Any stop before a collection withdraws the consent that call confirmed, so nothing is left half-done.

### `funds_short`: free the USDC yourself where you can

Nothing was approved or collected. The tool's `next` says the renewal needs more free USDC in the Base Safe that pays, and to free it within the owner's limits (for example by withdrawing from a position) or tell the owner. Often the Safe holds the money, just not as free USDC: it sits in a position. Exiting or reducing a position is inside the agent's authority (exits are never blocked by limits), and so is bridging USDC back to Base from another of the owner's Safes. So:

1. Check `get_portfolio` for the payer Safe and the owner's other Safes.
2. If a position or another Safe holds enough, free the shortfall yourself (a withdraw, or a [bridge](https://dialectic-orbit-docs.vercel.app/0.1.8/using/bridging/) to Base), inside the limits, and tell the owner what you did.
3. Call `renew_subscription` again.
4. Only when the owner's Safes hold no money you can free, ask the owner to add USDC.

### `approval_unavailable`

Read `code`, `reason` and `fix` first. Known codes:

| `code` | Meaning | Fix |
|---|---|---|
| `permissions_update_required` | The installed payment package is current, and the Safe's active permissions were composed from an older version of it | `fix`: a permission update with `compose_root`, which the owner signs (from chat with `present_batch_for_signing`, or under Pending changes on the owner page); then renew again |
| `package_update_required` | The installed payment package needs its publisher's update | Nothing for the owner; wait for the publisher's release |
| `issuer_unavailable` (`retry: true`) | The curator did not answer | Try again on the next run |
| `issuer_binding_mismatch` | The plan key is not tied to this payer Safe | Register this Safe's own key for the plan's issuer |
| `issuer_duplicate` | The issuer is registered more than once for this Safe | Keep one registration |
| `package_reinstall_required` | The installed subscription package is older than the version offered now | `install_package` for the `package_id` it names, then renew again (below) |

**A stale local copy of the payment package: `package_reinstall_required`.** When the locally installed `dialectic/basic-ops-subscribe` is older than the version its publisher offers now, `renew_subscription` answers `approval_unavailable` with `code: "package_reinstall_required"`, its `fix` and the `package_id`; `prepare_subscription_approval` and `prepare_checkout` refuse with the same code. Nothing was charged. The fix is `install_package` for `dialectic/basic-ops-subscribe` on that Safe, then try again. `install_package` is a local step: it replaces the local record with the catalog's current signed version, needs no owner signature and changes nothing on chain. Do not answer this case with `compose_root`: composing from the old local copy does not fix it.

### `not_due` while billing says free or due

`renew_subscription` decides "due" from the curator's billing picture (with one index reconciliation) and from Orbit's own payment record. If billing reads `free` or `due` but renewal says `not_due`:

- The curator's index may not have caught up with an earlier payment. Read `get_billing_status` again later.
- Orbit's record may already hold this period's automatic payment. `not_due` with "this period's automatic payment is already on record" means Orbit will not pay twice; if the curator never collected it, the answer becomes `needs_owner` with `code: "curator_not_due"`, and the owner decides.

### "Reconcile the original subscription collection"

This refusal (from `prepare_subscription_approval` or a new quote) means an earlier collection is recorded in a state Orbit cannot settle yet, so a new quote cannot be prepared. Nothing is wrong with the Safe. The refusal itself names no remedy; these steps are the remedy.

1. Call `get_billing_status` with the default `refresh_index`: it reconciles a recorded pending payment once.
2. If the collection's outcome is still unknown, find the operation in `list_incomplete_operations`, establish on chain whether it went out, and record it with `resolve_operation` (`finding: "not_executed"` with evidence such as an unchanged allowance, or `"executed"` with the transaction hash). Its sibling refusal, for an unresolved earlier **approval**, names that operation directly; handle it the same way.
3. If it persists while billing already shows the plan paid, report it to support with a support bundle; do not loop.

## Credentials

A curator credential is separate from a plan. Reuse one when it exists. An existing key is entered only in the owner's own terminal (`orbit-mcp register-api-key --curator <name> --safe <Safe address>`). When one must be bought, `get_credential_quote` reads a quote without spending; show its chain, asset, amount, payer, expiry and maxima (`purchase_cap_base_units`, `fee_cap_wei`, fixed at the original quote), get the owner's yes, then `acquire_credential` with the same `safe` and revision. Never repeat a payment of unknown result, and never put a key or proof in chat.

## Pitfalls seen in real agents

- Asking the owner for money on `funds_short` while the Safe held the USDC in a position the agent could exit.
- Retrying `renew_subscription` in a loop on `not_due`. It is a daily routine call; once is enough.
- Calling `check_now` again because billing had not updated yet. Read `get_billing_status` later instead.
- Running `compose_root` for an `approval_unavailable` with no `code` caused by a stale local payment package. `install_package` is the fix.
- Calling a `null` `min_tier` "free".
