TicketUserServices

<back to all web services

OwnerCardsUpgradeCandidatesRequest

Requires Authentication
Requires any of the roles:Admin, TeamAdminRequires the permission:ReadData
The following routes are available for this service:
POST/OrderOwnerCards/upgrade/candidatesLive owner cards of a verified phone and the card types each may be upgraded to (rules U1-U10)
import Foundation
import ServiceStack

public class OwnerCardsUpgradeCandidatesRequest : Codable
{
    public var buyerPhone:String?
    public var sourceOwnerCardId:Int?

    required public init(){}
}

public class OwnerCardsUpgradeCandidatesResult : OwnerCardUpgradeResultBase
{
    public var enabled:Bool?
    public var cards:[OwnerCardUpgradeSource] = []

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

    private enum CodingKeys : String, CodingKey {
        case enabled
        case cards
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        enabled = try container.decodeIfPresent(Bool.self, forKey: .enabled)
        cards = try container.decodeIfPresent([OwnerCardUpgradeSource].self, forKey: .cards) ?? []
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if enabled != nil { try container.encode(enabled, forKey: .enabled) }
        if cards.count > 0 { try container.encode(cards, forKey: .cards) }
    }
}

public class OwnerCardUpgradeResultBase : Codable
{
    public var statusCode:Int?
    public var message:String?
    public var reason:String?

    required public init(){}
}

public class OwnerCardUpgradeSource : Codable
{
    public var sourceOwnerCardId:Int?
    public var ownerId:Int?
    public var ownerCardTypeId:Int?
    public var typeName:String?
    public var pricePaid:Int?
    public var cardPrice:Int?
    public var cardValidFromUTC:Date?
    public var cardValidToUTC:Date?
    public var paymentStatus:String?
    public var eligible:Bool?
    public var reasonCode:Int?
    public var reason:String?
    public var candidates:[OwnerCardUpgradeTarget] = []

    required public init(){}
}

public class OwnerCardUpgradeTarget : Codable
{
    public var ownerCardTypeId:Int?
    public var name:String?
    public var Description:String?
    public var imageUrl:String?
    public var price:Int?
    public var delta:Int?
    public var validFromUTC:Date?
    public var validToUTC:Date?

    required public init(){}
}


Swift OwnerCardsUpgradeCandidatesRequest DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

POST /OrderOwnerCards/upgrade/candidates HTTP/1.1 
Host: stubbur-app.azurewebsites.net 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"buyerPhone":"String","sourceOwnerCardId":0}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"enabled":false,"cards":[{"sourceOwnerCardId":0,"ownerId":0,"ownerCardTypeId":0,"typeName":"String","pricePaid":0,"cardPrice":0,"cardValidFromUTC":"0001-01-01T00:00:00.0000000","cardValidToUTC":"0001-01-01T00:00:00.0000000","paymentStatus":"String","eligible":false,"reasonCode":0,"reason":"String","candidates":[{"ownerCardTypeId":0,"name":"String","description":"String","imageUrl":"String","price":0,"delta":0,"validFromUTC":"0001-01-01T00:00:00.0000000","validToUTC":"0001-01-01T00:00:00.0000000"}]}],"statusCode":0,"message":"String","reason":"String"}