| 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.*
import com.google.gson.annotations.*
import com.google.gson.reflect.*
open class WebshopOrderPreviewRequest
{
var ownerId:Int? = null
var externalId:String? = null
var lines:ArrayList<WebshopPurchaseLine> = ArrayList<WebshopPurchaseLine>()
var deliveryType:String? = null
var discountCode:String? = null
var buyerPhone:String? = null
var tenders:ArrayList<OrderTender> = ArrayList<OrderTender>()
}
open class WebshopPurchaseLine
{
var variantId:Int? = null
var quantity:Int? = null
}
open class OrderTender
{
var kind:String? = null
var code:String? = null
var amountMinor:Int? = null
var idempotencyKey:String? = null
var holdId:Int? = null
var appliedMinor:Int? = null
}
open class WebshopOrderPreviewResult
{
var statusCode:Int? = null
var success:Boolean? = null
var message:LocalizedMessage? = null
var reason:String? = null
var lines:ArrayList<WebshopPreviewLine> = ArrayList<WebshopPreviewLine>()
var subtotalMinor:Int? = null
var deliveryFeeMinor:Int? = null
var discountMinor:Int? = null
var giftAppliedMinor:Int? = null
var cardRemainderMinor:Int? = null
var tenders:ArrayList<WebshopPreviewTender> = ArrayList<WebshopPreviewTender>()
var discount:DiscountSummary? = null
}
open class LocalizedMessage
{
@SerializedName("is") var Is:String? = null
var en:String? = null
}
open class WebshopPreviewLine
{
var variantId:Int? = null
var productId:Int? = null
var productName:String? = null
var size:String? = null
var color:String? = null
var quantity:Int? = null
var unitBeforeMinor:Int? = null
var unitAfterMinor:Int? = null
var lineBeforeMinor:Int? = null
var lineAfterMinor:Int? = null
var discounted:Boolean? = null
}
open class WebshopPreviewTender
{
var code:String? = null
var appliedMinor:Int? = null
var ok:Boolean? = null
var reason:String? = null
var message:LocalizedMessage? = null
}
open class DiscountSummary
{
@SerializedName("type") var Type:String? = null
var value:BigDecimal? = null
}
Kotlin 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
}
}