ACP Integration
Record Agentic Commerce Protocol (ACP) session lifecycle and payment observation events as verifiable PEAC receipts. The mapping keeps a strict boundary between access lifecycle and commerce finality, and never synthesizes a payment state that was not explicitly observed.
Package: @peac/mappings-acp
What It Does
ACP sessions move through lifecycle states and may include payment events. The mapping records each as a typed PEAC record, separating access-domain lifecycle from commerce-domain payment evidence.
1. Session lifecycle observed
fromACPSessionLifecycleEvent records access-domain lifecycle (session created, updated, completed) without making any commerce claim.
2. Payment observed
fromACPPaymentObservation records commerce-domain evidence and requires an explicit observed_payment_state. It does not infer settlement from a successful session.
3. Carry the receipt
attachReceiptToACPResponse attaches the signed PEAC receipt to an ACP response; extractReceiptFromACPResponse reads it back on the other side.
Install
pnpm add @peac/mappings-acp @peac/protocol
Access lifecycle vs commerce finality
The mapping deliberately splits the two concerns so that an access event can never be mistaken for a payment outcome:
| Function | Domain | Records |
|---|---|---|
fromACPSessionLifecycleEvent | Access | Session lifecycle state transitions |
fromACPPaymentObservation | Commerce | An explicitly observed payment state (amounts as minor-unit strings) |
fromACPDelegatedPaymentObservation | Commerce | Delegated-payment grant and lifecycle observations |
fromACPCapabilitySnapshot / fromACPInterventionRequired | Access | Capability snapshots and human-intervention signals |
Usage Example
import {
fromACPSessionLifecycleEvent,
fromACPPaymentObservation,
} from '@peac/mappings-acp';
import { issue } from '@peac/protocol';
import { generateKeypair } from '@peac/crypto';
const { privateKey } = await generateKeypair();
// Access-domain: record a session lifecycle event (no commerce claim)
const lifecycle = fromACPSessionLifecycleEvent(sessionEvent, {
iss: 'https://agent.example.com',
});
// Commerce-domain: record an explicitly observed payment state
const payment = fromACPPaymentObservation(paymentEvent, {
iss: 'https://agent.example.com',
observed_payment_state: 'captured',
});
// Sign either set of claims into a portable PEAC receipt
const { jws } = await issue({ ...payment, privateKey, kid: 'peac-2026-03' });Semantic Boundary
PEAC is the evidence layer. It records ACP session and payment observations and never synthesizes commerce finality from access events. A successful session does not imply a captured payment; an ACP payment record proves only the payment state that was explicitly observed. PEAC does not place orders, settle payments, or operate the commerce session.
Links
Portable Commerce Evidence
ACP receipts are portable across all PEAC transports. The same receipt can travel through MCP, A2A, UCP, x402, and HTTP. A verifier needs only the issuer's public key to confirm it offline.