# Installments and subscriptions

How a plan is approved once for its full terms, paid by scheduled pulls that a Solana program caps per period, and cancelled in one action.

<ShortProductTruth>A plan is a merchant's published offer: a number of payments, an amount per payment and a period. A person approves the full terms once with a passkey, and Abazi pulls each payment on schedule, capped twice: by the budget reservation and by a subscription program on Solana.</ShortProductTruth>

## Who needs it [#who-needs-it]

Owners, who want recurring purchases approved once with every term visible, and stopped in one action. Merchants, who sell a service in installments or by subscription. Agents, which start a plan with one call.

## What a plan is [#what-a-plan-is]

A verified merchant publishes a plan offer with a count, an amount per payment, a period, the network and the payout address. Plans run on Solana in USDC. An **installment** plan splits one total into equal parts; a **subscription** repeats a fixed amount for a fixed number of periods. Both use the same mechanism.

The example plan is <Limit name="plan" />.

## How a plan runs [#how-a-plan-runs]

<Steps>
  <Step>**Request.** The agent calls `request_installment_purchase` with the offer. Abazi checks the total against the plan hard cap, <Limit name="planHardCap" /> in the example mandate. Plans have their own cap because a total is larger than a single purchase.</Step>
  <Step>**Always a person.** The policy always returns REQUIRE APPROVAL for a plan. The approver sees every payment, the schedule, the merchant and its tier, and that cancelling stops the remaining payments.</Step>
  <Step>**Sign the terms.** The approver signs a closed mandate over the plan terms with a passkey. The total is reserved at organization, team and agent level.</Step>
  <Step>**Fund a plan account.** The owner's USDC funds a new account for this plan only, owned by the owner. Through the Solana subscription program, Abazi's signer becomes its delegate for an amount per period.</Step>
  <Step>**Pull on schedule.** A durable workflow pulls once per period: a transfer to the merchant, a confirmation, one share of the reservation committed, an installment receipt and an event.</Step>
  <Step>**Complete.** After the last pull, the plan is completed.</Step>
</Steps>

A period is one day by default.

<Screenshot id="console-plans" />

## Why a separate plan account [#why-a-separate-plan-account]

A Solana token account has one delegate, and a new approval replaces the old one. The owner's main USDC account already delegates to Abazi for x402 payments. So each plan gets its own owner-owned account, and two plans never share one.

## Boundary [#boundary]

- **Capped twice.** The reservation limits the plan in Abazi's database, and the subscription program limits each pull on chain. A pull above the period amount, or after the plan expires, is rejected by the program.
- **Cancel is one action.** In the Console, cancel marks the plan cancelled, skips the pulls not yet made, releases the unpaid rest of the reservation, and revokes the on-chain delegation.
- **Revoking the agent cancels its plans.**
- **Only verified merchants** can publish plans, and only on Solana.

## Example [#example]

The example plan, cancelled halfway:

| Moment | Plan | Budget |
| --- | --- | --- |
| Approved with a passkey | Active | The full total reserved |
| First and second pulls | Two installment receipts | Two shares committed |
| The owner cancels | Cancelled; the last two pulls are skipped | The remaining two shares released |

## Failure cases [#failure-cases]

| Case | Result |
| --- | --- |
| The total is above the plan hard cap | DENY <ReasonCode code="HARD_CAP_EXCEEDED" />. |
| The approver rejects, or the approval expires | The plan is cancelled. Nothing is reserved. |
| The plan is cancelled before it starts | The purchase is denied with <ReasonCode code="APPROVAL_INVALIDATED" />. |
| A pull fails, for example for lack of funds | Retried once, a period later. A second failure marks the plan failed, skips the rest, releases the budget and notifies the owner. |

<StateMachine name="plan" />

<StateMachine name="plan_payment" />

## How to verify [#how-to-verify]

- The Console's plans page lists each plan with the amount paid, the next pull and the delegation transaction.
- Each pull has its own installment receipt, checked like any other. See [Receipts and proof](/docs/concepts/receipts-and-proof).

## Next steps [#next-steps]

<Cards>
  <Card title="Sell on a plan" href="/docs/guides/sell-on-a-plan" description="Publish a plan offer as a merchant and see what the approver sees." />
  <Card title="Billing" href="/docs/products/billing" description="See plans as a product, with screens and endpoints." />
  <Card title="Budgets and reservations" href="/docs/concepts/budgets-and-reservations" description="Learn why a plan reserves once and commits per pull." />
</Cards>

