Skip to content
Integra Protocol

Agentic checkouts

The ATR hash on ACP, UCP, AP2 and ACK checkouts, on card networks, and in A2A task metadata.

For AI agents: this page as Markdown, and llms.txt, the index of every page.

Not every agent pays through a 402 challenge. Many buy through a checkout: the seller opens a checkout or a payment request, the buyer's agent completes it, and a payment service provider, a card network or a credential provider moves the money. This package places H in each of these checkouts in the field its protocol provides, delivers it in A2A task metadata, and says plainly where the buyer signs nothing. This page is for a seller or a buyer on one of these checkouts: it gives where H rides in each, the agreement every checkout sale makes first, and a program for each protocol.

The members are the ones every pairing has. What differs is the document the seller advertises into and what the buyer presents:

ProtocolEntry pointPairingsWhere H ridesBuyer signs HConfirmed
ACP@integraledger/lcp/acpacp/checkout/delegated, acp/checkout/undelegatedThe checkout session's id, and the delegate-payment allowance's checkout_session_id where the handler requires one.nono
UCP@integraledger/lcp/ucpucp/checkout/ap2-mandate, ucp/checkout/agent-signed, ucp/checkout/unsigned, ucp/booking/ap2-mandate, ucp/booking/unsignedA legal_context entry in the checkout's links[], before the business signs the checkout; on ucp/checkout/agent-signed also the legal_context member of the platform's signed request that completes it.with an AP2 mandate, or in the platform's signed requestno
AP2@integraledger/lcp/ap2ap2/checkout-mandate, ap2/checkout-mandate/x402The legalContext member of the merchant-signed checkout_jwt, which the buyer's Checkout Mandate commits to; on the x402 route the payment's nonce carries the payment mandate chain, not H.yesno
ACK@integraledger/lcp/ackack/payment-requestThe id of the seller-signed Payment Request, as H's LCP string.nono
Card networks@integraledger/lcp/cardcard/visa-tap, card/mastercard-agent-pay, card/visa-vic, card/mastercard-vi/immediate, card/mastercard-vi/autonomous, card/seller-referenceThe nonce or the checkout path the agent's message signature covers, the transaction reference of a Visa Intelligent Commerce credential request, the checkout_jwt a Verifiable Intent mandate signs, or the seller's processor reference.Visa TAP, Agent Pay and Verifiable Intentno
A2A@integraledger/lcp/a2anoneThe Task's metadata, under the extension's URI. Delivery only.nonone

The "Buyer signs H" column says where each pairing's data.carrier.signed names a field. The pairings reference gives the sentence each pairing's record states about what a payment through it proves. No checkout pairing is confirmed yet (data.confirmed is no on every one): nothing outside this package has yet shown any of these forms as its profile defines it.

The AP2, UCP, ACK and card pairings read each compact JWS and SD-JWT segment, each disclosure and each Verifiable Intent key coordinate as base64url without padding (RFC 7515 §2) in its canonical form only (RFC 4648 §3.5). One whose last character has a bit set past its last byte is malformed, and the pairing refuses it with the code it gives any other malformed one. Two compact JWSs are not decoded: a Key Binding JWT, which no pairing reads, and UCP's ap2.merchant_authorization, which the AP2 Mandate pairings match against UCP's schema pattern only.

The agreement comes first

Every pairing on this page has data.coverage none: no public ledger shows a payer-signed act carrying H. So every checkout sale is agreement-first. The seller passes an agreement URL to advertise as its last argument; advertise writes it where the protocol keeps the link, and read returns it as agreement. The buyer gate declines a checkout offer without one (agreement-not-offered). Unpaid, the agreement URL answers 402 with an x402 challenge that advertises the same H and link (the seller guide gives the exchange). The buyer pays it first, as an agreement, with a payment that is itself a public proof of H, and completes the checkout only after the agreement's 200 receipt names the same H. Each pairing's sample below passes an agreement URL.

