feat(schema): add buyer_notes field to line items#402
Conversation
Adds an optional buyer_notes string field (max 500 chars) to both line_item and order_line_item schemas, enabling per-item buyer instructions such as customization requests, dietary notes, and gift messages. - line_item.json: buyer_notes is optional on create and update - order_line_item.json: buyer_notes preserved from checkout (read-only) Closes Universal-Commerce-Protocol#349
|
Thanks @damaz91 for pointing to #481 — the Additional Fields proposal is great work. After reviewing it though, I think the two PRs are complementary rather than overlapping. Additional Fields (#481) solves business-defined, checkout-scoped data collection — the business declares structured fields (PO numbers, delivery date pickers, age acknowledgements) and the platform collects values at checkout. That's a different problem from what #402 addresses.
A voice agent saying "The latte — extra hot, no foam. The croissant — warm please." produces two different notes on two different line items. Additional Fields has no line-item scoping, so there's no way to express this with #481 alone. Happy to re-open this if you agree they're complementary, or if you'd prefer, I can propose |
Summary
Adds an optional
buyer_notesstring field to bothline_itemandorder_line_itemschemas, enabling per-item buyer instructions.Closes #349
Motivation
Line items currently have no field for buyer-specific instructions. This is a gap for common commerce scenarios:
Voice and chat agents especially need this — they naturally collect customization preferences during conversation, but have no structured field to pass them through.
Changes
source/schemas/shopping/types/line_item.jsonbuyer_notes(string, maxLength 500)ucp_request: optional oncreateandupdatesource/schemas/shopping/types/order_line_item.jsonbuyer_notes(string, maxLength 500, read-only)Design decisions
stringvs structured objectmaxLength: 500line_item(notcheckout)order_line_itemExample
{ "line_items": [ { "item": { "id": "variant_latte_lg", "title": "Large Oat Latte" }, "quantity": 1, "buyer_notes": "Extra hot, oat milk, no foam" }, { "item": { "id": "variant_croissant", "title": "Butter Croissant" }, "quantity": 2, "buyer_notes": "Warm please" } ] }Backward compatibility
Fully backward-compatible. The field is optional on all operations. Existing implementations that do not send or handle
buyer_notesare unaffected.