| Requires any of the roles: | Admin, TeamAdmin, MobileApp | Requires the permission: | ReadData |
| POST | /Webshop/Order/Preview |
|---|
import Foundation
import ServiceStack
public class WebshopOrderPreviewRequest : Codable
{
public var ownerId:Int?
public var externalId:String?
public var lines:[WebshopPurchaseLine] = []
public var deliveryType:String?
public var discountCode:String?
public var buyerPhone:String?
public var tenders:[OrderTender] = []
required public init(){}
}
public class WebshopPurchaseLine : Codable
{
public var variantId:Int?
public var quantity:Int?
required public init(){}
}
public class OrderTender : Codable
{
public var kind:String?
public var code:String?
public var amountMinor:Int?
public var idempotencyKey:String?
public var holdId:Int?
public var appliedMinor:Int?
required public init(){}
}
public class WebshopOrderPreviewResult : Codable
{
public var statusCode:Int?
public var success:Bool?
public var message:LocalizedMessage?
public var reason:String?
public var lines:[WebshopPreviewLine] = []
public var subtotalMinor:Int?
public var deliveryFeeMinor:Int?
public var discountMinor:Int?
public var giftAppliedMinor:Int?
public var cardRemainderMinor:Int?
public var tenders:[WebshopPreviewTender] = []
public var discount:DiscountSummary?
required public init(){}
}
public class LocalizedMessage : Codable
{
public var `is`:String?
public var en:String?
required public init(){}
}
public class WebshopPreviewLine : Codable
{
public var variantId:Int?
public var productId:Int?
public var productName:String?
public var size:String?
public var color:String?
public var quantity:Int?
public var unitBeforeMinor:Int?
public var unitAfterMinor:Int?
public var lineBeforeMinor:Int?
public var lineAfterMinor:Int?
public var discounted:Bool?
required public init(){}
}
public class WebshopPreviewTender : Codable
{
public var code:String?
public var appliedMinor:Int?
public var ok:Bool?
public var reason:String?
public var message:LocalizedMessage?
required public init(){}
}
public class DiscountSummary : Codable
{
public var type:String?
public var value:Double?
required public init(){}
}
Swift 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>