# Billing

How installments and subscriptions run on Solana, approved once for their full terms and pulled on schedule through an on-chain subscription program with a cap per period.

<ShortProductTruth>**Approved once, capped every period.** Billing turns one approval of a plan's full terms into scheduled payments on Solana, each pull limited on chain, and stops them with one cancel.</ShortProductTruth>


## The problem it removes [#the-problem-it-removes]

A recurring payment can quietly become an open tab: the first charge is approved and the rest are taken on trust. Abazi Billing shows the owner every term before anything is approved, and bounds each pull on chain, so Abazi cannot take more in a period than the plan allows, even if its own records were wrong.

## Who uses it [#who-uses-it]

| Who | How |
| --- | --- |
| Merchants | Publish a plan: installments or a subscription, with the number of payments, the amount and the period. Only VERIFIED merchants with a Solana payout address can publish. |
| Agents | Start a plan in one call with `request_installment_purchase`. |
| Owners | Read the terms, approve with a passkey, follow each payment and cancel at any time. |

## How it works [#how-it-works]

1. **Request.** The agent asks for a plan. The policy engine checks the plan total against the plan hard cap and asks a person to approve.
2. **Approve the full terms.** The approver sees the total, the number of payments, each amount, the schedule and how to cancel, then signs with a passkey.
3. **Set up on chain.** Abazi funds a separate account for this plan, owned by the owner, and creates a recurring delegation to its signer through an on-chain subscription program on Solana. The delegation caps what can be pulled each period. The plan total is reserved at organization, team and agent level.
4. **Pull on schedule.** Each period a durable workflow pulls one payment to the merchant, waits for confirmation, commits it and issues a receipt. After the last payment the plan is complete.
5. **Cancel.** One action stops future pulls and releases what was reserved but not yet paid.

How long a period lasts in the current environment is listed on [Environments](/docs/platform/environments).

## Limits in the example mandate [#limits-in-the-example-mandate]

| Limit | Example value |
| --- | --- |
| Plan hard cap | <Limit name="planHardCap" /> |
| Example plan | <Limit name="plan" /> |

## Screens [#screens]

<Screenshot id="console-plans" />

<Screenshot id="merchant-plans" />

## Boundaries [#boundaries]

| Case | What happens |
| --- | --- |
| The plan total is above the plan hard cap | DENY with <ReasonCode code="HARD_CAP_EXCEEDED" />. |
| Not enough budget for the plan total | DENY with <ReasonCode code="BUDGET_EXCEEDED" />. |
| A pull fails | It is retried once after one period; if that fails too, the plan is marked failed. |
| The plan is cancelled before it is approved | Its purchase is closed with <ReasonCode code="APPROVAL_INVALIDATED" />. |

Plans run on Solana, in USDC.

## API [#api]

The Plans operations in the API reference, each with its parameters, responses and code samples:

<ApiOperationList ids={['createInstallmentPurchase', 'listPlans', 'getPlan', 'cancelPlan', 'completePlanWalletStep', 'listPlanOffers', 'createPlanOffer', 'updatePlanOffer']} />

## Next steps [#next-steps]

<Cards>
  <Card title="Installments and subscriptions" href="/docs/concepts/installments-and-subscriptions" description="Understand plan accounts, delegations and the plan hard cap." />
  <Card title="Sell on a plan" href="/docs/guides/sell-on-a-plan" description="Publish a plan as a merchant and watch an agent start it." />
  <Card title="Wallet" href="/docs/products/wallet" description="See how plan accounts sit beside the owner's main spending permission." />
</Cards>