import { , , ,  } from "@integraledger/lcp";
import { , type  } from "@integraledger/lcp/acp";
import { , type , type  } from "@integraledger/lcp/x402";
import type {  } from "viem";
import { ,  } from "viem/accounts";

const  = await (new ().("the ATR's bytes"));
const  = `https://atr.seller.example/${.()}`;
const  = `https://pay.seller.example/agreement/${.()}`;

// Seller: the checkout names the agreement URL beside the link.
const :  = { : true };
const  = .({ : "usd" }, , , , );
if (()) throw new ((.));

// Seller: unpaid, the agreement URL answers 402 with an x402 challenge advertising the same H and link.
const :  = {
  : "exact",
  : "eip155:84532",
  : "1",
  : "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
  : "0x209693Bc6afc0C5328bA36FaF03C514EF312287C",
  : 60,
  : { : "USDC", : "2" },
};
const :  = { : 2, : { :  }, : [] };
const  = .(, , , );
if (()) throw new (.);

// Buyer: the checkout names an agreement URL, whose challenge advertises the same H.
const  = .();
if (()) throw new (.);
const  = .();
if (()) throw new (.);
.("agreement URL:", . === , "same H:", (., .));

// Buyer: the agreement, built as one: its nonce is the agreement's own value, so the agreement and a charge never
// share one.
const  = (());
const  = await .(
  { : , : , : ., : .(.() / 1000) },
  .,
  "agreement",
);
if (()) throw new (.);
.("nonce is agreementValue(H):", ... === (await (.)));
const  = .(await .(. as ));
if (()) throw new (.);

// Seller of the agreement URL: the payment is this H's agreement.
const  = await .(, { : "agreement",  });
.("agreement bound to H:", typeof  === "string" && (, ));
agreement URL: true same H: true
nonce is agreementValue(H): true
agreement bound to H: true

ACP

In the Agentic Commerce Protocol, the seller creates a checkout session and the buyer's agent completes it with a payment handler. These pairings target ACP 2026-04-17. This package makes H the session's id, and puts the link and the agreement URL beside it in the session's metadata.legal_context, in snake case:

{
  "id": "0x1be27e75ea3728b55834ec54ff6709669427b11c9ba47a6d9f182b0be46513be",
  "metadata": {
    "legal_context": {
      "type": "sha256",
      "value": "0x1be27e75ea3728b55834ec54ff6709669427b11c9ba47a6d9f182b0be46513be",
      "legal_context_url": "https://atr.seller.example/2ff8f7af-0bd8-41fa-862e-cb0945fc149e",
      "legal_context_agreement_url": "https://pay.seller.example/agreement/5f0c2a5e-8d0e-4c1b-9d43-2a3c1f6b7e10"
    }
  }
}

The ATR's binding slot, tie(options), holds one option per kind of payment handler the session offers, each ACP's own { "requires_delegate_payment": boolean }, and nothing from the checkout. The two pairings differ in that flag:

  • acp/checkout/delegated: the handler requires delegate_payment. build returns the allowance the agent's delegate_payment request carries: ACP's six members, with reason "one_time" and checkout_session_id set to H. The agent signs its request; complete(request) returns the request only when its allowance is exactly the one built, and refuses acp/allowance-changed otherwise. An allowance with no RFC 8785 form, such as one whose merchant_id holds an unpaired surrogate, is acp/choice-malformed at build, so the agent is never asked to sign a request complete would refuse. bound reads checkout_session_id back. It verifies no signature.
  • acp/checkout/undelegated: nothing the buyer signs names the session. build refuses acp/nothing-to-sign and bound refuses acp/not-buyer-signed.

On acp/checkout/undelegated, ucp/checkout/unsigned and card/seller-reference, the payment is known from the seller's report alone. reference({ charge }, option) keys it by the processor's identifier of the charge, such as a Stripe PaymentIntent id or an Adyen pspReference, 1 to 255 visible ASCII characters (else <surface>/charge-reference-malformed), together with the checkout of the option it answers where the option names one (UCP and card).

