Skip to content

docs(spec): document the account-linking flow agents actually need - #231

Merged
Sebastian Hölscher (HoelShare) merged 1 commit into
mainfrom
claude/avinash-problem-clarify-c70e61
Oct 5, 2026
Merged

Sebastian Hölscher (HoelShare) merged 1 commit into
mainfrom
claude/avinash-problem-clarify-c70e61

Conversation

@HoelShare

Copy link
Copy Markdown
Contributor

Why

A partner building a spec-conformant UCP buyer called the advertised authorization_endpoint and got 400 identity_required. That endpoint, from Agentic Commerce, only issues a code when a signed-in storefront customer is attached. An agent-signed call never has one. The flow that works is this plugin's POST /ucp/quote-agent/authorization-requests, but the published quote.html and quote.openapi.json never mentioned it.

Reproduced on 2026-10-05 against a strict-signature test shop (AC 1.3.0). The direct authorize call failed with identity_required. The consent flow returned a token, and GET /ucp/quotes with that token answered 200.

What changes

quote.spec.html, Authorization:

  • Linking an account: the four steps (register, browser consent, callback, code exchange), with the body, the redirect_uri rules, the TTL, single use, access_denied and refresh tokens
  • Warning: do not call authorization_endpoint directly from an agent
  • Scope rule: request only scopes listed in scopes_supported. The old text said to request com.shopware.quote:manage, which AC 1.3.0 refuses at consent.
  • Signing GET requests: the shop's verifier sorts the query parameters
  • Error table: two new rows (401 for an unverified authorization request, 400 for identity_required)

quote.openapi.json: the bearerAuth description points at the flow and the scope rule.

No code changes. QuoteContractControllerTest passes.

Follow-ups (not in this PR)

  • Agentic Commerce should make authorization_endpoint a real browser consent flow, as the UCP spec describes. Once it does, this plugin's route can be deprecated.
  • On AC 1.4, register com.shopware.quote:manage through AbstractUcpOAuthScopeProvider so the scope appears in scopes_supported.

🤖 Generated with Claude Code

The published quote spec told agents to obtain a token through identity
linking but never named the entry point that works. The advertised
authorization_endpoint only issues a code for a signed-in storefront
customer, so an agent calling it gets identity_required. That is the
error a partner hit while building a spec-conformant buyer.

Document the pushed-request flow (POST
/ucp/quote-agent/authorization-requests, consent on authorization_url,
code exchange), the scope rule (request only what scopes_supported
lists), and the query-sorting rule for signed GETs. Add both failures
to the error table.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@HoelShare
Sebastian Hölscher (HoelShare) merged commit 8a0dd2d into main Oct 5, 2026
1 check passed
@HoelShare
Sebastian Hölscher (HoelShare) deleted the claude/avinash-problem-clarify-c70e61 branch October 5, 2026 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant