TicketUserServices

<back to all web services

SelfServiceTransferQuoteRequest

Requires Authentication
The following routes are available for this service:
POST/selfService/transferTicket/quotePrice difference and eligibility for a prospective buyer-initiated exchange
import Foundation
import ServiceStack

public class SelfServiceTransferQuoteRequest : Codable
{
    public var ticketTokenId:String?
    public var buyerPhone:String?
    public var toEventId:Int?
    public var toOwnerTicketTypeId:Int?
    public var toSeriesTicketTypeId:Int?
    public var toSeatId:Int?

    required public init(){}
}

public class SelfServiceTransferQuoteResult : SelfServiceTransferResultBase
{
    public var direction:String?
    public var priceDifference:Double?
    public var sourceTicketPrice:Double?
    public var targetTicketPrice:Double?
    public var sourceEventId:Int?
    public var sourceEventName:String?
    public var sourceEventTimeOfEvent:Date?
    public var toEventId:Int?
    public var toEventName:String?
    public var toEventTimeOfEvent:Date?
    public var toTicketTypeName:String?
    public var targetIsSeated:Bool?
    public var toSeatId:Int?
    public var assignedSeatId:Int?
    public var assignedSeatLabel:String?
    public var ticketsLeft:Int?
    public var saleStatus:String?
    public var expectedPriceDifference:Double?

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case direction
        case priceDifference
        case sourceTicketPrice
        case targetTicketPrice
        case sourceEventId
        case sourceEventName
        case sourceEventTimeOfEvent
        case toEventId
        case toEventName
        case toEventTimeOfEvent
        case toTicketTypeName
        case targetIsSeated
        case toSeatId
        case assignedSeatId
        case assignedSeatLabel
        case ticketsLeft
        case saleStatus
        case expectedPriceDifference
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        direction = try container.decodeIfPresent(String.self, forKey: .direction)
        priceDifference = try container.decodeIfPresent(Double.self, forKey: .priceDifference)
        sourceTicketPrice = try container.decodeIfPresent(Double.self, forKey: .sourceTicketPrice)
        targetTicketPrice = try container.decodeIfPresent(Double.self, forKey: .targetTicketPrice)
        sourceEventId = try container.decodeIfPresent(Int.self, forKey: .sourceEventId)
        sourceEventName = try container.decodeIfPresent(String.self, forKey: .sourceEventName)
        sourceEventTimeOfEvent = try container.decodeIfPresent(Date.self, forKey: .sourceEventTimeOfEvent)
        toEventId = try container.decodeIfPresent(Int.self, forKey: .toEventId)
        toEventName = try container.decodeIfPresent(String.self, forKey: .toEventName)
        toEventTimeOfEvent = try container.decodeIfPresent(Date.self, forKey: .toEventTimeOfEvent)
        toTicketTypeName = try container.decodeIfPresent(String.self, forKey: .toTicketTypeName)
        targetIsSeated = try container.decodeIfPresent(Bool.self, forKey: .targetIsSeated)
        toSeatId = try container.decodeIfPresent(Int.self, forKey: .toSeatId)
        assignedSeatId = try container.decodeIfPresent(Int.self, forKey: .assignedSeatId)
        assignedSeatLabel = try container.decodeIfPresent(String.self, forKey: .assignedSeatLabel)
        ticketsLeft = try container.decodeIfPresent(Int.self, forKey: .ticketsLeft)
        saleStatus = try container.decodeIfPresent(String.self, forKey: .saleStatus)
        expectedPriceDifference = try container.decodeIfPresent(Double.self, forKey: .expectedPriceDifference)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if direction != nil { try container.encode(direction, forKey: .direction) }
        if priceDifference != nil { try container.encode(priceDifference, forKey: .priceDifference) }
        if sourceTicketPrice != nil { try container.encode(sourceTicketPrice, forKey: .sourceTicketPrice) }
        if targetTicketPrice != nil { try container.encode(targetTicketPrice, forKey: .targetTicketPrice) }
        if sourceEventId != nil { try container.encode(sourceEventId, forKey: .sourceEventId) }
        if sourceEventName != nil { try container.encode(sourceEventName, forKey: .sourceEventName) }
        if sourceEventTimeOfEvent != nil { try container.encode(sourceEventTimeOfEvent, forKey: .sourceEventTimeOfEvent) }
        if toEventId != nil { try container.encode(toEventId, forKey: .toEventId) }
        if toEventName != nil { try container.encode(toEventName, forKey: .toEventName) }
        if toEventTimeOfEvent != nil { try container.encode(toEventTimeOfEvent, forKey: .toEventTimeOfEvent) }
        if toTicketTypeName != nil { try container.encode(toTicketTypeName, forKey: .toTicketTypeName) }
        if targetIsSeated != nil { try container.encode(targetIsSeated, forKey: .targetIsSeated) }
        if toSeatId != nil { try container.encode(toSeatId, forKey: .toSeatId) }
        if assignedSeatId != nil { try container.encode(assignedSeatId, forKey: .assignedSeatId) }
        if assignedSeatLabel != nil { try container.encode(assignedSeatLabel, forKey: .assignedSeatLabel) }
        if ticketsLeft != nil { try container.encode(ticketsLeft, forKey: .ticketsLeft) }
        if saleStatus != nil { try container.encode(saleStatus, forKey: .saleStatus) }
        if expectedPriceDifference != nil { try container.encode(expectedPriceDifference, forKey: .expectedPriceDifference) }
    }
}

public class SelfServiceTransferResultBase : Codable
{
    public var ok:Bool?
    public var statusCode:Int?
    public var code:String?
    public var message:String?

    required public init(){}
}


Swift SelfServiceTransferQuoteRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /selfService/transferTicket/quote HTTP/1.1 
Host: stubbur-app.azurewebsites.net 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	ticketTokenId: String,
	buyerPhone: String,
	toEventId: 0,
	toOwnerTicketTypeId: 0,
	toSeriesTicketTypeId: 0,
	toSeatId: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	direction: String,
	priceDifference: 0,
	sourceTicketPrice: 0,
	targetTicketPrice: 0,
	sourceEventId: 0,
	sourceEventName: String,
	sourceEventTimeOfEvent: 0001-01-01,
	toEventId: 0,
	toEventName: String,
	toEventTimeOfEvent: 0001-01-01,
	toTicketTypeName: String,
	targetIsSeated: False,
	toSeatId: 0,
	assignedSeatId: 0,
	assignedSeatLabel: String,
	ticketsLeft: 0,
	saleStatus: String,
	expectedPriceDifference: 0,
	ok: False,
	statusCode: 0,
	code: String,
	message: String
}