import { , , , ,  } from "@integraledger/lcp";
import { , , type , type  } from "@integraledger/lcp/acp";

// Seller: the session offers a handler that requires delegate_payment.
const :  = { : true };
const  = new ().('{"line_items":[{"id":"li_1","quantity":1}],"total":19900}');
const  = await ((), ([]), [["order", ]]);
if (()) throw new (.);
const  = `https://atr.seller.example/${.()}`;
const  = `https://pay.seller.example/agreement/${.()}`;
const :  = { : "usd", : { : "A-100" } };
const  = .(, ., , , );
if (()) throw new ((.));
.("session id is H:", . === ., .(. ?? {}));

// Buyer: read H, the link and the agreement URL, fetch and compare, pay the agreement, then build the allowance.
const  = .();
if (()) throw new (.);
.("agreement URL:", . === );
if (!(await (.), .)) throw new ("decline: hash-mismatch");
const  = await .(
  { , : 19900, : "usd", : "acme", : "2026-10-01T00:00:00Z" },
  .,
);
if (()) throw new (.);
const { , ... } = .;
.("checkout_session_id is H:",  === ., );

// Buyer: the agent's own stack builds and signs its delegate_payment request around the allowance.
// complete returns the request only when the allowance in it is the one built.
const  = .({ : ., : { : "card" } });
if (()) throw new ((.));
const  = .({ : { ...., : 99900 } });
.(() ? . : "accepted");

// Buyer: confirm the request the agent signed carries H (the buyer gate's signed-not-bound check).
// In ACP the seller never receives this request: `claims` is false, and the seller ties the payment to H in its report.
const  = await .();
.("bound to H:", typeof  === "string" && (, .));
session id is H: true [ 'order_ref', 'legal_context' ]
agreement URL: true
checkout_session_id is H: true {
  reason: 'one_time',
  max_amount: 19900,
  currency: 'usd',
  merchant_id: 'acme',
  expires_at: '2026-10-01T00:00:00Z'
}
acp/allowance-changed
bound to H: true

advertise keeps every other member and metadata key, sets the session id only when it is absent or already H (acp/id-conflict otherwise), refuses a session that carries a refused member (acp/session-malformed), and refuses a session, given or as it would return it, larger than 1 MiB as JSON or nested more than 64 levels deep (acp/too-large). read takes H from id alone and refuses a metadata.legal_context whose value is another hash (acp/legal-context-conflict). Because H is the session's id, one session binds one ATR: a change to the terms the ATR records needs a new session, which the agent creates. The LCP profile acp/checkout/session-id states the rules.

UCP

In the Universal Commerce Protocol, the business returns a checkout, and, under UCP's AP2 Mandates extension, signs it (ap2.merchant_authorization). This package appends one entry to the checkout's links[] before the business signs it:

{ "type": "legal_context", "url": "https://atr.seller.example/…", "title": "lcp:sha256:0x…" }

and, with an agreement URL, a second entry of type legal_context_agreement. The option names the checkout or the booking by its own id ({ "checkout": "…" } or { "booking": "…" }), and tie(options) records those ids. The booking pairings follow UCP's draft lodging booking capability, dev.ucp.lodging.booking, at commit c9a1395b. advertise refuses a checkout the business has already signed (ucp/already-signed), one whose id is not the option's (ucp/option-not-this-checkout) and one that carries a refused member (ucp/checkout-malformed).

