Conversation
Discount previously only extended checkout, leaving cart without discount code support. This meant automatic discounts were invisible during cart exploration and agents couldn't show savings pre-checkout. - Add dev.ucp.shopping.cart extension in discount schema (create/update) - Update discovery example to show cart + checkout extends - Add cart-to-checkout continuity requirement (MUST carry forward codes) - Add cart discount example to specification docs
Replace **Request:**/**Response:** markdown with === "Request"/=== "Response" tabbed format for consistency with cart-rest.md and checkout-rest.md.
| - Discount amounts reflected in `totals[]` and `line_items[].discount` | ||
|
|
||
| **Cart-to-checkout continuity:** When a cart is converted to a checkout via the | ||
| cart capability's `cart_id` field, businesses MUST carry forward any discount |
There was a problem hiding this comment.
This adds a sort of state-management requirement for implementations. Do we need to add explicit guidance on how to handle codes that might become invalid during that transition (e.g., a code that works for "Cart Exploration" but is restricted during "Checkout") e.g first time user discount code shown at cart time, which is invalid when the user signs in and merchant finds out that the user is an existing user?
|
|
||
| ### Cart with discount codes | ||
|
|
||
| Discount codes applied during cart exploration. The cart response includes |
There was a problem hiding this comment.
The schema uses the same applied_discount object for both Cart (estimated) and Checkout (final).Do we need something in the documentation to clarify that cart-level discounts are non-binding/provisional, whereas checkout-level discounts are typically locked in.
We landed discount capability before cart and forgot to update discount capability. This PR fixes that:
Backwards compatible. It is up to the business whether they extend and support discounts on cart by using built-in
extendsmechanism on the capability, this change wires up the right schema shapes.Checklist