| POST | /selfService/transferTicket/targetTicketTypes | Ticket types on the target event a buyer may exchange into, with per-option price difference and blocking reason |
|---|
import Foundation
import ServiceStack
public class SelfServiceTransferTargetTicketTypesRequest : Codable
{
public var ticketTokenId:String?
public var buyerPhone:String?
public var toEventId:Int?
public var sectionId:Int?
required public init(){}
}
public class SelfServiceTransferTargetTicketTypesResult : SelfServiceTransferResultBase
{
public var sourceTicketPrice:Double?
public var sourceTicketTypeName:String?
public var toEventId:Int?
public var targetIsSeated:Bool?
public var options:[SelfServiceTargetTicketTypeOption] = []
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case sourceTicketPrice
case sourceTicketTypeName
case toEventId
case targetIsSeated
case options
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
sourceTicketPrice = try container.decodeIfPresent(Double.self, forKey: .sourceTicketPrice)
sourceTicketTypeName = try container.decodeIfPresent(String.self, forKey: .sourceTicketTypeName)
toEventId = try container.decodeIfPresent(Int.self, forKey: .toEventId)
targetIsSeated = try container.decodeIfPresent(Bool.self, forKey: .targetIsSeated)
options = try container.decodeIfPresent([SelfServiceTargetTicketTypeOption].self, forKey: .options) ?? []
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if sourceTicketPrice != nil { try container.encode(sourceTicketPrice, forKey: .sourceTicketPrice) }
if sourceTicketTypeName != nil { try container.encode(sourceTicketTypeName, forKey: .sourceTicketTypeName) }
if toEventId != nil { try container.encode(toEventId, forKey: .toEventId) }
if targetIsSeated != nil { try container.encode(targetIsSeated, forKey: .targetIsSeated) }
if options.count > 0 { try container.encode(options, forKey: .options) }
}
}
public class SelfServiceTransferResultBase : Codable
{
public var ok:Bool?
public var statusCode:Int?
public var code:String?
public var message:String?
required public init(){}
}
public class SelfServiceTargetTicketTypeOption : Codable
{
public var ownerTicketTypeId:Int?
public var seriesTicketTypeId:Int?
public var name:String?
public var price:Double?
public var direction:String?
public var priceDifference:Double?
public var nameMatchesSource:Bool?
public var selectable:Bool?
public var blockedReason:String?
public var blockedMessage:String?
public var maxTickets:Int?
public var ticketsSold:Int?
public var ticketsLeft:Int?
public var saleStatus:String?
public var saleStartsUTC:Date?
public var saleEndsUTC:Date?
required public init(){}
}
Swift SelfServiceTransferTargetTicketTypesRequest 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 /selfService/transferTicket/targetTicketTypes HTTP/1.1
Host: stubbur-app.azurewebsites.net
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
ticketTokenId: String,
buyerPhone: String,
toEventId: 0,
sectionId: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
sourceTicketPrice: 0,
sourceTicketTypeName: String,
toEventId: 0,
targetIsSeated: False,
options:
[
{
ownerTicketTypeId: 0,
seriesTicketTypeId: 0,
name: String,
price: 0,
direction: String,
priceDifference: 0,
nameMatchesSource: False,
selectable: False,
blockedReason: String,
blockedMessage: String,
maxTickets: 0,
ticketsSold: 0,
ticketsLeft: 0,
saleStatus: String,
saleStartsUTC: 0001-01-01,
saleEndsUTC: 0001-01-01
}
],
ok: False,
statusCode: 0,
code: String,
message: String
}