Operator
Transactions
GET /api/transactions reads journaled purchases, linking payment, any hold, backend call and receipt with a state derived from saved records.
transactionId.The journal links a paid purchase's payment attempt, any AP2 hold, backend call and receipt under one transactionId. The built-in SQLite store creates the row and payment attempt together during replay reservation. Free calls, 402 challenges and refused replays have no row. Journal entries hold references and an optional input digest; keep payment proofs, signatures, mandates and input bodies out of them. Both routes require the admin token.
List transactions
/api/transactionsBearer adminTokenQuery
unresolvedbooleandefault: falsetrue leaves out delivered and payment-failed rows, listing purchases still awaiting a payment or delivery outcome.statestring400 INPUT_INVALID.requestIdstringlimitintegerdefault: 50400 INPUT_INVALID.cursorstringnextCursor. A malformed cursor is 400 INPUT_INVALID. A filtered page can hold fewer rows than limit and still carry a nextCursor; keep paging until it is absent.curl -s "http://localhost:8080/api/transactions?unresolved=true" \
-H "Authorization: Bearer $ADMIN_TOKEN"States
state is derived from the recorded facts each time a row is read, and ageSeconds is computed at read time. Payment status always comes from the payment attempt.
| State | Meaning |
|---|---|
payment-pending | reserved, with no settlement verdict recorded |
payment-failed | the payment attempt is recorded as rejected |
payment-uncertain | settlement-uncertain or legacy failed: funds may have moved |
delivery-started | before the backend deadline, with no completion recorded; the call may still be in progress |
delivery-unknown | settled; the backend ended without a response, or its deadline passed without confirmed delivery |
settled-undelivered | settled, with no backend call recorded or a recorded non-2xx response |
delivered | settled, with a recorded 2xx backend result and pipeline completion |
Once the backend deadline passes, an unfinished delivery-started row reads as delivery-unknown if settled, or payment-pending otherwise, with no write needed. Handle state names you do not recognize: later releases may add more.
Fields
paymentobjectrequiredlocator coordinates for reconciliation. settlingAt records when settlement was called; expiresAt records when the authorization can no longer land.authorizationobjectreservationId and hold (reserved, consumed, released or uncertain).backendobjectdispatchedAt and deadlineAt (dispatch plus the backend timeout and a margin). If the dispatch write failed, these timestamps fall back to the recorded result time. When known, the entry also includes status (0 when the call ended without one) and errorCode.receiptIdstringinputDigeststringsha256: and the hex digest of the canonical JSON input; omitted for input that cannot be canonicalized.configDigeststringrequiredpersistenceFailuresstring[]payment-attempt, receipt or journal, and labels later releases may add.createdAt / updatedAt / completedAtISO 8601completedAt records pipeline completion when the final journal write succeeds.Get one transaction
/api/transactions/{id}Bearer adminTokenReturns transaction, its payment attempt and receipt when available, and up to 50 of the request's events, newest first. An unknown id is 404 RESOURCE_NOT_FOUND.
curl -s "http://localhost:8080/api/transactions/txn_…" \
-H "Authorization: Bearer $ADMIN_TOKEN"agent-commerce reconcile, which reads chain evidence, or record a verdict with POST /api/payment-attempts/:id/resolve.