POST | /api/purchaseorder/discounteditems | Gets the discounted items in Order for checkout |
---|
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
public static class GetDiscountedPurchaseOrderItems
{
public ShoppingCartDto shoppingCart = null;
public ShoppingCartDto getShoppingCart() { return shoppingCart; }
public GetDiscountedPurchaseOrderItems setShoppingCart(ShoppingCartDto value) { this.shoppingCart = value; return this; }
}
public static class ShoppingCartDto
{
public String couponCode = null;
public ArrayList<ShoppingCartItemDto> items = null;
public BigDecimal total = null;
public String getCouponCode() { return couponCode; }
public ShoppingCartDto setCouponCode(String value) { this.couponCode = value; return this; }
public ArrayList<ShoppingCartItemDto> getItems() { return items; }
public ShoppingCartDto setItems(ArrayList<ShoppingCartItemDto> value) { this.items = value; return this; }
public BigDecimal getTotal() { return total; }
public ShoppingCartDto setTotal(BigDecimal value) { this.total = value; return this; }
}
public static class ShoppingCartItemDto
{
public String id = null;
public String name = null;
public Integer quantity = null;
public BigDecimal price = null;
public String discountDescription = null;
public String discountSource = null;
public BigDecimal discount = null;
public BigDecimal total = null;
public String getId() { return id; }
public ShoppingCartItemDto setId(String value) { this.id = value; return this; }
public String getName() { return name; }
public ShoppingCartItemDto setName(String value) { this.name = value; return this; }
public Integer getQuantity() { return quantity; }
public ShoppingCartItemDto setQuantity(Integer value) { this.quantity = value; return this; }
public BigDecimal getPrice() { return price; }
public ShoppingCartItemDto setPrice(BigDecimal value) { this.price = value; return this; }
public String getDiscountDescription() { return discountDescription; }
public ShoppingCartItemDto setDiscountDescription(String value) { this.discountDescription = value; return this; }
public String getDiscountSource() { return discountSource; }
public ShoppingCartItemDto setDiscountSource(String value) { this.discountSource = value; return this; }
public BigDecimal getDiscount() { return discount; }
public ShoppingCartItemDto setDiscount(BigDecimal value) { this.discount = value; return this; }
public BigDecimal getTotal() { return total; }
public ShoppingCartItemDto setTotal(BigDecimal value) { this.total = value; return this; }
}
public static class GetDiscountedPurchaseOrderItemsResponse
{
public ShoppingCartDto shoppingCart = null;
public String message = null;
public HttpStatusCode status = null;
public ResponseStatus responseStatus = null;
public ShoppingCartDto getShoppingCart() { return shoppingCart; }
public GetDiscountedPurchaseOrderItemsResponse setShoppingCart(ShoppingCartDto value) { this.shoppingCart = value; return this; }
public String getMessage() { return message; }
public GetDiscountedPurchaseOrderItemsResponse setMessage(String value) { this.message = value; return this; }
public HttpStatusCode getStatus() { return status; }
public GetDiscountedPurchaseOrderItemsResponse setStatus(HttpStatusCode value) { this.status = value; return this; }
public ResponseStatus getResponseStatus() { return responseStatus; }
public GetDiscountedPurchaseOrderItemsResponse setResponseStatus(ResponseStatus value) { this.responseStatus = value; return this; }
}
}
Java GetDiscountedPurchaseOrderItems DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /api/purchaseorder/discounteditems HTTP/1.1
Host: accounts.dev.healthmonix.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
shoppingCart:
{
couponCode: String,
items:
[
{
id: String,
name: String,
quantity: 0,
price: 0,
discountDescription: String,
discountSource: String,
discount: 0,
total: 0
}
],
total: 0
}
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { shoppingCart: { couponCode: String, items: [ { id: String, name: String, quantity: 0, price: 0, discountDescription: String, discountSource: String, discount: 0, total: 0 } ], total: 0 }, message: String, status: Continue, responseStatus: { errorCode: String, message: String, stackTrace: String, errors: [ { errorCode: String, fieldName: String, message: String, meta: { String: String } } ], meta: { String: String } } }