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

HTTP + 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>