Start

How a payment works

Follow one agent purchase end to end, from the idempotent request through the policy decision, reservation, signing, settlement and reconciliation to the signed receipt.

View as .mdUpdated
Agents can decide. Now they can pay. The agent asks once. Abazi prices the purchase, decides, holds the money, has the signer check everything again, settles on the rail, posts the ledger and issues a receipt anyone can check.

The whole path

Payment lifecycle

What happens between a request and a receipt, including denials and approvals?

Scenario
Step 1 of 8
  1. Request
  2. Quote
  3. Decision
  4. Reservation
  5. Signing
  6. Submitted
  7. Settled
  8. 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

  1. Request (state created): The agent calls one tool with what it wants and an idempotency key. Abazi creates one payment intent.
  2. Quote: Abazi quotes the price and payout address from the Catalog, never from the agent, and Shield screens the purchase.
  3. Decision: The policy engine runs its fixed order. Nothing hits, so the decision is ALLOW. Reason code WITHIN_POLICY.
  4. Reservation (state reserved): The amount is reserved at organization, team and agent level in one transaction.
  5. Signing (state signing): The signer rechecks the pause switch, the mandate, the held reservation and the purchase fingerprint, then signs once.
  6. Submitted (state submitted): The rail adapter sends the payment. Abazi records the settlement reference and polls the network.
  7. Settled (state confirmed): The network confirms. The reservation is committed and the double-entry ledger posts.
  8. Receipt: A signed, hash-chained receipt is issued and its hash is anchored on Solana. Anyone with the link can verify it.

Needs approval

  1. Request (state created): The agent calls one tool with what it wants and an idempotency key. Abazi creates one payment intent.
  2. Quote: Abazi quotes the price and payout address from the Catalog, never from the agent, and Shield screens the purchase.
  3. 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.
  4. 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.
  5. Reservation (state reserved): Only now is the amount reserved at organization, team and agent level.
  6. Signing (state signing): The signer rechecks the pause switch, the mandate, the held reservation and the purchase fingerprint, then signs once.
  7. Submitted (state submitted): The rail adapter sends the payment. Abazi records the settlement reference and polls the network.
  8. Settled (state confirmed): The network confirms. The reservation is committed and the double-entry ledger posts.
  9. Receipt: A signed, hash-chained receipt is issued and its hash is anchored on Solana. Anyone with the link can verify it.

Denied

  1. Request (state created): The agent calls one tool with what it wants and an idempotency key. Abazi creates one payment intent.
  2. Quote: Abazi quotes the price and payout address from the Catalog, never from the agent, and Shield screens the purchase.
  3. 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.
  4. 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

  1. Request (state created): The agent calls one tool with what it wants and an idempotency key. Abazi creates one payment intent.
  2. Quote: Abazi quotes the price and payout address from the Catalog, never from the agent, and Shield screens the purchase.
  3. Decision: The policy engine allows the purchase. Reason code WITHIN_POLICY.
  4. Reservation (state reserved): The amount is reserved at all three levels.
  5. Signing (state signing): The signer rechecks the pause switch, the mandate, the held reservation and the purchase fingerprint, then signs once.
  6. 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.
  7. 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.
  8. Receipt: A signed, hash-chained receipt is issued and its hash is anchored on Solana. Anyone with the link can verify it.

Nothing is signed unless the policy says ALLOW, or a person approved and the policy then allows. Every step below writes a record you can read later in the Console: the intent, the decision with its trace, the reservation, the settlement, the ledger posting and the receipt.

1. Request, with an idempotency key

The agent calls request_purchase over MCP, or creates a payment intent over REST, with its Abazi agent credential. It names either a service from the Catalog or a URL that answers with a 402 response, and it sends an idempotency key. The key is required.

The agent sendsAbazi answers
A new keyA new payment intent.
The same key with the same requestThe same intent again. Nothing is bought twice.
The same key with a different requestAn error: the key was used with a different request.

When an intent waits for approval or for reconciliation, the agent is told to wait and check the status with get_purchase_status, not to retry with a new key.

2. Quote

Abazi works out what the purchase costs and whom to pay. The agent never supplies a price, an address, an asset or a network.

  • For x402, Abazi calls the merchant's URL and reads its 402 payment requirements.
  • For a Catalog service, it compares those requirements with the listing: payout address, asset, network, amount and service. Any difference is denied at policy step 2, for example PAYTO_MISMATCH.
  • For direct USDT and for cards, the price and payout come from the Catalog.

Abazi then picks one network: the first in the mandate's order that is allowed and has funds (see How Abazi chooses a network). It also computes a fingerprint: a SHA-256 hash over the rail, merchant, payee, asset, network, amount, URL and request body. The fingerprint pins the exact purchase that later steps may sign.

3. Decision

Shield screens the merchant and the text of the purchase. Then the policy engine, a pure function with no model, no clock and no network call, runs its steps in a fixed order. The first step that hits decides.

DecisionWhat happens nextMoney
ALLOWGo to the reservation.Not yet held
REQUIRE APPROVALAn approver is notified; the intent waits up to 10 minutes. See Approvals.Nothing held while waiting
DENYThe agent receives the reason code and a next action.Nothing held

The order and every code are in Mandates and policy.

4. Reservation

On ALLOW, the amount is held at organization, team and agent level in one database transaction, locking the three budget rows in that order. If any level has too little left, the purchase is denied with BUDGET_EXCEEDED and the level that ran out, and nothing is held anywhere. See Budgets and reservations.

5. The signer checks again

A durable workflow hands the intent to the signer, the only part of Abazi that holds signing keys. Before it signs, the signer checks again:

  • payments are not paused, for the organization or globally;
  • the agent is active and its mandate is present, unexpired and not revoked;
  • the reservation is still held;
  • the fingerprint of the intent still matches the one that was decided or approved.

If any check fails, nothing is signed and the intent is denied. The reservation is released.

6. Settlement and confirmation

The rail sends the payment on its network: an x402 facilitator settles USDC, a direct transfer moves USDT, or the card issuer authorizes the card. Abazi then polls for confirmation, every 1.5 seconds for up to about a minute.

OutcomeStateMoney
Confirmed on the networkconfirmedThe reservation commits.
Rejected before anything was broadcastfailedThe reservation is released.
Sent, but not confirmed or not readable in timereconcilingThe reservation stays held.

7. Reconciliation of unknown outcomes

An unknown outcome is never retried by signing again. A payment that was signed is never signed a second time, also after a restart. Instead the intent goes to reconciling: a background task looks the transaction up on its network again, and finance can re-check it from the reconciliation view. When the network confirms it, the payment completes as usual. When it shows the payment failed, the reservation is released. Each settlement is also marked matched or unmatched, by comparing the amount and payee seen on the network with the intent.

8. Ledger and receipt

On confirmation, in one database transaction:

  • the reservation commits at all three budget levels;
  • the double-entry ledger posts balanced entries for the payment;
  • a receipt is issued: canonical JSON, hashed with SHA-256, signed with Ed25519 and linked to the organization's previous receipt;
  • payment.confirmed is queued for webhooks.

Shortly after, a background task anchors the receipt hash on Solana in a memo transaction. Until that transaction is finalized, the receipt's anchor check reads PENDING; the payment itself is already complete.

Delivery is tracked apart from payment. A payment can be confirmed while the merchant's response failed; the owner can then open a dispute from the receipt.

Payment detail with the policy trace
One payment: the policy trace step by step, the reservation and the settlement.Captured 2026-11-16

The states of a payment

FromCan move to
createddenied, awaiting_approval, reserved
awaiting_approvalreserved, denied
reservedsigning, denied
signingsubmitted, failed, reconciling
submittedconfirmed, failed, reconciling
reconcilingconfirmed, failed
confirmedrefunded

created is the request; awaiting_approval waits for a person; reserved holds the money; signing and submitted are with the signer and the rail; reconciling is an unknown outcome being looked up; confirmed is final unless a refund follows.

Example

A walk-through with the limits of the example mandate.

PurchasePath
A verified merchant's service below the auto-approve limit of 0.10 USDCcreated → reserved → signing → submitted → confirmed, receipt issued
The same service above it, below the hard cap of 0.50 USDCcreated → awaiting_approval, then after a passkey approval the same path to confirmed
A purchase above the hard capcreated → denied with HARD_CAP_EXCEEDED, nothing held
The network does not confirm within the polling windowsubmitted → reconciling → confirmed once the lookup finds it

Failure cases

Where it stopsWhat the agent seesMoney
Policy deniesThe reason code and a next actionNothing held
The approver rejects, or nobody decides in timeAPPROVAL_REJECTED or APPROVAL_EXPIREDNothing held
The price or payee changed after the approvalAPPROVAL_INVALIDATEDNothing signed
The rail rejects before broadcastfailedReleased
The outcome is unknownA pending status that says the payment will not be sent twiceHeld until resolved

How to verify

Every receipt can be checked by anyone with its link: the public page runs four checks (hash, signature, chain link, on-chain anchor) without an account. See Verify a receipt.

Next steps

On this page