[ECOMMERCE-305] Inconsistent resource identification Created: 22/Jun/20  Updated: 08/Oct/20  Resolved: 23/Jul/20

Status: Closed
Project: E-commerce
Component/s: None
Affects Version/s: None
Fix Version/s: 1.2

Type: Improvement Priority: Minor
Reporter: Laura Delnevo Assignee: Evzen Fochr
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to ECOMMERCE-315 DOC: Checkout & Cart API changes (V2 ... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Documentation update required:
Yes
Date of First Response:
Epic Link: E-com improvements 1.0 - 1.1.1 - 1.2
Sprint: Add-Ons 42
Story Points: 2

 Description   

Current behaviour

In general the resources are not properly identified.

For instance, to add an item in a cart we use:“/carts/items”

And we pass the cartId in the request.

New behaviour

It would be more appropriate using:“/carts/{cartId}/items”This is present in most of our API.



 Comments   
Comment by Evzen Fochr [ 09/Jul/20 ]

jlegendre
We need to update this page https://documentation.magnolia-cms.com/display/DOCS62/Cart+endpoint+API

we are adding version 2 endpoint of cart endpoint where we have cart id as path parameter instead of form parameter in these rest-calls. Rest of rest-calls is unchanged

addItem
@POST
@Path("/v2/carts/{cartId}/items")

removeItem
@DELETE
@Path("/v2/carts/{cartId}/items/{itemId}")

updateItemQuantity
@POST
@Path("/v2/carts/{cartId}/items/{itemId}")

Generated at Mon Feb 12 01:42:47 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.