Agent guide

live marketplace contract

A clean buying flow for autonomous agents.

Leaf and Larder exposes a portable catalog, server-priced weight previews, and a firm quote workflow. An agent can inspect, calculate, submit an RFQ, accept a valid quote, and receive an order id for the secure payment-link email step.

01 / catalog

GET the catalog

Read the public catalog contract, then choose a lot and quantity for a live price preview.

curl -s https://leafandlarder.com/api/listings | jq '.items[] | {slug, category, availability, isDemo, previews}'

Each row includes id, slug, category, availability, isDemo, seller/origin fields, integer gram availability, and anchors at 1, 100, and 1,000 oz. The availability value remains part of the machine contract and is checked before an RFQ.

02 / preview

Preview an exact weight

Use the lot slug and an integer ounce quantity. The server performs the ounce-to-gram conversion and all arithmetic.

curl -s 'https://leafandlarder.com/api/listings/lst-anamalai-cardamom-a1/quote?oz=100'

Allowed quantities

1–1,000 whole oz

Formula

Landed subtotal + fixed 25% margin + interpolated shipping

Wire money

Integer USD cents

Version stamps

marginVersion + tierTableVersion

03 / rfq

POST the RFQ

Submit buyer intent against a catalog lot. The response returns the RFQ and firm-quote ids.

curl -s -X POST https://leafandlarder.com/api/rfq \
  -H 'content-type: application/json' \
  -d '{"listingId":"lst-anamalai-cardamom-a1","requestedOz":100,"buyerEmail":"procurement@example.com","shipTo":"Warehouse 4"}'

The response shape is { rfqId, quoteId, status: "received", nonTransactional: true }. Open /quote/<quoteId> to review the issued price, validity window, and version stamps.

04 / accept

Accept the firm quote

A valid quote can be accepted once, creating one real unpaid order with the exact issued totals and RFQ shipping string.

curl -s -X POST https://leafandlarder.com/api/quotes/<quoteId>/accept
Idempotent order
Repeating the request returns the same order through the unique quote id. The response keeps paymentState as lowercase unpaid.
Payment handoff
The order is not paid by this endpoint. The next step is a secure payment link sent to the buyer's email.

05 / verify

Verify the order

Use the returned order id as a bearer token for a redacted public verification read.

curl -s https://leafandlarder.com/api/orders/<orderId>

The order verification response exposes status, payment state, currency, total, and related ids without buyer email, shipping destination, notes, or payment notes.

The machine-readable manifest is available at /llms.txt. It lists the public routes, stable lot slugs, contract fields, pricing formula, and order handoff.