Payment lifecycle
The states one payment passes through, from the agent's request to the receipt, including approvals, denials and payments whose outcome is not yet known.
Follow one payment
Pick a scenario and step through it. The state names on the right are the ones Abazi records.
Payment lifecycle
What happens between a request and a receipt, including denials and approvals?
- Request
- Quote
- Decision
- Reservation
- Signing
- Submitted
- Settled
- Receipt
Request · step 1 of 8
The agent calls one tool with what it wants and an idempotency key. Abazi creates one payment intent.
Payment state
- current state: created
- awaiting_approval
- reserved
- signing
- submitted
- reconciling
- confirmed
- failed
- denied
- refunded
Path: created
Text description
A payment moves through eight stages: request, quote, decision, reservation, signing, submitted, settled and receipt. Its recorded state follows the payment state machine: created, then awaiting_approval or reserved or denied, then signing, submitted, and confirmed or failed; an unclear outcome goes to reconciling until the network answers.
Allowed
- Request (state created): The agent calls one tool with what it wants and an idempotency key. Abazi creates one payment intent.
- Quote: Abazi quotes the price and payout address from the Catalog, never from the agent, and Shield screens the purchase.
- Decision: The policy engine runs its fixed order. Nothing hits, so the decision is ALLOW. Reason code WITHIN_POLICY.
- Reservation (state reserved): The amount is reserved at organization, team and agent level in one transaction.
- Signing (state signing): The signer rechecks the pause switch, the mandate, the held reservation and the purchase fingerprint, then signs once.
- Submitted (state submitted): The rail adapter sends the payment. Abazi records the settlement reference and polls the network.
- Settled (state confirmed): The network confirms. The reservation is committed and the double-entry ledger posts.
- Receipt: A signed, hash-chained receipt is issued and its hash is anchored on Solana. Anyone with the link can verify it.
Needs approval
- Request (state created): The agent calls one tool with what it wants and an idempotency key. Abazi creates one payment intent.
- Quote: Abazi quotes the price and payout address from the Catalog, never from the agent, and Shield screens the purchase.
- Decision (state awaiting_approval): The amount is above the auto-approve limit, so the decision is REQUIRE APPROVAL. Approvers get a one-time link; nothing is reserved yet. Reason code ABOVE_AUTO_THRESHOLD.
- Decision: An approver approves with a passkey before the link expires (10 minutes). The policy runs again: the approval clears steps 5 to 7 only, every deny step still runs. Reason code WITHIN_POLICY.
- Reservation (state reserved): Only now is the amount reserved at organization, team and agent level.
- Signing (state signing): The signer rechecks the pause switch, the mandate, the held reservation and the purchase fingerprint, then signs once.
- Submitted (state submitted): The rail adapter sends the payment. Abazi records the settlement reference and polls the network.
- Settled (state confirmed): The network confirms. The reservation is committed and the double-entry ledger posts.
- Receipt: A signed, hash-chained receipt is issued and its hash is anchored on Solana. Anyone with the link can verify it.
Denied
- Request (state created): The agent calls one tool with what it wants and an idempotency key. Abazi creates one payment intent.
- Quote: Abazi quotes the price and payout address from the Catalog, never from the agent, and Shield screens the purchase.
- Decision (state denied): The amount is above the per-purchase hard cap. The decision is DENY with a reason code the agent can act on. Reason code HARD_CAP_EXCEEDED.
- Decision: Nothing is reserved and nothing is signed. The decision and its step-by-step trace are stored; the agent receives the code, the message and the next action.
Unknown outcome
- Request (state created): The agent calls one tool with what it wants and an idempotency key. Abazi creates one payment intent.
- Quote: Abazi quotes the price and payout address from the Catalog, never from the agent, and Shield screens the purchase.
- Decision: The policy engine allows the purchase. Reason code WITHIN_POLICY.
- Reservation (state reserved): The amount is reserved at all three levels.
- Signing (state signing): The signer rechecks the pause switch, the mandate, the held reservation and the purchase fingerprint, then signs once.
- Submitted (state reconciling): The send times out after the payment may have left. Abazi never signs twice: the intent moves to reconciling and the funds stay held.
- Settled (state confirmed): Reconciliation reads the network. Here the payment did land, so the intent is confirmed, the reservation committed and the ledger posted. Had it not landed, the intent would fail and the reservation would be released.
- Receipt: A signed, hash-chained receipt is issued and its hash is anchored on Solana. Anyone with the link can verify it.
The stages
- Request. The agent calls one tool with what it wants and an idempotency key. Repeating the key returns the same intent; a different request under the same key is refused.
- Quote. Abazi prices the purchase from the Catalog or from the merchant's live 402 response, never from a number the agent sends. Shield screens the purchase and its text.
- Decision. The policy engine runs its fixed order and returns ALLOW, REQUIRE APPROVAL or DENY with a reason code. See Mandates and policy.
- Reservation. On ALLOW, the amount is reserved at organization, team and agent level in one transaction. On REQUIRE APPROVAL, nothing is reserved until a person approves and the policy runs again.
- Signing. A durable workflow hands the payment to the signer. The signer rechecks the pause switch, the mandate, the held reservation and the purchase fingerprint, then signs once.
- Submitted. The rail adapter sends the payment and Abazi records the settlement reference.
- Settled. Abazi polls the network until the payment is final. The reservation commits and the double-entry ledger posts.
- Receipt. A signed, hash-chained receipt is issued and its hash is anchored on Solana.
States
These are the only state changes the payment record allows. Anything else is refused.
| From | Can move to |
|---|---|
| created | denied, awaiting_approval, reserved |
| awaiting_approval | reserved, denied |
| reserved | signing, denied |
| signing | submitted, failed, reconciling |
| submitted | confirmed, failed, reconciling |
| reconciling | confirmed, failed |
| confirmed | refunded |
| State | Means | Money |
|---|---|---|
| created | The intent exists and is being decided. | Nothing reserved. |
| awaiting_approval | The policy asked for a person. | Nothing reserved yet. |
| denied | The policy, the signer or an approver said no. | Any reservation is released. |
| reserved | The amount is held at all three budget levels. | Held. |
| signing | The signer is checking and signing. | Held. |
| submitted | The payment was sent on its rail. | Held. |
| reconciling | The outcome is unclear, for example a timeout after the payment may have left. | Held until the network answers. |
| confirmed | The network confirmed the payment. | Committed; ledger posted; receipt issued. |
| failed | The payment did not happen. | Released. |
| refunded | The merchant returned the money after a dispute or refund. | Returned, with its own receipt. |
Approvals inside the lifecycle
When a purchase needs a person, approvers get a one-time link that expires after 10 minutes. Approving takes a passkey. After an approval, the policy engine runs again with the approval attached: steps 5 to 7 pass as approved by the owner, and every deny step still runs. If the purchase changed in the meantime (price, payout address, network or anything else in its fingerprint), the approval is invalidated and the payment is denied with APPROVAL_INVALIDATED. See Approvals.
Failure cases
| Situation | State path | Reason code |
|---|---|---|
| The purchase is above the hard cap | created → denied | HARD_CAP_EXCEEDED |
| Nobody approves in time | created → awaiting_approval → denied | APPROVAL_EXPIRED |
| An approver rejects | created → awaiting_approval → denied | APPROVAL_REJECTED |
| The owner pauses payments after the reservation | created → reserved → denied | KILL_SWITCH_ACTIVE |
| The send times out after the payment may have left | … signing → reconciling → confirmed or failed | none until the network answers |
| The network rejects the transaction | … submitted → failed | none; the reservation is released |
Abazi never retries a signed payment blindly. A payment whose outcome is unknown stays in reconciling, with its money held, until a check against the network says whether it landed.
Next steps
System map
Where every part of Abazi sits, which parts stay fixed for every rail, which part swaps, and what each part holds.
Trust zones
Which part of Abazi may hold which secret, which part may sign, and exactly what crosses each boundary between the agent, the core, the signer, the owner, the merchant and the public.