PairingBuyer sidebound
ucp/checkout/ap2-mandate, ucp/booking/ap2-mandateread requires the business's ap2.merchant_authorization (ucp/ap2-not-active otherwise). build returns the checkout unchanged for the buyer's mandate issuer, once its link carries H, and complete(checkout_mandate) gives what the buyer presents: the mandate and the checkout JWT its closed mandate discloses, so bound on it checks only that the two agree.Reads the buyer's mandate, one SD-JWT or AP2's chain of the open and closed mandates joined by ~~, checks AP2's checkout_hash against the presented checkout_jwt, and that any checkout the closed mandate discloses is that JWT, then reads H from that checkout's legal_context link. It verifies no signature, no cnf delegation and no link between the chained mandates. UCP's AP2 Mandates extension has the business verify the checkout mandate's signatures, key binding and expiry itself; bound does not, so run that verification before relying on its result. For AP2's latest-checkout check, build checkout_jwt from your own ap2.merchant_authorization for the checkout's current state, with its payload attached, not from the mandate: bound then refuses ap2/checkout-not-latest when the mandate commits to another state of the checkout.
ucp/checkout/agent-signedread gives H and the link. build(offer, h) returns { legal_context: { type: "sha256", value: H } } once the checkout's link carries H (else ucp/hash-not-in-checkout), which the platform writes into the body of the request that completes the checkout; the platform's RFC 9421 signature covers that body through content-digest.Takes { body, contentDigest } as the business received them. Requires contentDigest to be exactly sha-256=:, the standard base64 of SHA-256 over the body, and : (ucp/content-digest-mismatch), then reads H from the body's one legal_context member. It verifies no signature and reads no key, so verify the platform's signature first. The LCP profile ucp/checkout/agent-signed states the rules.
ucp/checkout/unsigned, ucp/booking/unsignedread gives H and the link. build refuses ucp/nothing-to-sign: UCP without the AP2 Mandates extension defines no buyer signature.Refuses ucp/not-buyer-signed. On ucp/checkout/unsigned, reference({ charge }, option) keys the payment by the processor's charge id, as on ACP.

legalContextLink(checkout) reads the one legal_context entry of any checkout: two such entries are ucp/legal-context-conflict. The LCP profile ucp/checkout/legal-context states the rules.

import { ,  } from "@integraledger/lcp";
import { , , type  } from "@integraledger/lcp/ucp";

const  = await (new ().("the ATR's bytes"));
const  = "https://atr.seller.example/2ff8f7af-0bd8-41fa-862e-cb0945fc149e";
const  = "https://pay.seller.example/agreement/5f0c2a5e-8d0e-4c1b-9d43-2a3c1f6b7e10";
const :  = {
  : "chk_123",
  : "ready_for_complete",
  : [{ : "terms_of_service", : "https://seller.example/tos" }],
};

const  = .(, , , { : "chk_123" }, );
if (()) throw new ((.));
.(.);

const  = ();
.(() ? . : . === );
const  = .();
.(() ? . : . === );
const  = .(, , , { : "chk_999" }, );
.(() ? . : "placed");
.((await .({ :  }, )));
[
  { type: 'terms_of_service', url: 'https://seller.example/tos' },
  {
    type: 'legal_context',
    url: 'https://atr.seller.example/2ff8f7af-0bd8-41fa-862e-cb0945fc149e',
    title: 'lcp:sha256:0x3283f4fc90a2f6d2782b0345c3b274acbe0218ec84ce2d8c3a1fdbe6d1cff263'
  },
  {
    type: 'legal_context_agreement',
    url: 'https://pay.seller.example/agreement/5f0c2a5e-8d0e-4c1b-9d43-2a3c1f6b7e10'
  }
]
true
true
ucp/option-not-this-checkout
true

A UCP checkout paid in x402 goes through the payment handler com.integraledger.lcp.x402. Its config in the checkout is the x402 PaymentRequired that carries H. Its credential is the buyer's signed x402 payment. Without AP2 mandates, the payment carries H where the option's x402 pairing places it, and the checkout's ATR takes that pairing's binding slot, whose request is the checkout's completion, so the ATR names the checkout. Under UCP's AP2 Mandates extension the checkout mandate binds H, and the handler's Under AP2 mandates rules apply in place of these; AP2 covers the checkout mandate. The LCP profile ucp/payment-handler/x402 is the handler's specification, and ucp-payment-handler-x402.schema.json its schema. Their addresses are https://lcp.integraledger.com/ucp/x402/2026-10-02 and https://lcp.integraledger.com/ucp/x402/2026-10-02/schema.json.

