| Requires any of the roles: | Admin, TeamAdmin, MobileApp | Requires the permission: | ReadData |
| POST | /ticketOrder/previewDiscount |
|---|
import Foundation
import ServiceStack
public class PreviewDiscountRequest : Codable
{
public var code:String?
public var eventId:Int?
public var fullPhoneNumber:String?
public var orderDetails:[TicketDetails] = []
required public init(){}
}
public class TicketDetails : Codable
{
public var id:Int?
public var ticketId:Int?
public var eventSeriesTicketType:Int?
public var eventSeriesOwnerTicketType:Int?
public var ticketPrice:Double?
public var totalPrice:Double?
public var count:Int?
public var ticketColor:String?
public var showUsedTickets:Bool?
public var ticketName:String?
public var ticketDisplayString:String?
public var ticketDetailsTransferredFrom:Int?
public var teamPassId:Int?
public var isSpecialTicket:Bool?
public var specialTicketId:String?
public var justChangedBySQL:Bool?
public var sqlJustChangedTimeStamp:Date?
public var currency:String?
public var discountCode:String?
public var totalDiscount:Double?
public var totalAmountBeforeDiscount:Double?
public var ticketPriceBeforeDiscount:Double?
required public init(){}
}
public class PreviewDiscountResult : Codable
{
public var status:String?
public var reason:String?
public var message:LocalizedMessage?
public var discountCodeId:Int?
public var discountCodeTypeId:Int?
public var discount:DiscountSummary?
public var lines:[DiscountLineResult] = []
public var subtotalBefore:Double?
public var subtotalAfter:Double?
public var totalSavings:Double?
public var currency:String?
public var statusCode:Int?
required public init(){}
}
public class LocalizedMessage : Codable
{
public var `is`:String?
public var en:String?
required public init(){}
}
public class DiscountSummary : Codable
{
public var type:String?
public var value:Double?
required public init(){}
}
public class DiscountLineResult : Codable
{
public var ticketTypeId:Int?
public var count:Int?
public var applied:Bool?
public var unitBefore:Double?
public var unitAfter:Double?
public var lineBefore:Double?
public var lineAfter:Double?
required public init(){}
}
Swift PreviewDiscountRequest 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 /ticketOrder/previewDiscount HTTP/1.1
Host: stubbur-app.azurewebsites.net
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
code: String,
eventId: 0,
fullPhoneNumber: String,
orderDetails:
[
{
id: 0,
ticketId: 0,
eventSeriesTicketType: 0,
eventSeriesOwnerTicketType: 0,
ticketPrice: 0,
totalPrice: 0,
count: 0,
ticketColor: String,
showUsedTickets: False,
ticketName: String,
ticketDisplayString: String,
ticketDetailsTransferredFrom: 0,
teamPassId: 0,
isSpecialTicket: False,
specialTicketId: String,
justChangedBySQL: False,
sqlJustChangedTimeStamp: 0001-01-01,
currency: String,
discountCode: String,
totalDiscount: 0,
totalAmountBeforeDiscount: 0,
ticketPriceBeforeDiscount: 0
}
]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
status: String,
reason: String,
message:
{
is: String,
en: String
},
discountCodeId: 0,
discountCodeTypeId: 0,
discount:
{
type: String,
value: 0
},
lines:
[
{
ticketTypeId: 0,
count: 0,
applied: False,
unitBefore: 0,
unitAfter: 0,
lineBefore: 0,
lineAfter: 0
}
],
subtotalBefore: 0,
subtotalAfter: 0,
totalSavings: 0,
currency: String,
statusCode: 0
}