From af83d96c9402e7d1cc7c89fe7e70ba75bf0ee0b7 Mon Sep 17 00:00:00 2001 From: Jing Li Date: Mon, 20 Apr 2026 13:23:35 -0400 Subject: [PATCH 1/3] Documentation fix to discounts extension to make sure it is compliant with the spec. --- docs/specification/discount.md | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/docs/specification/discount.md b/docs/specification/discount.md index 5dcc976a..8fffbece 100644 --- a/docs/specification/discount.md +++ b/docs/specification/discount.md @@ -246,10 +246,9 @@ stacking and allocation details: "line_items": [ { "item": { - "id": "prod_shirt", - "quantity": 2, - "price": 2500 - } + "id": "prod_shirt" + }, + "quantity": 2 } ] } @@ -331,10 +330,8 @@ proceeding to checkout. { "item": { "id": "prod_1", - "quantity": 2, - "title": "T-Shirt", - "price": 2000 - } + }, + "quantity": 2 } ], "discounts": { @@ -353,10 +350,10 @@ proceeding to checkout. "id": "li_1", "item": { "id": "prod_1", - "quantity": 2, "title": "T-Shirt", "price": 2000 }, + "quantity": 2, "totals": [ {"type": "subtotal", "amount": 4000}, {"type": "items_discount", "amount": -800}, @@ -448,10 +445,10 @@ to line items, and an automatic shipping discount at the order level. "id": "li_1", "item": { "id": "prod_1", - "quantity": 2, "title": "T-Shirt", "price": 2000 }, + "quantity": 2, "totals": [ {"type": "subtotal", "amount": 4000}, {"type": "items_discount", "amount": -800}, @@ -545,9 +542,11 @@ Multiple discounts applied with full allocation breakdown: { "id": "li_1", "item": { + "id": "prod_1", "title": "T-Shirt", "price": 6000 }, + "quantity": 1, "totals": [ {"type": "subtotal", "amount": 6000}, {"type": "items_discount", "amount": -1500}, @@ -557,9 +556,11 @@ Multiple discounts applied with full allocation breakdown: { "id": "li_2", "item": { + "id": "prod_2", "title": "Socks", "price": 4000 }, + "quantity": 1, "totals": [ {"type": "subtotal", "amount": 4000}, {"type": "items_discount", "amount": -1000}, From eec6cecd7bdafdae61e780364da4c4234cb97e9b Mon Sep 17 00:00:00 2001 From: Jing Li Date: Mon, 20 Apr 2026 16:00:58 -0400 Subject: [PATCH 2/3] Clean up unsupported field in checkout examples for quantity-related errors. --- docs/specification/checkout-mcp.md | 10 ++++++++-- docs/specification/checkout-rest.md | 12 +++++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/docs/specification/checkout-mcp.md b/docs/specification/checkout-mcp.md index 26182fea..b4c51c8d 100644 --- a/docs/specification/checkout-mcp.md +++ b/docs/specification/checkout-mcp.md @@ -656,10 +656,16 @@ as JSON-RPC `result` with `structuredContent` containing the UCP envelope and "line_items": [ { "id": "li_1", - "quantity": 100, - "available_quantity": 12 + "item": { + "id": "item_123", + "title": "Blue Jeans", + "price": 5000 + }, + "quantity": 12, + "totals": [...] } ], + "totals": [...], "messages": [ { "type": "warning", diff --git a/docs/specification/checkout-rest.md b/docs/specification/checkout-rest.md index 4c365c38..7197cc20 100644 --- a/docs/specification/checkout-rest.md +++ b/docs/specification/checkout-rest.md @@ -1291,11 +1291,17 @@ with HTTP 200 and the UCP envelope containing `messages`: "status": "incomplete", "line_items": [ { - "id": "item_456", - "quantity": 100, - "available_quantity": 12 + "id": "li_1", + "item": { + "id": "item_123", + "title": "Blue Jeans", + "price": 5000 + }, + "quantity": 12, + "totals": [...] } ], + "totals": [...], "messages": [ { "type": "warning", From 7949c0f302f786dff81763fe623e521d25379a30 Mon Sep 17 00:00:00 2001 From: Jing Li Date: Mon, 20 Apr 2026 17:26:50 -0400 Subject: [PATCH 3/3] Fix discount schema to use UCP specific annotation instead of readOnly. --- source/schemas/shopping/discount.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/schemas/shopping/discount.json b/source/schemas/shopping/discount.json index f4dd7eea..85c3a228 100644 --- a/source/schemas/shopping/discount.json +++ b/source/schemas/shopping/discount.json @@ -92,11 +92,11 @@ }, "applied": { "type": "array", - "readOnly": true, "items": { "$ref": "#/$defs/applied_discount" }, - "description": "Discounts successfully applied (code-based and automatic)." + "description": "Discounts successfully applied (code-based and automatic).", + "ucp_request": "omit" } } },