AP2

In AP2, the merchant signs a checkout_jwt and the buyer's closed Checkout Mandate commits to it through checkout_hash, the SHA-256 of that JWT. AP2 lets the mandate's _sd_alg choose that hash; this package reads a mandate whose _sd_alg is sha-256 or absent, and refuses one with any other value (ap2/sd-alg-unsupported). The pairing targets AP2 v0.2 (Checkout Mandates, mandate.checkout.1). This package puts H in the JWT's payload:

  • Seller. advertise(payload, h, link, { checkout: id }, agreementUrl) appends a legalContext member, {"type":"sha256","value":H,"legalContextUrl":link,"legalContextAgreementUrl":agreementUrl}, to the checkout payload whose id is the option's, and refuses a payload that carries a refused member (ap2/jws-malformed). The seller's own stack signs the result as its checkout_jwt.
  • Buyer. read(checkoutJwt) decodes the JWT's payload and returns H, the link and the checkout. build(offer, h) returns the Checkout Mandate's required claims: vct "mandate.checkout.1", the checkout_jwt, and checkout_hash, the unpadded base64url of SHA-256 over the JWT. The buyer's mandate signer issues the mandate as an SD-JWT, and complete(checkout_mandate) gives what the buyer presents: the mandate and the JWT.
  • Seller, on payment. bound(presented) takes the mandate as presented: one SD-JWT or, when the agent pays under the user's open mandate, AP2's chain of the open mandate's SD-JWT and the closed mandate's, joined by ~~. A chain has at most these two hops, and each must read as an SD-JWT. bound finds the one closed Checkout Mandate in the last SD-JWT, checks that its checkout_hash is the hash of the presented checkout_jwt (ap2/checkout-not-latest otherwise), and reads H from that JWT's payload. It verifies no signature, no cnf delegation and no sd_hash or issuer_jwt_hash link between the hops, and does not evaluate the open mandate's constraints. AP2 has the merchant verify the Checkout Mandate, and bound does not, so before relying on its result your AP2 stack verifies the chain: the first SD-JWT with the issuer's key, the closed mandate with the key the open mandate delegates to in cnf, its sd_hash or issuer_jwt_hash, and the open mandate's constraints.

AP2 has the merchant check that checkout_hash matches the latest checkout_jwt. For that check, build presented from the mandate and the checkout_jwt you last sent for that checkout, not the buyer's copy: bound then refuses ap2/checkout-not-latest when they differ. With the buyer's copy, it checks only that the mandate and that JWT agree.

jwsPayload, readMandate and checkoutBinding expose those steps one by one. The LCP profile ap2/checkout-mandate states the rules.

On the x402 route (ap2/checkout-mandate/x402), AP2's x402 credential provider writes the EIP-3009 authorization's nonce as keccak-256 of the payment mandate chain, so the payment itself carries no H. H rides in the checkout_jwt that the closed mandate commits to, as above. bound takes { checkout_mandate, checkout_jwt, payment }, payment being AP2's x402 bundle as the merchant receives it, and reads H from the mandate and the JWT. It refuses ap2/payment-not-bound where the authorization's nonce is not keccak-256 of the bundle's payment_mandate_chain, or where the chain's closed Payment Mandate does not name this checkout. reference(presented, method), against the checkout's x402 method { type: "x402", address, network, asset }, and status read the carried EIP-3009 payment as x402/exact/eip155/eip3009 does, at coverage none, with the authorization's own nonce where that pairing has H. AP2 writes the method's network as an x402 v1 network name (base-sepolia); x402MethodNetwork(network) gives its CAIP-2 id (eip155:84532) by @x402/evm's v1 table, as reference reads it, or an eip155 CAIP-2 id as given. The LCP profile ap2/checkout-mandate/x402 states the rules.

import { ,  } from "@integraledger/lcp";
import {  } from "@integraledger/lcp/ap2";

