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.*
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 .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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/json
Content-Type: application/json
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: application/json
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}}