Frida Protocol | protocol | try it as a buyer | merchant view | developers | app | sign in
JSON Schema · Markdown source · developer guide


Version 1.0.1, draft, 2026-11-28 (1.0.1 adds trust tiers against probing, coarse public reason codes, product identifiers, wire hygiene and a conformance kit; see the roadmap)
Extension URI https://protocol.frida.chat/ext/frida-protocol/v1
Media type application/vnd.frida-protocol.v1+json
Transport A2A (Agent2Agent) 1.0, JSON-RPC binding
JSON Schema /ext/frida-protocol/v1/schema.json
Reference implementation the frida-protocol SDK (TypeScript, Apache-2.0), in packages/frida-protocol of the Frida repository
Formerly moma-trade/1 (extension URI https://moma-black.vercel.app/ext/moma-trade/v1). Renamed on 2026-11-30; the messages and rules are unchanged, but agents must use the new extension URI, media type and token types.
The key words MUST, MUST NOT, REQUIRED, SHOULD, SHOULD NOT, RECOMMENDED, MAY and OPTIONAL are to be read as described in RFC 2119 and RFC 8174 when, and only when, they appear in all capitals.
The first agentic commerce protocols solved discovery, checkout and payment authorisation. UCP (Universal Commerce Protocol) and ACP (Agentic Commerce Protocol) let an agent find a product and check out; AP2 (Agent Payments Protocol) lets it prove what its principal allowed it to spend. All three treat the price as a read-only field: an agent finds a $280 jacket and pays $280.
frida-protocol/1 is the missing step between finding and paying. A buyer's agent sends a request to one or more merchant agents. Each merchant agent answers with a signed offer, priced for this buyer, now, from its own inventory. The two agents haggle for a bounded number of rounds, and an accepted offer becomes a signed order that settles over whatever rail the merchant supports: UCP or ACP checkout, an AP2 mandate, a checkout link, or a sandbox.
Design goals:
frida-protocol/1 is an A2A profile extension: it narrows A2A messages to a data part with a known schema and maps the negotiation onto the A2A task lifecycle. It adds no JSON-RPC methods.
| Role | Required | Does |
|---|---|---|
| Buyer agent | Yes | Acts for one person. Sends requests, counters, holds, accepts and withdrawals. Keeps the person's limit private. A2A client. |
| Merchant agent | Yes | Acts for one merchant. Prices from live inventory and goals, makes signed offers and orders. A2A server. |
| Witness | No | A neutral network that observed past transactions and signs facts about either side: buyer passports, merchant passports, funds attestations. |
| Book | No | Holds standing orders (AP2 open mandates) and shows merchants aggregate demand. See section 11. Experimental. |
A single deployment MAY play several roles. Frida plays witness and book for its demo network.
A merchant agent MUST publish an A2A Agent Card. When one agent is served per origin it SHOULD be at /.well-known/agent-card.json; when several agents share an origin, each agent's card MUST be at {agent base URL}/.well-known/agent-card.json. A buyer given a base URL appends that path; a URL ending in .json is the card itself.
The card MUST list a JSONRPC interface with protocolVersion 1.0 in supportedInterfaces, and MUST declare the extension in capabilities.extensions:
{
"uri": "https://protocol.frida.chat/ext/frida-protocol/v1",
"description": "frida-protocol/1: private, bounded price negotiation with signed offers",
"required": true,
"params": {
"merchant_id": "https://harbor.example/agent",
"jwks_uri": "https://harbor.example/agent/.well-known/jwks.json",
"currencies": ["USD"],
"max_rounds": 4,
"settlement": ["ucp_checkout", "continue_url"],
"categories": ["outerwear"],
"ships_to": ["US"],
"witnesses": ["https://protocol.frida.chat"]
}
}
| Param | Type | Required | Meaning |
|---|---|---|---|
merchant_id | string | Yes | The id that appears as merchant.id in every offer and order. RECOMMENDED: the agent's base URL. |
jwks_uri | URL | Yes | JWKS with the public keys that sign offers, orders and the card. |
currencies | string[] | Yes | ISO 4217 codes the merchant prices in. |
max_rounds | integer | Yes | Most counter rounds the merchant takes part in. |
settlement | string[] | Yes | Settlement methods, preferred first (section 10). |
categories | string[] | No | What the merchant sells, for directories. |
ships_to | string[] | No | ISO 3166-1 alpha-2 countries. |
witnesses | URL[] | No | Issuers whose credentials the merchant reads. |
A merchant agent that speaks only frida-protocol/1 SHOULD set required: true. Its card SHOULD carry defaultInputModes: ["application/vnd.frida-protocol.v1+json"].
The card SHOULD be signed as A2A 1.0 section 4.4.7 describes: one entry in signatures whose protected header is {"alg":"ES256","kid":<kid>,"typ":"JOSE","jku":<jwks_uri>} and whose signature covers protected + . + base64url of the RFC 8785 canonical form of the card without signatures.
jwks_uri MUST serve {"keys": [...]} with P-256 keys of the form {"kty":"EC","crv":"P-256","x":…,"y":…,"kid":…,"alg":"ES256","use":"sig"}. kid MUST be the RFC 7638 thumbprint (SHA-256, base64url). To rotate, publish the new key alongside the old one until the old one's offers have expired.
How a buyer agent finds merchant agents is out of scope. A directory MAY publish a JSON list of agent card URLs with categories; Frida publishes one for its demo network at /demo/directory.json. A buyer SHOULD send a request only to merchants likely to sell the item.
Every trade message is one A2A SendMessage call.
A2A-Extensions: https://protocol.frida.chat/ext/frida-protocol/v1 and SHOULD send A2A-Version: 1.0.role: "ROLE_USER", list the extension URI in message.extensions, and carry the trade message as a data part: {"data": {...}, "mediaType": "application/vnd.frida-protocol.v1+json"}. It MAY also carry text parts; they are ignored.request, message.taskId SHOULD be the negotiation_id. If present, it MUST equal it.message.contextId is OPTIONAL. A buyer SHOULD use one context per merchant per shopping session.mediaType if its object has a string type; senders MUST set mediaType.The server MUST echo A2A-Version: 1.0 and A2A-Extensions with the URI on success.
One negotiation is one A2A Task. The task id is the negotiation_id the merchant chose in its opening offer. The merchant's reply is the last part of task.status.message (role ROLE_AGENT), a data part with the trade media type, preceded by a human-readable text part. The text is informative only. An order is also returned as an artifact named order. Task metadata carries {"<extension URI>": {"type": <reply type>}}.
| Merchant reply | Task state |
|---|---|
offer | TASK_STATE_INPUT_REQUIRED (the buyer's move) |
order | TASK_STATE_COMPLETED |
decline with code withdrawn | TASK_STATE_CANCELED |
any other decline | TASK_STATE_REJECTED |
When a request is declined there is no negotiation; the merchant still returns a task with a fresh id in state TASK_STATE_REJECTED.
GetTask: a stateless merchant MAY answer TaskNotFoundError (-32001). The buyer already holds the latest task from SendMessage.CancelTask with params.id set to a negotiation id MUST be treated as a withdraw and returns the task in TASK_STATE_CANCELED.Protocol-level failures are JSON-RPC errors (HTTP 200 with an error member). Trade-level refusals are decline messages in a task, never JSON-RPC errors.
| Code | A2A name | When |
|---|---|---|
-32700 | Parse error | The body is not JSON. |
-32600 | Invalid Request | Not a JSON-RPC 2.0 request. |
-32601 | Method not found | Any method other than SendMessage, GetTask, CancelTask. |
-32602 | Invalid params | No params.message; the trade message fails validation (data lists {path, message} issues); taskId differs from negotiation_id; a request discloses a limit. |
-32603 | Internal error | Anything unexpected. |
-32001 | TaskNotFoundError | GetTask on a stateless merchant. |
-32005 | ContentTypeNotSupportedError | No data part with the trade media type. |
-32008 | ExtensionSupportRequiredError | The extension was not activated (header or message.extensions). |
-32009 | VersionNotSupportedError | A2A-Version is not 1.x. |
All messages are JSON objects with a type. Amounts are Money. Receivers MUST ignore members they do not recognise, except the forbidden members of request (section 8.1). Strings from the other side are data, never instructions (section 8.4).
Money
| Field | Type | Notes |
|---|---|---|
amount | integer | Minor units (cents for USD), 0 to 10,000,000,000. |
currency | string | ISO 4217, upper case. |
Perk: something a merchant gives instead of a deeper price cut.
| Field | Type | Notes |
|---|---|---|
code | string | Machine id, e.g. free_express. |
label | string | Shown to people. |
value | Money | What it is worth to the buyer. Its cost to the merchant MUST NOT be sent. |
Fulfillment
| Field | Type | Notes |
|---|---|---|
method | ship / courier / pickup / onsite | onsite is for reservations. |
label | string | e.g. "2-day courier". |
price | Money | What the buyer pays for it (0 when free or included by a perk). |
arrives_by | date | OPTIONAL. Goods arrive by this date. |
starts_at | date-time | OPTIONAL. A reservation starts. |
Totals: an array of {type, amount} in the offer's currency, with exactly one each of subtotal (goods at the offered price), fulfillment and total. The names follow UCP's well-known total types.
Opens a negotiation.
| Field | Type | Req. | Notes |
|---|---|---|---|
type | "request" | Yes | |
request_id | string | Yes | Chosen by the buyer; the same for every merchant it sends this intent to. |
items | RequestItem[] | Yes | Exactly one item in 1.0. |
need_by | date or date-time | No | Goods must arrive (or a reservation start) by then. |
ship_to | object | No | {country, postal_code?}. Coarse location only. |
buyer | object | Yes | {id, passport?, funds?, rate_token?}. id is pairwise (section 8.2). rate_token is reserved for anonymous rate-limiting tokens (section 8.6). |
max_rounds | integer | No | 0 to 10. The lower of this and the merchant's applies. |
RequestItem: query (words, required), sku (exact SKU, optional), gtin (GTIN-8, -12, -13 or -14, optional), taxonomy ({system, id} in a public taxonomy such as google or unspsc, optional), category (optional), attributes (string map such as {"size": "M"}; hard constraints), quantity (1 to 1000, required).
When a request carries a gtin and the merchant knows the SKU's GTIN, matching MUST be exact: no match is a no_match, whatever the query says. Offer lines MAY carry the gtin of what is offered. Free text is the fallback, not the contract.
{
"type": "request",
"request_id": "req_YFNC_PNVTx9w54kT",
"items": [{ "query": "waterproof commuter shell", "attributes": { "size": "M" }, "quantity": 1 }],
"need_by": "2026-12-03",
"max_rounds": 4,
"buyer": { "id": "byr_dDldE4tB9y1ZkCg0HyvCYw", "passport": "eyJhbGciOiJFUzI1NiIs…" }
}
A signed price for this buyer, now.
| Field | Type | Notes |
|---|---|---|
type | "offer" | |
offer_id | string | New for every offer. |
negotiation_id | string | Chosen in the opening offer; constant after. Also the A2A task id. |
request_id, buyer_id | string | Copied from the request. |
merchant | {id, name} | id equals the card's merchant_id. |
round | integer | 0 for the opening offer, +1 for each offer that answers a counter. |
max_rounds | integer | The round limit that applies. |
final | boolean | Best and final: the buyer may accept, hold or withdraw. |
agreed | boolean | The offer matches the buyer's last counter; accepting closes the deal. |
lines | OfferLine[] | {sku, title, attributes?, quantity, unit_price, list_price}. list_price is the public price. |
perks | Perk[] | Included perks. |
fulfillment | Fulfillment | |
totals | Totals | |
currency | string | |
reasons | string[] | Why the price is what it is (section 5.10). |
hold | {until, quantity} | OPTIONAL. Stock reserved for this buyer until until. |
need_by | date | OPTIONAL. Echoed from the request. |
counterparty | object | What the merchant verified: {passport_verified, return_rate?, funds_verified?}. Echoed so a stateless merchant can resume. |
settlement | string[] | Methods this offer can be accepted with, preferred first. |
passport | string | OPTIONAL. The merchant's witness passport. |
issued_at, expires_at | date-time | The offer is void after expires_at. |
note | string | OPTIONAL. Human-readable. |
signature | string | Detached JWS (section 7). |
{
"type": "offer",
"offer_id": "off_xkQmVFftgg7Y4Lwy",
"negotiation_id": "neg_zfTwK6zDYhwkpff0",
"request_id": "req_YFNC_PNVTx9w54kT",
"buyer_id": "byr_dDldE4tB9y1ZkCg0HyvCYw",
"merchant": { "id": "https://harbor.example/agent", "name": "Harbor & Pine" },
"round": 0, "max_rounds": 4, "final": false, "agreed": false,
"lines": [{
"sku": "HP-SHELL-NVY-M", "title": "Waterproof Commuter Shell",
"attributes": { "size": "M", "color": "navy" }, "quantity": 1,
"unit_price": { "amount": 23800, "currency": "USD" },
"list_price": { "amount": 27500, "currency": "USD" }
}],
"perks": [],
"fulfillment": { "method": "ship", "label": "Standard shipping", "price": { "amount": 0, "currency": "USD" }, "arrives_by": "2026-12-03" },
"totals": [{ "type": "subtotal", "amount": 23800 }, { "type": "fulfillment", "amount": 0 }, { "type": "total", "amount": 23800 }],
"currency": "USD",
"reasons": ["high_cover", "aging", "season_end", "low_return_buyer"],
"hold": { "until": "2026-11-28T17:30:00.000Z", "quantity": 1 },
"need_by": "2026-12-03",
"counterparty": { "passport_verified": true, "return_rate": 0.02, "orders": 14 },
"settlement": ["continue_url"],
"issued_at": "2026-11-28T17:00:00.000Z",
"expires_at": "2026-11-28T17:15:00.000Z",
"note": "opening offer",
"signature": "<base64url header>..<base64url signature>"
}
| Field | Type | Req. | Notes |
|---|---|---|---|
type | "counter" | Yes | |
negotiation_id | string | Yes | |
in_reply_to | Offer | Yes | The merchant's latest offer, unchanged: every member as received, including signature. |
price | Money | Yes | Proposed unit price, in the offer's currency. |
note | string | No | Up to 280 characters. |
Asks the merchant to reserve stock at the offered terms, typically while a human approves. in_reply_to is the offer; minutes is 1 to 120. The merchant answers with the same terms re-issued as a new offer (new offer_id, same round) whose hold.until is now plus minutes and whose expires_at is no earlier than hold.until.
| Field | Type | Req. | Notes |
|---|---|---|---|
type | "accept" | Yes | |
negotiation_id | string | Yes | |
in_reply_to | Offer | Yes | The offer being accepted, unchanged. |
settlement | string | No | One of the offer's settlement methods. Default: the first. |
mandate | string | No | AP2 mandate authorising this purchase (compact JWS or SD-JWT). |
The merchant answers with an order or a decline.
{type: "withdraw", negotiation_id, reason?}. Ends the negotiation and releases any hold. The merchant answers with a decline whose code is withdrawn (task TASK_STATE_CANCELED). A buyer SHOULD withdraw from every negotiation it doesn't accept.
A signed record of the accepted terms and how to pay.
| Field | Type | Notes |
|---|---|---|
type | "order" | |
order_id | string | |
negotiation_id, offer_id, buyer_id | string | offer_id is the accepted offer. |
merchant | {id, name} | |
lines, perks, fulfillment, totals, currency | Exactly the accepted offer's terms. | |
status | confirmed / requires_payment | requires_payment when the buyer must still complete a checkout or follow continue_url. |
settlement | object | {method, continue_url?, checkout?: {protocol: "ucp" or "acp", endpoint, session_id}, reference?} |
issued_at | date-time | |
signature | string | Detached JWS. |
{type: "decline", negotiation_id?, request_id?, code, message}.
| Code | Meaning |
|---|---|
no_match | Nothing in the catalog matches the request. |
out_of_stock | It matches, but not in that quantity, size or variant, or it sold out. |
offer_expired | The echoed offer is past expires_at. Send a new request. |
invalid_offer | The echoed offer isn't this merchant's, isn't for this negotiation, or was changed. |
final_offer | Reserved. A counter to a final offer is answered with the same offer (section 6.3). |
unsupported | Wrong currency, or a settlement method the offer doesn't list. |
funds_required | The merchant needs a mandate or funds attestation to hold or accept. |
passport_required | Holds (or deeper terms) are only for buyers with a verified witness passport (section 8.5). |
mandate_invalid | The mandate doesn't verify or doesn't cover the order. |
withdrawn | Acknowledges a withdraw. |
Offers explain their price with codes, in two tiers. Codes are closed strings matching ^[a-z0-9][a-z0-9_.:-]{0,63}$; merchants MAY add their own, prefixed with a domain they control (example.com:clearance). Reasons MUST be truthful; a buyer agent MAY treat a merchant whose reasons don't match witnessed behaviour as less trustworthy.
Public codes are safe to send to anyone, including a competitor probing the endpoint:
| Code | Meaning |
|---|---|
promotional | Priced below list for reasons the merchant keeps private. |
limited_stock | Little stock left: no discount. |
time_sensitive | The offer's value falls with time (fresh goods, a reservation). |
fulfillment_adjusted | Delivery price or speed adjusted to the merchant's capacity. |
buyer_reward | Priced for this buyer's witnessed record. |
perk_offered | Something added instead of a deeper cut. |
Detailed codes reveal inventory distress and cash pressure. A public endpoint that sends them to anyone lets a rival or data broker reconstruct the merchant's position by asking every day. A merchant SHOULD send detailed codes only to counterparties its disclosure policy trusts (by default: a verified buyer passport with a witnessed record, section 8.5) and SHOULD send each one's public code to everyone else.
| Detailed code | Meaning | Public code |
|---|---|---|
aging | Stock has been on hand long enough to cost money. | promotional |
high_cover | Many days of stock at the current sales rate. | promotional |
season_end | A clear-by date is near. | promotional |
space | Clearing warehouse space for incoming stock. | promotional |
cash_conversion | Trading margin for immediate settlement. | promotional |
perishable | Value falls to zero at a deadline (fresh goods, tonight's table). | time_sensitive |
low_cover | Few days of stock left: no discount. | limited_stock |
packing_backlog | Moving demand to slower shipping while packing is backed up. | fulfillment_adjusted |
low_return_buyer | The buyer's witnessed return rate is low, so expected return cost is lower. | buyer_reward |
perk_instead_of_cut | Near the floor: adding something cheap to give instead of a deeper cut. | perk_offered |
The opening offer is round 0. Each offer that answers a counter has round one higher than the offer it answers. The round limit is the lower of the merchant's max_rounds and the request's max_rounds (when given). A merchant MUST mark an offer final when its round reaches the limit, and MAY mark any offer final earlier, for example at its floor or when it never discounts (low_cover).
Within one negotiation a merchant MUST NOT offer a higher unit price than its previous offer, and MUST NOT remove a perk it already included. A buyer SHOULD NOT counter lower than its previous counter. A counter at or above the offer's unit price is answered with an offer at no more than the previous price.
agreed: true when its price equals the counter. The buyer then accepts.Every offer has expires_at. A merchant MUST decline with offer_expired any counter, hold or accept whose in_reply_to has expired. Fifteen minutes is RECOMMENDED for goods; perishable capacity may use less.
An offer MAY carry hold: the merchant has set aside quantity units for this buyer until until. A merchant SHOULD honour a hold for its full duration and MUST release it on withdraw or when it lapses. An offer that answers a counter keeps a hold that hasn't lapsed.
Holds are tiered, because a free hold lets a competitor or a bot lock up stock for nothing:
hold request is declined with passport_required.funds_required); bonded holds, where abandoning holds costs the buyer witnessed reputation or a micro-escrow, are on the roadmap.When a buyer pushes toward a merchant's floor, the merchant can offer something that costs it less than it is worth to the buyer: a $16 courier upgrade that costs $6, a $40 scarf that costs $8. Priced so the buyer's effective price beats their bid while the merchant still nets more than the bid, a perk moves both sides closer than a cash cut would. Section 12 gives the reference formula.
Merchants MUST sign every offer and order. Buyer messages are not signed in 1.0; buyer facts come from witness credentials.
signature member.null.{"alg":"ES256","kid":"<RFC 7638 thumbprint>","typ":"frida-protocol+jws"}, base64url-encoded (B64H).B64H + "." + base64url(canonical JSON).r || s (IEEE P1363), base64url-encoded (B64S).signature to B64H + ".." + B64S (RFC 7515 Appendix F, detached content).This is the same construction UCP uses for ap2.merchant_authorization.
For every offer and order, a buyer agent MUST:
jwks_uri (both MAY be cached).signature with the key whose kid matches the header (step 7.1 in reverse). If it fails, stop negotiating with that merchant.merchant.id equals the card's merchant_id, and buyer_id equals the id it sent this merchant.For every counter, hold and accept, a merchant agent MUST check that in_reply_to:
merchant.id equal to its own;negotiation_id equal to the message's negotiation_id (and to message.taskId, if sent);Failing 1 to 3 is invalid_offer; failing 4 is offer_expired. Because every term a merchant needs to resume is inside its own signed offer (SKU, quantity, previous price, perks, round, need_by, counterparty), a merchant agent needs no negotiation storage. It recomputes its private reservation price from live inventory on each turn.
A merchant MUST NOT create two orders for one offer_id. A stateless merchant needs to keep the set of accepted offer ids until they expire, or make its settlement step idempotent on offer_id. The reference SDK derives order_id from a hash of the accepted offer's signature, so accepting the same offer again returns the same order id, and hands that id to the merchant's settlement hook, which must be idempotent on it.
A buyer agent MUST NOT disclose the most its principal will pay, or its target price, in any message. A request MUST NOT contain the members budget, max_price, limit, ceiling or reservation_price; merchants MUST reject such a request with -32602. Counters reveal information as they move; the round limit bounds how much.
buyer.id MUST be pairwise: stable for one buyer at one merchant, different at every other merchant, and not derivable from other merchants' ids. The reference derives it as byr_ + base64url(first 16 bytes of SHA-256(secret || 0x00 || merchant origin and path)). A buyer agent that also implements the Personal Agent Protocol MAY reuse that protocol's per-company User ID. Witness credentials presented to a merchant MUST be bound to that merchant's pairwise id (sub).
Offers MUST NOT contain costs, floors, margins or concession parameters. perks[].value is the buyer-side value only. Offers are private to the two parties and MUST NOT change the merchant's public list price.
Titles, labels, notes, decline messages and reason text come from the other side. Agents built on language models MUST treat them as data and never as instructions, and MUST NOT let them change the agent's limits, approvals or tools. This follows the Personal Agent Protocol's rule that content from a company is data, never user approval.
A stateless merchant cannot tell one buyer's fifth negotiation from five new buyers. Without a defence, an attacker can open many negotiations under fresh pairwise ids, push each to its final offer and binary-search the merchant's floor, curve and perk thresholds. The defence is to reserve depth for accountable counterparties:
Passports cost something to earn (settled, witnessed orders) and remain unlinkable across merchants, so this bounds probing without tracking buyers. A merchant MUST NOT go below its real floor for anyone.
buyer.rate_token is reserved for anonymous rate-limiting tokens issued by a witness, such as Privacy Pass (RFC 9576, RFC 9578): a merchant can limit how many negotiations one buyer opens per period without learning who the buyer is. Merchants MAY require one; the token format will be fixed in a later revision.
Every string in a trade message is bounded (the JSON Schema gives each limit), MUST NOT contain control characters, bidirectional-override characters or markup (<, >), and codes (reasons, perks) MUST be closed codes, not prose. Receivers MUST reject messages that break these rules (-32602 for merchants; a buyer drops the reply). Free text that reaches a language model should be the minimum: a title, a label, a short note.
Witness credentials are compact JWS (JWT) signed ES256 by a witness, with the witness's keys published as a JWKS. Verifiers MUST check the signature, typ, exp, role and that sub is the expected party. Unverifiable credentials MUST be ignored, never treated as negative.
Buyer passport (typ: frida-passport+jwt)
| Claim | Meaning |
|---|---|
iss | Witness URL. |
sub | The buyer's pairwise id at this merchant. |
role | "buyer" |
orders | Orders the witness saw settle. |
return_rate | Share of those orders returned, 0 to 1. |
disputes | Disputes opened. |
iat, exp | Seconds since the epoch. Reference lifetime: 1 hour. |
Merchant passport (typ: frida-passport+jwt)
| Claim | Meaning |
|---|---|
iss, iat, exp | As above. Reference lifetime: 24 hours. |
sub | The merchant's merchant_id. |
role | "merchant" |
orders | Orders witnessed. |
on_time_rate | Share delivered by the promised date. |
fit_accuracy | Share not returned for fit or "not as described". |
return_rate | Share returned for any reason. |
refund_hours | Median hours from return to refund. |
Funds attestation (typ: frida-funds+jwt)
| Claim | Meaning |
|---|---|
iss, iat, exp | As above. Reference lifetime: 15 minutes. |
sub | The buyer's pairwise id. |
currency | Currency the buyer can settle in. |
can_settle | true: the witness checked an AP2 mandate able to pay. |
mandate_hash | OPTIONAL. Hash of that mandate. |
A funds attestation MUST NOT include the mandate's amount. When a merchant verifies a funds attestation it records counterparty.funds_verified: true in its offers.
An order hands off to a payment rail. settlement.method is one of:
| Method | Hand-off |
|---|---|
ucp_checkout | settlement.checkout names a UCP checkout session already priced at the deal. |
acp_checkout | settlement.checkout names an ACP checkout session already priced at the deal. |
ap2_direct | The merchant charges against the AP2 mandate sent with accept. |
continue_url | An HTTPS URL where a person completes payment at the negotiated price (human present). |
sandbox | No money moves. For demos and tests. |
Vendors MAY define other methods, named with a reverse domain they control.
The merchant creates the session (POST /checkout-sessions) with the order's line items at list price and expresses the negotiated difference with the discount extension (dev.ucp.shopping.discount): one entry per line in discounts.applied with title "Negotiated price", amount equal to (list − unit_price) × quantity, automatic: true, method: "each" and an allocation to that line. The session's total MUST equal the order's total. Perks appear as zero-priced line items or as a zero fulfillment total. If the platform and business negotiated dev.ucp.common.payment.ap2_mandate, the buyer completes the session with its AP2 checkout mandate as UCP specifies.
A UCP business that also speaks frida-protocol/1 MAY advertise it in its UCP profile:
{
"ucp": {
"version": "2026-08-25",
"capabilities": {
"com.frida.protocol.negotiation": [{
"version": "2026-11-28",
"spec": "https://protocol.frida.chat/protocol",
"schema": "https://protocol.frida.chat/ext/frida-protocol/v1/schema.json",
"extends": "dev.ucp.shopping.checkout",
"config": { "agent_card": "https://harbor.example/agent/.well-known/agent-card.json" }
}]
}
}
}
UCP binds a capability namespace to the host serving its schema. This name becomes final when the specification moves to a domain its publisher controls.
The merchant creates a checkout session (POST /checkout_sessions) whose line item totals carry the negotiated unit price, with the difference from list as an items_discount total. The buyer completes it with a shared payment token whose Delegated Payment allowance.max_amount covers the order total, in the order's currency (lower case, as ACP writes it), bound to that checkout_session_id.
When accept carries a mandate, the merchant SHOULD verify that the checkout mandate allows this merchant and this SKU and that the payment mandate's amount range covers the order total before charging, and decline with mandate_invalid otherwise. A buyer agent MUST NOT accept an offer above what its mandate allows; above its auto-approve limit it SHOULD hold and ask its human first.
The Personal Agent Protocol handles who the buyer is: discovery of a company, sessions with pairwise user ids, sign-in and account access. frida-protocol/1 handles price. A company MAY list its merchant agent in poppy.json under a domain-named extension, for example "extensions": {"protocol.frida.chat/frida-protocol": [{"version": "1", "endpoint": "https://harbor.example/agent/.well-known/agent-card.json"}]}, and a signed-in session MAY be used to settle an order on the user's account.
A buyer can leave a standing order: buy this item if a merchant clears it at or under a limit before a date. A standing order is an AP2 open mandate pair, signed by the buyer's agent:
vct: mandate.checkout.open.1) with checkout.allowed_merchants and checkout.line_items constraints;vct: mandate.payment.open.1) with payment.amount_range (the limit), payment.execution_date (not_after) and payment.agent_recurrence (ON_DEMAND, at most one occurrence).A book holds standing orders and shows each merchant only aggregate demand for its own SKUs: counts in $5 bands (the limit rounded down to a multiple of 500 minor units), never identities or exact limits. A merchant sweeps the book by choosing one clearing price at or above its floor. Every standing order whose limit is at or above that price fills at that price, oldest first, up to the stock available. Buyers pay the clearing price, not their limit, and the public list price does not change.
The wire format between book, buyers and merchants is not standardised in 1.0. Frida's demo exposes it over HTTP and MCP.
The reference SDK prices from five live signals. Any policy that respects sections 6 and 8 conforms.
All amounts are minor units. nicePrice(x) rounds to the nearest whole dollar from $20 and to the nearest $0.10 below.
cover = on_hand / max(0.05, velocity_per_day). If cover < 7 and on_hand <= 3 (and the item isn't perishable), the price is firm: open at list (or list times 1 + scarcityPremium × (1 − cover/7)), β = 0, the opening offer is final, reason low_cover. If cover > 45, add a discount of min(0.06, 0.0015 × (cover − 45)), reason high_cover.aging). For goods with a deadline expires_at, within window hours of it (3 by default) add maxDiscount × (1 − hours/window) and lower the floor to the item's variable cost (reason perishable). A clear-by date within 30 days makes the merchant concede faster (reason season_end).floor = max(ceil(cost / (1 − marginFloor)), round(list × (1 − maxDiscount))). open = max(floor, nicePrice(list × (1 − discount))), with discount capped at maxDiscount. soft = floor + round(0.45 × (open − floor)): below it, the agent prefers perks to cash cuts.space). "Accelerate cash conversion" adds 0.05 (cash_conversion). A packing backlog makes express shipping dearer.min((categoryReturnRate − return_rate) × returnCost, maxPct × list) per unit.Concession. With β the patience (0.6 by default, 1 or more under pressure, 2 for perishable capacity) and R the round limit, the merchant's target at round r is max(floor, round(open − (r/R)^(1/β) × (open − floor) − adjustment)).
Answering a bid b with previous price p:
min(p, max(b, floor)), final, agreed when equal to b.floor + C <= b < soft and p > b: offer min(p, nicePrice(b + C + 0.7 × (V − C))) with the perk (reason perk_instead_of_cut). The buyer's effective price drops below b; the merchant nets more than b.min(p, max(floor, nicePrice(max(target, b)))), final at the round limit or at the floor.The reference buyer. Effective price is total − round(0.8 × Σ perk values). It opens at 86% of the opening offer (80% when the strategy is cheap, 92% for quality or fast), rounded to $5, never above its target or limit, and concedes toward its limit on the same curve (β 1, 0.7 or 1.6). It takes an offer within its limit that is final, agreed, at or under its current bid, or in the last round. Once one merchant's offer is acceptable, it asks each other merchant once to beat that effective price, then walks away. It ranks acceptable deals by value (cheapest effective price over this one's), trust (from the merchant's passport: 0.5 × on_time + 0.3 × fit + 0.2 × (1 − return_rate)) and timing (arrives by need_by).
offer_id (section 7.3).A minimal merchant agent:
merchant_id, jwks_uri, currencies, max_rounds and settlement, and a JWKS;SendMessage with the data-part binding, the task-state mapping and the error codes of section 4;request with a signed offer or a decline;invalid_offer or offer_expired;final;accept with a signed order, at most once per offer;withdraw with a withdrawn decline and releases holds;A merchant SHOULD also send only public reason codes to untrusted buyers (section 5.10) and give them a shallower curve and no holds (section 8.5).
The SDK ships these checks as a conformance kit you can run against any live merchant agent:
npx --package=https://protocol.frida.chat/sdk/frida-protocol-1.0.1.tgz frida-protocol verify https://merchant.example/agent --query "commuter shell" --size M
It prints PASS, FAIL or SKIP for each MUST and SHOULD (or JSON with --json) and exits non-zero if any MUST fails. Accepting creates an order, so it only runs against sandbox settlement or with --allow-orders.
A minimal buyer agent:
The scenario from Frida's core principles: "Find me a waterproof commuter shell in Medium, delivered by Thursday, around $220." The person's limit is $240; it is never sent. Three merchant agents answer, each priced from its own stock. All amounts are unit prices in US dollars; this is the reference SDK's actual output.
| Merchant | Stock signal | Round 0 | Buyer | Round 1 | Buyer | Round 2 | Outcome |
|---|---|---|---|---|---|---|---|
| Northline Supply | 2 left, 1.5 sold a day | $265, final (low_cover) | withdraw: over the limit | walked away | |||
| Harbor & Pine | 34 left, 62 days old, 75 days of cover | $238 with a 30-minute hold (high_cover, aging, season_end, low_return_buyer) | counter $205 | $218 + free 2-day courier (perk_instead_of_cut) | accepted | ||
| Common Thread | 22 left, 37 days of cover | $249 (low_return_buyer) | counter $215 | $234 | counter $204, "another merchant is effectively at $205.20" | $227 | acceptable, ranked second |
Harbor & Pine's floor is $182 (a 36% margin on a $116.48 cost). At round 1 its target for a low-return buyer is $211.16, the bid of $205 is below its soft floor of $207.20, so it holds at 205 + 6 + 0.7 × (16 − 6) = $218 and adds the $16 courier that costs it $6. The buyer's effective price is $218 − 0.8 × $16 = $205.20, inside its bid for that round, so it takes the offer, ranks it first (99.2% on time over 1,840 witnessed orders, arrives November 30 for a December 3 deadline), accepts, and withdraws from Common Thread. The result: the $275 shell for $218 with free 2-day delivery, and Harbor & Pine's public price is still $275.
The buyer's SendMessage to Harbor & Pine (headers A2A-Version: 1.0 and A2A-Extensions: https://protocol.frida.chat/ext/frida-protocol/v1):
{
"jsonrpc": "2.0",
"id": "msg_mx05hlu621z3t6j",
"method": "SendMessage",
"params": {
"message": {
"messageId": "msg_mx05hlu621z3t6j",
"role": "ROLE_USER",
"contextId": "ctx_FqdS9iMqkpijYPVn",
"extensions": ["https://protocol.frida.chat/ext/frida-protocol/v1"],
"parts": [{
"mediaType": "application/vnd.frida-protocol.v1+json",
"data": {
"type": "request",
"request_id": "req_YFNC_PNVTx9w54kT",
"items": [{ "query": "waterproof commuter shell", "attributes": { "size": "M" }, "quantity": 1 }],
"need_by": "2026-12-03",
"max_rounds": 4,
"buyer": { "id": "byr_dDldE4tB9y1ZkCg0HyvCYw", "passport": "eyJhbGciOiJFUzI1NiIs…" }
}
}]
}
}
}
The merchant's response:
{
"jsonrpc": "2.0",
"id": "msg_mx05hlu621z3t6j",
"result": {
"task": {
"id": "neg_zfTwK6zDYhwkpff0",
"contextId": "ctx_FqdS9iMqkpijYPVn",
"status": {
"state": "TASK_STATE_INPUT_REQUIRED",
"timestamp": "2026-11-28T17:00:00.000Z",
"message": {
"messageId": "msg_mx05hlu85e8af3u",
"role": "ROLE_AGENT",
"contextId": "ctx_FqdS9iMqkpijYPVn",
"taskId": "neg_zfTwK6zDYhwkpff0",
"extensions": ["https://protocol.frida.chat/ext/frida-protocol/v1"],
"parts": [
{ "text": "Opening offer: Waterproof Commuter Shell at $238 (list $275)." },
{ "mediaType": "application/vnd.frida-protocol.v1+json", "data": { "type": "offer", "offer_id": "off_xkQmVFftgg7Y4Lwy", "negotiation_id": "neg_zfTwK6zDYhwkpff0", "round": 0, "…": "the offer of section 5.3" } }
]
}
},
"metadata": { "https://protocol.frida.chat/ext/frida-protocol/v1": { "type": "offer" } }
}
}
}
The buyer's next SendMessage sets message.taskId to neg_zfTwK6zDYhwkpff0 and carries {"type": "counter", "negotiation_id": "neg_zfTwK6zDYhwkpff0", "in_reply_to": <that offer, unchanged>, "price": {"amount": 20500, "currency": "USD"}}.