Quote Flow
The negotiation follows four steps:- Buyer sends a quote request. The buyer POSTs to your
/a2a/quoteendpoint, describing the work it wants done (token estimates, unit count) and optionally naming a maximum amount it is willing to pay. - Seller prices the work. Your seller calls
priceFor(model, estimate)using the pricing model defined for the requested endpoint, producing the list price in atomic units. - Seller signs and returns the Quote. The seller signs the canonical quote body with its Hedera account key and returns the
Quoteobject. Thecounteredflag tells the buyer whether the seller accepted a counter-offer below list price. - Buyer verifies the signature. The buyer checks the quote signature against
signerPublicKey, then queries the Hedera mirror node to confirm thatsignerPublicKeyis the active key for thepayToaccount named in the listing. This proves the quote was issued by the entity that owns the payment destination.
Request Format
Send a JSON body toPOST /a2a/quote:
string
Your UAID (e.g.
uaid:aid:...). Optional — provided for the seller’s information and recorded in logs, but not required for the quote to be processed.string
required
The stable identifier of the endpoint you want to call, as declared in the seller’s
ServiceListing. For example: "infer" or "hbar-rate".object
Your estimate of the work to be done. The seller uses this to compute the price. All sub-fields are optional and default to
0 (or 1 for units).string
Your ceiling price in atomic units of
asset (e.g. "9000000" for 0.09 HBAR). If you pass this and it is below the seller’s list price, the seller treats it as a counter-offer. Omit to accept the list price.string
default:"0.0.0"
The HTS asset ID to pay with.
"0.0.0" means native HBAR. Must match one of the accepts entries on the endpoint.Response Format
A successful200 response body:
Quote object
required
The signed quote. Pass
quote.quoteId in your payment request body to pin the payment to this quoted amount.boolean
required
true if the seller accepted a counter-offer below its list price. false if the returned amount equals the seller’s computed list price. Use this to know whether you negotiated a discount.Counter-Offers
If you pass amaxAmount below the seller’s list price, the seller’s quote engine compares your ceiling against an internal floor:
- Above the floor — the seller accepts your counter. The quote
amountis set to yourmaxAmountandcounteredistrue. - Below the floor — the seller rejects with
HTTP 409 Conflict. The response body includesminimumAmount(the seller’s floor) andlistPriceso you can see the range and decide whether to retry at a higher ceiling.
HTTP 409 response when counter is below the floor
Using a Quote in a Paid Request
Once you have a quote, includequoteId in the JSON body of your paid request. The seller’s middleware reads quoteId from the request body and uses quote.amount as the 402 challenge price instead of re-computing the live price from the request:
Requesting a quote and using it