TicketUserServices

<back to all web services

WebshopOrderPreviewRequest

Requires Authentication
Requires any of the roles:Admin, TeamAdmin, MobileAppRequires the permission:ReadData
The following routes are available for this service:
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 .csv suffix or ?format=csv

HTTP + CSV

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: text/csv
Content-Type: text/csv
Content-Length: length

{"ownerId":0,"externalId":"String","lines":[{"variantId":0,"quantity":0}],"deliveryType":"String","discountCode":"String","buyerPhone":"String","tenders":[{"kind":"String","code":"String","amountMinor":0,"idempotencyKey":"String","holdId":0,"appliedMinor":0}]}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"statusCode":0,"success":false,"message":{"is":"String","en":"String"},"reason":"String","lines":[{"variantId":0,"productId":0,"productName":"String","size":"String","color":"String","quantity":0,"unitBeforeMinor":0,"unitAfterMinor":0,"lineBeforeMinor":0,"lineAfterMinor":0,"discounted":false}],"subtotalMinor":0,"deliveryFeeMinor":0,"discountMinor":0,"giftAppliedMinor":0,"cardRemainderMinor":0,"tenders":[{"code":"String","appliedMinor":0,"ok":false,"reason":"String","message":{"is":"String","en":"String"}}],"discount":{"type":"String","value":0}}