feat: Support location context hint in platform-initiated requests - #642
feat: Support location context hint in platform-initiated requests#642jingyli wants to merge 3 commits into
Conversation
| "properties": { | ||
| "location": { | ||
| "type": "string", | ||
| "description": "Identifier or name hint for the specific location (e.g., physical store, property, or restaurant) associated with the user. A common example in retail shopping is the default home store selected and saved by the user when purchasing grocery." |
There was a problem hiding this comment.
Acknowledging that #589 intends to add a location search capability should this PR be dependent on that one and then specify that values should be from location.json#id? That feels like it would provide both platform and business a clearer expectation about this field (relative to it being an identifier or name hint)
There was a problem hiding this comment.
Good point! I updated the description here to be more explicit that it should be a reference to the location (so it's consistent with the field we have today in catalog filters - https://github.com/Universal-Commerce-Protocol/ucp/blob/main/source/schemas/shopping/types/fulfillment_destination_filter.json#L18
I don't want to specifically reference back to the json field (i.e. like location.json#id) in the description here since that will imply a required dependency between UCP capabilities. In most cases, that would be the source of which we pull the data from, but if there is another mechanism of which platforms & businesses can communicate this reference back-and-forth then it's also fine to use its value here as-is.
| "type": "object", | ||
| "additionalProperties": true, | ||
| "properties": { | ||
| "location": { | ||
| "type": "string", | ||
| "description": "Reference to the specific location (e.g., physical store, property, or restaurant) associated with the user. A common example in retail shopping is the default home store selected and saved by the user on their profile when purchasing grocery." | ||
| }, | ||
| "intent": { | ||
| "type": "string", | ||
| "description": "Background context describing buyer's intent (e.g., 'looking for a gift under $50', 'need something durable for outdoor use'). Informs relevance, recommendations, and personalization." |
There was a problem hiding this comment.
I agree with @jingyli that cross-referencing capabilities within schema descriptions introduces potential coupling between capabilities, which we want to avoid.
Still, there is an opportunity to create conceptual connectivity across specifications, which seems to be the crux of @jamesandersen's comment. Instead of cross-referencing capabilities in context.location.description.
I suggest we establish Location as a first-class commerce concept in UCP via the Glossary:
Term | Acronym | Definition
----------|---------|---------------------------------------------------------------------------------------------------
Location | - | A physical entity (e.g., retail store, restaurant, pickup locker, warehouse) identified by a
| | stable, business-scoped string (id). Referenced across UCP for buyer localization
| | (context.location), store pickup fulfillment, and location discovery.
──────
This keeps the JSON Schema decoupled while giving implementers a clear, unified definition of what a location identifier represents across all UCP flows.
Description
Addressing a gap that would extend existing UCP shopping service schema/capabilities to support hyper-local goods (i.e. grocery) use cases:
Key Design Decision
Standardized
locationField incontext.jsonlocationstring property directly tocontext.json. This also allows the hint to be overwritten by more authoritative data constructs likefilters.fulfills_toincatalog_searchandfulfillmentextension's pickup location ID.Category (Required)
Please select one or more categories that apply to this change.
ucp-schematool (resolver, linter, validator). (Requires Maintainer approval)Checklist
!for breaking changes).Screenshots / Logs (if applicable)