# State machines

Every state each Abazi object can be in and the moves allowed between them, from payment intents to webhook deliveries.

<ShortProductTruth>Each object in Abazi moves through a small, fixed state machine. A move that is not listed below is refused by the API, so these tables are also a list of what cannot happen. The tables are generated from the same state definitions the product enforces.</ShortProductTruth>

## Payment intent [#payment-intent]

From request to confirmation. `reconciling` holds a payment whose outcome is unknown after signing: the money stays reserved until the network gives an answer.

<StateMachine name="payment" />

## Approval [#approval]

A request for a person. Expires after the approval window; a changed price or payee invalidates it.

<StateMachine name="approval" />

## Delivery [#delivery]

Tracked apart from payment, because paid does not always mean delivered.

<StateMachine name="fulfillment" />

## Mandate [#mandate]

A version starts as a draft and becomes active when the owner signs it. It ends when a newer version supersedes it, the owner revokes it, or it expires.

<StateMachine name="mandate" />

## On-chain permission [#on-chain-permission]

The capped permission an owner signs on Solana. It ends when the owner removes it, when the cap is used up, or when it expires.

<StateMachine name="delegation" />

## Plan [#plan]

An installment plan or subscription, approved once for its full terms.

<StateMachine name="plan" />

## Plan payment [#plan-payment]

One scheduled pull of a plan, with one retry if it fails.

<StateMachine name="plan_payment" />

## Virtual card [#virtual-card]

One card per agent: active, paused or closed.

<StateMachine name="card" />

## Card authorization [#card-authorization]

Each authorization the card issuer asks Abazi to decide in real time.

<StateMachine name="card_authorization" />

## Merchant tier [#merchant-tier]

UNKNOWN, KNOWN, VERIFIED, and the resets that send a merchant back to UNKNOWN.

<StateMachine name="merchant_tier" />

## Dispute [#dispute]

Opened from a receipt. The merchant accepts or contests it with evidence; it ends refunded or closed.

<StateMachine name="dispute" />

## Refund [#refund]

A refund on a stablecoin or card rail, with its own receipt.

<StateMachine name="refund" />

## Webhook delivery [#webhook-delivery]

Retries until delivered or dead.

<StateMachine name="webhook_delivery" />

## Next steps [#next-steps]

<Cards>
  <Card title="Payment lifecycle" href="/docs/architecture/payment-lifecycle" description="See the payment states as one interactive path, with denials and approvals." />
  <Card title="Events and webhooks" href="/docs/webhooks" description="Subscribe to the events these moves produce." />
  <Card title="Reason codes" href="/docs/api/errors-and-reason-codes" description="Read why a payment ended in denied." />
</Cards>

