# Sell on a plan

Publish an installment or subscription plan as a verified merchant, have an agent request it, and see the owner approve all the terms once while each pull stays capped on chain.

<ShortProductTruth>**Approve once. Capped on every pull.** A plan is a fixed number of equal payments. The owner approves all the terms at once, and an on-chain delegation lets Abazi pull no more than one payment per period.</ShortProductTruth>

## What you end up with [#what-you-end-up-with]

A plan on the merchant's page, for example a plan of <Limit name="plan" />. An agent asks for it, the owner approves the whole plan with a passkey, and payments arrive on schedule, each with its own receipt. The owner can cancel in one action and gets back whatever has not been pulled.

## Installments and subscriptions [#installments-and-subscriptions]

Both are a fixed count of equal payments, one per period. "Subscription" and "installment" are labels on the merchant's offer; there is no open-ended plan. Plans run on Solana in USDC.

## Steps [#steps]

<Steps>
<Step>

### Publish the plan [#publish-the-plan]

A verified merchant publishes a plan in the merchant console: the amount per payment, the number of payments, the period, the payout address and the cancellation terms. Only verified merchants, paid at their verified payout address, can publish plans.

</Step>
<Step>

### The agent requests it [#the-agent-requests-it]

The agent calls `request_installment_purchase` with the plan id, a task id and an idempotency key. Abazi creates the plan with its full terms (count, amount, period, total, network, payee, asset and cancellation text) and one purchase for the total.

</Step>
<Step>

### The policy always asks a person [#the-policy-always-asks-a-person]

The total is checked against the plan hard cap (<Limit name="planHardCap" /> in the example mandate); above it, the plan is denied with <ReasonCode code="HARD_CAP_EXCEEDED" />. Below it, a plan always needs approval, whatever the auto-approve limit says.

</Step>
<Step>

### The owner approves the terms once [#the-owner-approves-the-terms-once]

The owner approves with a passkey; the signed challenge is bound to the hash of the plan's terms. Abazi re-checks the policy and holds the total in the budget. A second step sets up the on-chain side: the plan total moves into a dedicated plan account, and a recurring delegation lets Abazi's signer pull at most the per-period amount, once per period, until the plan ends.

<Screenshot id="console-plans" />

</Step>
<Step>

### Payments are pulled on schedule [#payments-are-pulled-on-schedule]

A durable schedule pulls each payment when it is due. Each pull is booked like a payment: budget, ledger, settlement and an installment receipt. An extra pull beyond what the delegation allows is rejected on chain.

</Step>
</Steps>

## Cancelling [#cancelling]

Cancelling is one action in the Console. Abazi skips the remaining payments, releases the held budget and revokes the on-chain delegation; what is left in the plan account goes back to the owner. Abazi's signer cannot revoke the delegation on its own behalf, and it cannot pull after it is revoked.

## What the merchant sees [#what-the-merchant-sees]

The merchant console lists each plan with its active and total subscribers. A subscriber appears as an agent of the paying organization; agent ids, approval ids and payment ids are not shown.

## Failure cases [#failure-cases]

| Situation | Result |
| --- | --- |
| The plan total is above the plan hard cap | Denied with <ReasonCode code="HARD_CAP_EXCEEDED" />. |
| Nobody approves in time | Denied with <ReasonCode code="APPROVAL_EXPIRED" />. |
| A pull fails | It is tried once more one period later. A second failure marks the plan failed, skips the rest, releases the budget and tells the owner. |
| The owner cancels | Remaining payments are skipped; unpulled funds return to the owner. |

<StateMachine name="plan" />

## Next steps [#next-steps]

<Cards>
  <Card title="Installments and subscriptions" href="/docs/concepts/installments-and-subscriptions" description="Read how plan pulls are bounded on chain, not only in a database." />
  <Card title="Billing" href="/docs/products/billing" description="See what Abazi Billing covers for merchants and owners." />
  <Card title="Merchant trust tiers" href="/docs/concepts/merchant-trust-tiers" description="Find out how a merchant becomes verified, which plans require." />
</Cards>