const  = await (new ().("the ATR's bytes"));
const  = { : "chk_42", : { : "USD", : "19.90" } };
const  = `https://atr.seller.example/${.()}`;
const  = `https://pay.seller.example/agreement/${.()}`;
const  = .(, , , { : "chk_42" }, );
if (()) throw new ((.));
.(.());

// The seller's stack signs the payload. A placeholder signature stands in: the buyer's side verifies none.
const  = (: object) => .(.()).("base64url");
const  = .("signature").("base64url");
const  = `${({ : "ES256", : "JWT" })}.${()}.${}`;

const  = .();
if (()) throw new (.);
.("agreement URL:", . === );
const  = await .(., .);
if (()) throw new (.);
.(.., ...);
[ 'id', 'total', 'legalContext' ]
agreement URL: true
mandate.checkout.1 43

ACK

In the payment flow of the Agent Commerce Kit (ACK), the seller answers with a 402 whose body carries a signed Payment Request token, and a receipt issued after settlement embeds that token. The pairing targets ACK protocol version 2025-05-04. This package makes H the Payment Request's id, in LCP string form, and puts the link beside the request in the 402 body:

  • Seller. advertise({}, h, link, option, agreementUrl) returns the values the seller's stack places: paymentRequestId, lcp:sha256:0x…, for the token it signs, and legalContext, {type, value, legalContextUrl, legalContextAgreementUrl}, for the body beside it. tie(options) records the Payment Request's options exactly as issued.
  • Buyer. read(body) takes H from the signed token's id, which must equal the body's legalContext (ack/legal-context-conflict otherwise), and returns the token's payment options. The body's unsigned paymentRequest copy is never read. The token's signature is not verified here.
  • After settlement. fromReceipt(credentialSubject) reads H from the Payment Request token a receipt embeds. It verifies nothing: call it on a receipt you have verified.

ACK defines no payer signature, so there is no place for H in what the buyer signs. build and bound refuse ack/no-signed-place. The LCP profile ack/payment-request states the rules.

Card networks

The card entry point covers five ways to pay a card checkout. The option is the seller's own { scheme, checkout }, where scheme is "visa-tap", "mastercard-agent-pay", "visa-vic", "mastercard-vi" or "seller-reference" and checkout is the seller's checkout id. advertise gives the same values for every card pairing: the legalContext the seller shows before payment, with the agreement URL after the link, and reference, H's LCP string, for the seller to place in its processor reference.

  • Visa Trusted Agent Protocol. H rides in what the agent's agent-payer-auth message signature covers (RFC 9421): its nonce, the base64 of H's 32 bytes followed by 32 random bytes, which build returns as { nonce } for the agent's signer to place in every signature of the request; or, for an agent whose nonce does not carry H, the merchant's checkout path, whose last segment is H and which the signature covers as @path. bound takes the request's signatureInput, signature and, for the path, its path, and returns H when every agent-payer-auth signature carries the same H. It reads the key id parameter as keyid and as keyId, the spelling Visa's reference agent writes. It verifies no signature, key, window or nonce. The LCP profile card/visa-tap states the rules.
  • Mastercard Agent Pay. TAP's carrier, in a message signature whose tag is Agent-pay-auth or agent-pay-auth, the two spellings Mastercard publishes. The form is built from Mastercard's published playbook and is not confirmed: the LCP profile card/mastercard-agent-pay states it.
  • Visa Intelligent Commerce. H, as unpadded base64url, is the transactionReferenceId the agent writes when it asks Visa for the sale's credential; build returns it, and bound reads it back as the merchant reads it from the credential payload Visa signs. That Visa returns it unchanged is not yet shown, so the form is not confirmed: the LCP profile card/visa-vic states it.
  • Mastercard Verifiable Intent. The pairings target Verifiable Intent at commit 356c296. H rides in the checkout_jwt as its legalContext, and a mandate signs that JWT's SHA-256 as checkout_hash. build returns checkoutMandate, the checkout mandate to sign, and transactionId, the value for the payment mandate's transaction_id: both carry that digest. In Immediate mode the agent may create the checkout_jwt: read then takes the legalContext the seller shows, and build, given { checkout, shown }, returns the checkout payload with that legalContext written into it, for the agent to sign. card/mastercard-vi/immediate reads H from the checkout mandate the user's L2 mandate references, and checks the checkout_hash and any disclosed transaction_id; it verifies no signature. card/mastercard-vi/autonomous reads H from the agent's L3b checkout mandate, and verifies the ES256 signatures of L2 and L3b and their sd_hash links, but not the L1 issuer's signature; its l2 is the merchant's view of the user's L2 that L3b's sd_hash covers. The LCP profile card/mastercard-vi states the rules.
  • card/seller-reference. A plain card checkout: nothing the buyer signs carries H. The seller shows H and the link before payment and places reference in its processor reference. build and bound refuse card/no-signed-place, and reference({ charge }, option) keys the payment by the processor's charge id, as on ACP.
