| Requires any of the roles: | Admin, TeamAdmin, MobileApp | Requires the permission: | ReadData |
| POST | /Webshop/Order/Preview |
|---|
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
public static class WebshopOrderPreviewRequest
{
public Integer ownerId = null;
public String externalId = null;
public ArrayList<WebshopPurchaseLine> lines = null;
public String deliveryType = null;
public String discountCode = null;
public String buyerPhone = null;
public ArrayList<OrderTender> tenders = null;
public Integer getOwnerId() { return ownerId; }
public WebshopOrderPreviewRequest setOwnerId(Integer value) { this.ownerId = value; return this; }
public String getExternalId() { return externalId; }
public WebshopOrderPreviewRequest setExternalId(String value) { this.externalId = value; return this; }
public ArrayList<WebshopPurchaseLine> getLines() { return lines; }
public WebshopOrderPreviewRequest setLines(ArrayList<WebshopPurchaseLine> value) { this.lines = value; return this; }
public String getDeliveryType() { return deliveryType; }
public WebshopOrderPreviewRequest setDeliveryType(String value) { this.deliveryType = value; return this; }
public String getDiscountCode() { return discountCode; }
public WebshopOrderPreviewRequest setDiscountCode(String value) { this.discountCode = value; return this; }
public String getBuyerPhone() { return buyerPhone; }
public WebshopOrderPreviewRequest setBuyerPhone(String value) { this.buyerPhone = value; return this; }
public ArrayList<OrderTender> getTenders() { return tenders; }
public WebshopOrderPreviewRequest setTenders(ArrayList<OrderTender> value) { this.tenders = value; return this; }
}
public static class WebshopPurchaseLine
{
public Integer variantId = null;
public Integer quantity = null;
public Integer getVariantId() { return variantId; }
public WebshopPurchaseLine setVariantId(Integer value) { this.variantId = value; return this; }
public Integer getQuantity() { return quantity; }
public WebshopPurchaseLine setQuantity(Integer value) { this.quantity = value; return this; }
}
public static class OrderTender
{
public String kind = null;
public String code = null;
public Integer amountMinor = null;
public String idempotencyKey = null;
public Integer holdId = null;
public Integer appliedMinor = null;
public String getKind() { return kind; }
public OrderTender setKind(String value) { this.kind = value; return this; }
public String getCode() { return code; }
public OrderTender setCode(String value) { this.code = value; return this; }
public Integer getAmountMinor() { return amountMinor; }
public OrderTender setAmountMinor(Integer value) { this.amountMinor = value; return this; }
public String getIdempotencyKey() { return idempotencyKey; }
public OrderTender setIdempotencyKey(String value) { this.idempotencyKey = value; return this; }
public Integer getHoldId() { return holdId; }
public OrderTender setHoldId(Integer value) { this.holdId = value; return this; }
public Integer getAppliedMinor() { return appliedMinor; }
public OrderTender setAppliedMinor(Integer value) { this.appliedMinor = value; return this; }
}
public static class WebshopOrderPreviewResult
{
public Integer statusCode = null;
public Boolean success = null;
public LocalizedMessage message = null;
public String reason = null;
public ArrayList<WebshopPreviewLine> lines = null;
public Integer subtotalMinor = null;
public Integer deliveryFeeMinor = null;
public Integer discountMinor = null;
public Integer giftAppliedMinor = null;
public Integer cardRemainderMinor = null;
public ArrayList<WebshopPreviewTender> tenders = null;
public DiscountSummary discount = null;
public Integer getStatusCode() { return statusCode; }
public WebshopOrderPreviewResult setStatusCode(Integer value) { this.statusCode = value; return this; }
public Boolean isSuccess() { return success; }
public WebshopOrderPreviewResult setSuccess(Boolean value) { this.success = value; return this; }
public LocalizedMessage getMessage() { return message; }
public WebshopOrderPreviewResult setMessage(LocalizedMessage value) { this.message = value; return this; }
public String getReason() { return reason; }
public WebshopOrderPreviewResult setReason(String value) { this.reason = value; return this; }
public ArrayList<WebshopPreviewLine> getLines() { return lines; }
public WebshopOrderPreviewResult setLines(ArrayList<WebshopPreviewLine> value) { this.lines = value; return this; }
public Integer getSubtotalMinor() { return subtotalMinor; }
public WebshopOrderPreviewResult setSubtotalMinor(Integer value) { this.subtotalMinor = value; return this; }
public Integer getDeliveryFeeMinor() { return deliveryFeeMinor; }
public WebshopOrderPreviewResult setDeliveryFeeMinor(Integer value) { this.deliveryFeeMinor = value; return this; }
public Integer getDiscountMinor() { return discountMinor; }
public WebshopOrderPreviewResult setDiscountMinor(Integer value) { this.discountMinor = value; return this; }
public Integer getGiftAppliedMinor() { return giftAppliedMinor; }
public WebshopOrderPreviewResult setGiftAppliedMinor(Integer value) { this.giftAppliedMinor = value; return this; }
public Integer getCardRemainderMinor() { return cardRemainderMinor; }
public WebshopOrderPreviewResult setCardRemainderMinor(Integer value) { this.cardRemainderMinor = value; return this; }
public ArrayList<WebshopPreviewTender> getTenders() { return tenders; }
public WebshopOrderPreviewResult setTenders(ArrayList<WebshopPreviewTender> value) { this.tenders = value; return this; }
public DiscountSummary getDiscount() { return discount; }
public WebshopOrderPreviewResult setDiscount(DiscountSummary value) { this.discount = value; return this; }
}
public static class LocalizedMessage
{
public String is = null;
public String en = null;
public String getIs() { return is; }
public LocalizedMessage setIs(String value) { this.is = value; return this; }
public String getEn() { return en; }
public LocalizedMessage setEn(String value) { this.en = value; return this; }
}
public static class WebshopPreviewLine
{
public Integer variantId = null;
public Integer productId = null;
public String productName = null;
public String size = null;
public String color = null;
public Integer quantity = null;
public Integer unitBeforeMinor = null;
public Integer unitAfterMinor = null;
public Integer lineBeforeMinor = null;
public Integer lineAfterMinor = null;
public Boolean discounted = null;
public Integer getVariantId() { return variantId; }
public WebshopPreviewLine setVariantId(Integer value) { this.variantId = value; return this; }
public Integer getProductId() { return productId; }
public WebshopPreviewLine setProductId(Integer value) { this.productId = value; return this; }
public String getProductName() { return productName; }
public WebshopPreviewLine setProductName(String value) { this.productName = value; return this; }
public String getSize() { return size; }
public WebshopPreviewLine setSize(String value) { this.size = value; return this; }
public String getColor() { return color; }
public WebshopPreviewLine setColor(String value) { this.color = value; return this; }
public Integer getQuantity() { return quantity; }
public WebshopPreviewLine setQuantity(Integer value) { this.quantity = value; return this; }
public Integer getUnitBeforeMinor() { return unitBeforeMinor; }
public WebshopPreviewLine setUnitBeforeMinor(Integer value) { this.unitBeforeMinor = value; return this; }
public Integer getUnitAfterMinor() { return unitAfterMinor; }
public WebshopPreviewLine setUnitAfterMinor(Integer value) { this.unitAfterMinor = value; return this; }
public Integer getLineBeforeMinor() { return lineBeforeMinor; }
public WebshopPreviewLine setLineBeforeMinor(Integer value) { this.lineBeforeMinor = value; return this; }
public Integer getLineAfterMinor() { return lineAfterMinor; }
public WebshopPreviewLine setLineAfterMinor(Integer value) { this.lineAfterMinor = value; return this; }
public Boolean isDiscounted() { return discounted; }
public WebshopPreviewLine setDiscounted(Boolean value) { this.discounted = value; return this; }
}
public static class WebshopPreviewTender
{
public String code = null;
public Integer appliedMinor = null;
public Boolean ok = null;
public String reason = null;
public LocalizedMessage message = null;
public String getCode() { return code; }
public WebshopPreviewTender setCode(String value) { this.code = value; return this; }
public Integer getAppliedMinor() { return appliedMinor; }
public WebshopPreviewTender setAppliedMinor(Integer value) { this.appliedMinor = value; return this; }
public Boolean isOk() { return ok; }
public WebshopPreviewTender setOk(Boolean value) { this.ok = value; return this; }
public String getReason() { return reason; }
public WebshopPreviewTender setReason(String value) { this.reason = value; return this; }
public LocalizedMessage getMessage() { return message; }
public WebshopPreviewTender setMessage(LocalizedMessage value) { this.message = value; return this; }
}
public static class DiscountSummary
{
public String type = null;
public BigDecimal value = null;
public String getType() { return type; }
public DiscountSummary setType(String value) { this.type = value; return this; }
public BigDecimal getValue() { return value; }
public DiscountSummary setValue(BigDecimal value) { this.value = value; return this; }
}
}
Java WebshopOrderPreviewRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /Webshop/Order/Preview HTTP/1.1
Host: stubbur-app.azurewebsites.net
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<WebshopOrderPreviewRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceModel">
<BuyerPhone>String</BuyerPhone>
<DeliveryType>String</DeliveryType>
<DiscountCode>String</DiscountCode>
<ExternalId>String</ExternalId>
<Lines>
<WebshopPurchaseLine>
<Quantity>0</Quantity>
<VariantId>0</VariantId>
</WebshopPurchaseLine>
</Lines>
<OwnerId>0</OwnerId>
<Tenders>
<OrderTender>
<AmountMinor>0</AmountMinor>
<AppliedMinor>0</AppliedMinor>
<Code>String</Code>
<HoldId>0</HoldId>
<IdempotencyKey>String</IdempotencyKey>
<Kind>String</Kind>
</OrderTender>
</Tenders>
</WebshopOrderPreviewRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<WebshopOrderPreviewResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceModel">
<CardRemainderMinor>0</CardRemainderMinor>
<DeliveryFeeMinor>0</DeliveryFeeMinor>
<Discount>
<Type>String</Type>
<Value>0</Value>
</Discount>
<DiscountMinor>0</DiscountMinor>
<GiftAppliedMinor>0</GiftAppliedMinor>
<Lines>
<WebshopPreviewLine>
<Color>String</Color>
<Discounted>false</Discounted>
<LineAfterMinor>0</LineAfterMinor>
<LineBeforeMinor>0</LineBeforeMinor>
<ProductId>0</ProductId>
<ProductName>String</ProductName>
<Quantity>0</Quantity>
<Size>String</Size>
<UnitAfterMinor>0</UnitAfterMinor>
<UnitBeforeMinor>0</UnitBeforeMinor>
<VariantId>0</VariantId>
</WebshopPreviewLine>
</Lines>
<Message>
<En>String</En>
<Is>String</Is>
</Message>
<Reason>String</Reason>
<StatusCode>0</StatusCode>
<SubtotalMinor>0</SubtotalMinor>
<Success>false</Success>
<Tenders>
<WebshopPreviewTender>
<AppliedMinor>0</AppliedMinor>
<Code>String</Code>
<Message>
<En>String</En>
<Is>String</Is>
</Message>
<Ok>false</Ok>
<Reason>String</Reason>
</WebshopPreviewTender>
</Tenders>
</WebshopOrderPreviewResult>