docs: correct API examples to the current wire contract - #76
Merged
Merged
Conversation
atc964
marked this pull request as ready for review
September 14, 2026 19:14
The integrator-facing docs still showed the retired wire format, so every documented quote, booking, and change-request example failed against the live API. This rewrites them against the shared iab-agentic-primitives contract (pinned v0.5.1): required idempotency keys on every mutating request, Money objects (integer micros) instead of bare floats for prices, the envelope responses the mappers actually return, realistic product IDs, correct operator-only auth on order transitions and change request review/apply, and an accurate agent-card capabilities line. Idempotency-key and auth-key example values use the repo's existing <bracket> placeholder convention rather than realistic-looking strings.
atc964
force-pushed
the
docs/wire-contract-refresh
branch
from
September 14, 2026 20:35
febf640 to
bfe757d
Compare
Sirajmx
previously approved these changes
Sep 15, 2026
Contributor
There was a problem hiding this comment.
Verified: unit + integration passed (0 failed) - identical to current
main's own
baseline, as expected for a docs-only change. Also ranmkdocs build --strict, clean. Spot-
checked a sample of the corrected examples (idempotency keys,Moneypricing, envelope
responses, operator auth on transition/review/apply) against the live wire contract - accurate.
No conflicts merging ontomain.
…fresh # Conflicts: # CHANGELOG.md
Sirajmx
approved these changes
Sep 15, 2026
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The integrator-facing docs still described the retired wire format, so every documented quote, booking, order-transition, and change-request example failed against the API as it actually behaves today. This is a correction pass against the current contract: routers, interfaces/api/schemas.py, interfaces/api/contract_mappers.py, and the pinned iab-agentic-primitives v0.5.1. No prose was rewritten beyond what accuracy required.
docs/api/quotes.md
idempotency_key(every example 422s today);target_cpmwas documented as a bare float; the response was shown flat;product_idused a fake catalog slug ("display").idempotency_keyis required on every quote request, with replay/conflict semantics explained;target_cpmis aMoneyobject ({"amount_micros": <int>, "currency": "USD"}); the response is a{"quote": {...}}envelope wrapping the sharedQuoteprimitive, with every price field shown asMoney;product_iduses a realistic seller-issued id (prod-3f2a9c81) and notes that real IDs come fromGET /products.docs/integration/buyer-agent.md
idempotency_key), the book curl 422s (same), the order-transition step was shown as something a buyer agent calls directly even thoughPOST /api/v1/orders/{id}/transitionis operator-only, and the change-request curl 422s (idempotency_key required since fix: enforce idempotency for change requests #64). The agent-card description also claimed the card advertisesa2acapability.idempotency_keywith a note on replay semantics; the order-transition example is shown with an operator credential and a note that a buyer agent cannot call it directly; the change-request curl carriesidempotency_key; the agent-card description states the card currently serves onlyopendirect21(A2A is a documented design, not yet a served surface).docs/api/change-requests.md
idempotency_key; the review and apply curls were shown with no auth even though both are operator-only.idempotency_keyis documented as required in the table and both create examples; the review and apply curls carryAuthorization: Bearer <operator_api_key>, with prose noting the operator-only gate.docs/api/orders.md
Test plan
pyproject.tomlanduv.lockpiniab-agentic-primitivestov0.5.1; checked out that tag in a local clone to readMoney,Quote,QuoteRequest/QuoteResponse,DealBookingRequest/DealBookingResponse,ChangeRequestCreate,IdempotentRequest, and theOrderStatus/transition primitives directly from source.routers/quotes.py,routers/deals.py,routers/orders.py,routers/change_requests.py,routers/registry.py,interfaces/api/contract_mappers.py,interfaces/api/schemas.py,interfaces/api/deps.py, andmodels/order_state_machine.py(confirmed 21 transitions in_DEFAULT_TRANSITIONS, 12OrderStatusvalues).prod-{hash}product-id format fromservices/catalog_service.py.mkdocs build --strict(viauv runwith thedocsextra installed) — builds clean with no new warnings from the changed pages.