Skip to content
Integra Protocol
API

@integraledger/lcp/ucp

UCP checkouts and bookings, and five pairings, each of which carries the ATR hash and link as one `links[]` entry of type `legal_context` in the checkout response.

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

UCP checkouts and bookings, and five pairings, each of which carries the ATR hash and link as one links[] entry of type legal_context in the checkout response.

The ap2-mandate pairings read the hash from the checkout JWT presented beside the buyer's checkout mandate, after AP2's checkout_hash check, the mandate presented alone or last in AP2's chain after the open mandate; ucp/checkout/agent-signed reads it from the legal_context member of the platform's signed request, once the request's Content-Digest matches its body; the unsigned pairings have nothing signed to read. Nothing here takes a key, signs, or verifies a signature, a cnf delegation or a link between chained mandates.

Interfaces

AgentSignedPresented

The platform's signed request as the business received it: its body, as text, and its Content-Digest value.

Properties

PropertyType
bodystring
contentDigeststring

AgentSignedUnsigned

The member the platform writes into the request that completes the checkout, before it signs the request.

Properties

PropertyType
legal_contextobject
legal_context.type"sha256"
legal_context.value`0x${string}`

UcpBinding

The shape of a UCP pairing: its id, data, binding record and codec, over the checkout or booking option O.

Type Parameters

Type Parameter
Id extends string
O extends Option

Properties

PropertyType
claimsboolean
dataPairingData
idId
patternLcpPattern

Methods

advertise(doc, h, link, offer, agreementUrl?): Refusal | Checkout

Parameters
ParameterType
docCheckout
h`0x${string}`
linkstring
offerO
agreementUrl?string
Returns

Refusal | Checkout

bound()

bound(presented): Promise<Refusal | `0x${string}`>

Parameters
ParameterType
presentedunknown
Returns

Promise<Refusal | `0x${string}`>

broadcaster()

broadcaster(presented): Promise<Refusal | Broadcaster>

Who broadcasts what the payer presents: the seller, which completes the payment ("payee").

Parameters
ParameterType
presentedunknown
Returns

Promise<Refusal | Broadcaster>

build()

build(offer, h): Promise<Refusal | Unsigned>

Parameters
ParameterType
offerUcpOffer
h`0x${string}`
Returns

Promise<Refusal | Unsigned>

read()

read(doc): Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: UcpOffer; }

Parameters
ParameterType
docCheckout
Returns

Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: UcpOffer; }

tie()

tie(options): ["ucp", { options: readonly O[]; }]

Parameters
ParameterType
optionsreadonly O[]
Returns

["ucp", { options: readonly O[]; }]

unplaced()

unplaced(option): Refusal | O

Parameters
ParameterType
optionO
Returns

Refusal | O


UcpOffer

The offer a UCP pairing's read gives, and the buyer's input to its build: the checkout the business returned, carrying the legal_context link.

Properties

PropertyType
checkoutCheckout

Unsigned

The checkout as the business signed it, and the claims the buyer's checkout mandate carries for it: the checkout JWT (checkoutJwt) and its hash. complete takes the signed mandate and returns it beside that JWT.

Properties

PropertyType
checkoutCheckout
contentobject
content.checkout_hashstring
content.checkout_jwtstring
content.vct"mandate.checkout.1"

Methods

complete()

complete(checkout_mandate): Promise<Refusal | Presented>

Parameters
ParameterType
checkout_mandatestring
Returns

Promise<Refusal | Presented>

Type Aliases

BookingOption

BookingOption = object

A booking session's own id, 1–256 characters.

Properties

PropertyType
bookingstring

Checkout

Checkout = object & object

Type Declaration

NameType
ap2?object & object
idstring
links?Link[]

CheckoutOption

CheckoutOption = object

A checkout's own id, 1–256 characters.

Properties

PropertyType
checkoutstring

Link = object

Properties

PropertyType
title?string
typestring
urlstring

Option

Option = CheckoutOption | BookingOption

Variables

agentSigned

