TicketUserServices

<back to all web services

SelfServiceTransferTargetEventsRequest

Requires Authentication
The following routes are available for this service:
POST/selfService/transferTicket/targetEventsEvents a buyer may exchange their ticket onto (same series, same owner, still upcoming, source event included)
import Foundation
import ServiceStack

public class SelfServiceTransferTargetEventsRequest : Codable
{
    public var ticketTokenId:String?
    public var buyerPhone:String?

    required public init(){}
}

public class SelfServiceTransferTargetEventsResult : SelfServiceTransferResultBase
{
    public var eventSeriesId:Int?
    public var sourceEventId:Int?
    public var sourceEventName:String?
    public var sourceEventTimeOfEvent:Date?
    public var sourceTicketPrice:Double?
    public var sourceTicketTypeName:String?
    public var events:[SelfServiceTargetEvent] = []

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

    private enum CodingKeys : String, CodingKey {
        case eventSeriesId
        case sourceEventId
        case sourceEventName
        case sourceEventTimeOfEvent
        case sourceTicketPrice
        case sourceTicketTypeName
        case events
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        eventSeriesId = try container.decodeIfPresent(Int.self, forKey: .eventSeriesId)
        sourceEventId = try container.decodeIfPresent(Int.self, forKey: .sourceEventId)
        sourceEventName = try container.decodeIfPresent(String.self, forKey: .sourceEventName)
        sourceEventTimeOfEvent = try container.decodeIfPresent(Date.self, forKey: .sourceEventTimeOfEvent)
        sourceTicketPrice = try container.decodeIfPresent(Double.self, forKey: .sourceTicketPrice)
        sourceTicketTypeName = try container.decodeIfPresent(String.self, forKey: .sourceTicketTypeName)
        events = try container.decodeIfPresent([SelfServiceTargetEvent].self, forKey: .events) ?? []
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if eventSeriesId != nil { try container.encode(eventSeriesId, forKey: .eventSeriesId) }
        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 sourceTicketPrice != nil { try container.encode(sourceTicketPrice, forKey: .sourceTicketPrice) }
        if sourceTicketTypeName != nil { try container.encode(sourceTicketTypeName, forKey: .sourceTicketTypeName) }
        if events.count > 0 { try container.encode(events, forKey: .events) }
    }
}

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 SelfServiceTargetEvent : Codable
{
    public var eventId:Int?
    public var eventName:String?
    public var timeOfEvent:Date?
    public var isSeated:Bool?
    public var isSourceEvent:Bool?
    public var saleNotOpenYet:Bool?
    public var ticketSaleStartsUTC:Date?

    required public init(){}
}


Swift SelfServiceTransferTargetEventsRequest 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 /selfService/transferTicket/targetEvents HTTP/1.1 
Host: stubbur-app.azurewebsites.net 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<SelfServiceTransferTargetEventsRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceModel">
  <BuyerPhone>String</BuyerPhone>
  <TicketTokenId>String</TicketTokenId>
</SelfServiceTransferTargetEventsRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<SelfServiceTransferTargetEventsResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceModel">
  <Code>String</Code>
  <Message>String</Message>
  <Ok>false</Ok>
  <StatusCode>0</StatusCode>
  <EventSeriesId>0</EventSeriesId>
  <Events>
    <SelfServiceTargetEvent>
      <EventId>0</EventId>
      <EventName>String</EventName>
      <IsSeated>false</IsSeated>
      <IsSourceEvent>false</IsSourceEvent>
      <SaleNotOpenYet>false</SaleNotOpenYet>
      <TicketSaleStartsUTC>0001-01-01T00:00:00</TicketSaleStartsUTC>
      <TimeOfEvent>0001-01-01T00:00:00</TimeOfEvent>
    </SelfServiceTargetEvent>
  </Events>
  <SourceEventId>0</SourceEventId>
  <SourceEventName>String</SourceEventName>
  <SourceEventTimeOfEvent>0001-01-01T00:00:00</SourceEventTimeOfEvent>
  <SourceTicketPrice>0</SourceTicketPrice>
  <SourceTicketTypeName>String</SourceTicketTypeName>
</SelfServiceTransferTargetEventsResult>