| 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 .jsv suffix or ?format=jsv
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/jsv
Content-Type: text/jsv
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/jsv
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
}
}