const agentSigned: Readonly<{ advertise: (doc, h, link, offer, agreementUrl?) => Refusal | Checkout; bound: (presented) => Promise<Refusal | `0x${string}`>; broadcaster: (presented) => Promise<Refusal | Broadcaster>; build: (offer, h) => Promise<Refusal | AgentSignedUnsigned>; claims: boolean; data: PairingData; id: "ucp/checkout/agent-signed"; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: UcpOffer; }; tie: (options) => ["ucp", { options: readonly CheckoutOption[]; }]; unplaced: (option) => Refusal | CheckoutOption; }>

ucp/checkout/agent-signed. The payee broadcasts (broadcaster answers "payee"): the business's payment handler executes the payment the signed request completes; nothing here reads it. A value that is not an object gets ucp/request-malformed, as bound refuses it.


ap2Mandate

const ap2Mandate: UcpBinding<"ucp/checkout/ap2-mandate", CheckoutOption>

ucp/checkout/ap2-mandate. The payee broadcasts (broadcaster answers "payee"): the business's payment handler executes the payment the buyer's checkout mandate authorizes; nothing here reads it. A value that is not a JSON object gets ap2/mandate-malformed, as bound refuses it.


bookingAp2Mandate

const bookingAp2Mandate: UcpBinding<"ucp/booking/ap2-mandate", BookingOption>

ucp/booking/ap2-mandate. The payee broadcasts (broadcaster answers "payee"): the business's payment handler executes the payment the buyer's checkout mandate authorizes; nothing here reads it. A value that is not a JSON object gets ap2/mandate-malformed, as bound refuses it.


bookingUnsigned

const bookingUnsigned: UcpBinding<"ucp/booking/unsigned", BookingOption>

ucp/booking/unsigned. The payee broadcasts (broadcaster answers "payee"): the business's payment handler executes the payment the booking completed; nothing here reads it.


issuedDigest

const issuedDigest: typeof digestJson = digestJson

The option digest the issuer keeps: SHA-256 over the RFC 8785 form.


const LINK_TYPE: "legal_context" = "legal_context"


unsigned

const unsigned: UcpBinding<"ucp/checkout/unsigned", CheckoutOption> & object

ucp/checkout/unsigned. The payee broadcasts (broadcaster answers "payee"): the business's payment handler executes the payment the checkout completed; nothing here reads it. reference names the charge by the seller's own reference for it.

Type Declaration

NameType
reference()(presented, option) => Promise<Refusal | ChargeRef>

Functions

checkoutJwt()

checkoutJwt(c): string | Refusal

The checkout JWT a buyer's checkout mandate commits to, for a checkout the business signed: its detached ap2.merchant_authorization with the payload reinserted, header.payload.signature, the payload being the base64url of the RFC 8785 form of the checkout without its ap2 member, the bytes that signature covers (UCP 2026-08-25, the AP2 Mandates extension, Business Authorization). UCP does not say which bytes are the checkout JWT; this is the second of the two readings its open issue 905 sets out, and the profile states it as provisional. A checkout with no ap2.merchant_authorization of the form header..signature is ucp/ap2-not-active; one with no RFC 8785 form is ucp/checkout-malformed. No signature is verified.

Parameters

ParameterType
cCheckout

Returns

string | Refusal


legalContextLink(c): Refusal | { h: `0x${string}`; link: string; }

The hash and link of the checkout's one legal_context link. Nothing else of the checkout is read.

Parameters

ParameterType
cCheckout

Returns

Refusal | { h: `0x${string}`; link: string; }


tie()

tie<O>(options): ["ucp", { options: readonly O[]; }]

The binding slot: the checkouts or bookings this ATR was minted for, each by its own id.

Type Parameters

Type Parameter
O extends Option

Parameters

ParameterType
optionsreadonly O[]

Returns

["ucp", { options: readonly O[]; }]

References

Broadcaster

Re-exports Broadcaster


ChargePresented

Re-exports ChargePresented


ChargeRef

Re-exports ChargeRef

Last updated on

On this page