@Path(value="shops/{shopId}/carts")
public final class CartResource
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private OrderService |
orderService |
private CartService |
service |
private ShopRequestContextService |
shopReqCtxService |
Constructor and Description |
---|
CartResource(ShopRequestContextService shopReqCtxService,
CartService service,
OrderService orderService) |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
addCoupon(java.lang.String shopId,
GUID cartId,
java.lang.String code) |
javax.ws.rs.core.Response |
create(java.lang.String shopId,
CartInput cartIn)
Creates a cart for the specified shop
|
javax.ws.rs.core.Response |
createOrderForCart(java.lang.String shopId,
GUID cartId) |
javax.ws.rs.core.Response |
get(java.lang.String shopId,
GUID cartId,
java.lang.Boolean includeTax)
Fetches a specified cart from the specified shop
|
javax.ws.rs.core.Response |
removeCoupon(java.lang.String shopId,
GUID cartId,
GUID couponLineItemId) |
private final ShopRequestContextService shopReqCtxService
private final CartService service
private final OrderService orderService
@Inject public CartResource(ShopRequestContextService shopReqCtxService, CartService service, OrderService orderService)
@POST @Produces(value="application/vnd.epages.v1+json, application/json") @Consumes(value="application/json") @RolesAllowed(value={"sf","products_read"}) public javax.ws.rs.core.Response create(@PathParam(value="shopId") java.lang.String shopId, CartInput cartIn)
shopId
- Unique identifier of the shopcartIn
- Cart creation input@GET @Path(value="{cartId}") @Produces(value="application/vnd.epages.v1+json, application/json") @RolesAllowed(value={"sf","carts_read"}) public javax.ws.rs.core.Response get(@PathParam(value="shopId") java.lang.String shopId, @PathParam(value="cartId") GUID cartId, @DefaultValue(value="true") @QueryParam(value="includeTax") java.lang.Boolean includeTax)
shopId
- Unique identifier of the shopcartId
- Unique identifier of the cart@POST @Path(value="{cartId}/order") @Produces(value="application/vnd.epages.v1+json, application/json") @RolesAllowed(value="orders_write") @Consumes(value="application/json") public javax.ws.rs.core.Response createOrderForCart(@PathParam(value="shopId") java.lang.String shopId, @PathParam(value="cartId") GUID cartId)
@POST @Path(value="{cartId}/coupon") @Produces(value="application/vnd.epages.v1+json, application/json") @RolesAllowed(value="carts_read") @Consumes(value="application/x-www-form-urlencoded") public javax.ws.rs.core.Response addCoupon(@PathParam(value="shopId") java.lang.String shopId, @PathParam(value="cartId") GUID cartId, @FormParam(value="code") java.lang.String code)
@DELETE @Path(value="{cartId}/coupon/{couponLineItemId}") @Produces(value="application/vnd.epages.v1+json, application/json") @RolesAllowed(value="carts_read") public javax.ws.rs.core.Response removeCoupon(@PathParam(value="shopId") java.lang.String shopId, @PathParam(value="cartId") GUID cartId, @PathParam(value="couponLineItemId") GUID couponLineItemId)