import { ,  } from "@integraledger/lcp";
import { , type CardOption } from "@integraledger/lcp/card";

const  = await (new ().("the ATR's bytes"));
const : CardOption = { : "visa-tap", : "order-7731" };

const  = `https://atr.seller.example/${.()}`;
const  = `https://pay.seller.example/agreement/${.()}`;
const  = .({}, , , , );
if (()) throw new (.);
.(. === `lcp:sha256:${}`);
const  = .();
.(() ? . : . === );

const  = await .(, );
if (()) throw new (.);
const  = .((.), () => .(0));
.(.., `0x${.(.(0, 32)).("hex")}` === );
true
true
88 true

A2A

The Agent2Agent protocol signs nothing per transaction, so it has no place for H in a payment. What it can do is deliver H and the link with the task. This package defines an A2A extension for that, and exports no pairing: binding is the refusal a2a/no-signed-place, and the payment made for the task uses its own pairing, whose record states what it proves. The extension targets A2A 1.0.

When the task carries an x402 payment under the a2a-x402 extension, H and the link ride in the embedded x402 challenge's extensions.legalContext, as in any x402 challenge: the x402 pairing's read reads them there, and read here, which reads only the Task's metadata under this extension's URI, does not.

ExportWhat it does
A2A_EXTENSION_URISThe extension's URI: https://lcp.integraledger.com/a2a/legal-context/v1.
agentExtension({ required? })The Agent Card capabilities.extensions[] entry that declares it. Leave required false: A2A asks agents not to mark data-only extensions as required.
requested(header)Whether a request's A2A-Extensions header value, at most 8,192 characters with at most 64 elements, names the extension.
place(task, h, link, header?)A copy of the Task with {type, value, legalContextUrl} in its metadata, under the extension's URI. Other metadata is kept. A Task that carries a refused member is a2a/legal-context-malformed.
read(task)H and the link from the Task's metadata.
delivery.provesWhat the delivery shows: nothing about the payment.
import { ,  } from "@integraledger/lcp";
import { , , , , type A2aTask } from "@integraledger/lcp/a2a";

.(()[0]?.);

const  = await (new ().("the ATR's bytes"));
const  = "https://lcp.integraledger.com/a2a/legal-context/v1";
.(());

const : A2aTask = { : "task-1", : "ctx-1", : { : "TASK_STATE_INPUT_REQUIRED" } };
const  = `https://atr.seller.example/${.()}`;
const  = (, , , );
if (()) throw new ((.));
const  = ();
.(() ? . : . ===  && . === );
.(());
https://lcp.integraledger.com/a2a/legal-context/v1
true
true
{ refused: true, code: 'a2a/no-legal-context' }

The LCP profile a2a-legal-context-v1 states the extension's rules.

Next

  • Buyer: the gate every checkout on this page runs before the buyer approves.
  • Pairings reference: each checkout pairing's pattern and what its record proves.
Edit on GitHub

Last updated on

On this page