| Requires any of the roles: | Admin, TeamAdmin | Requires the permission: | ReadData |
| POST | /OrderOwnerCards/upgrade/candidates | Live 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 .xml suffix or ?format=xml
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/xml
Content-Type: application/xml
Content-Length: length
<OwnerCardsUpgradeCandidatesRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceModel">
<BuyerPhone>String</BuyerPhone>
<SourceOwnerCardId>0</SourceOwnerCardId>
</OwnerCardsUpgradeCandidatesRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<OwnerCardsUpgradeCandidatesResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceModel">
<Message>String</Message>
<Reason>String</Reason>
<StatusCode>0</StatusCode>
<Cards>
<OwnerCardUpgradeSource>
<Candidates>
<OwnerCardUpgradeTarget>
<Delta>0</Delta>
<Description>String</Description>
<ImageUrl>String</ImageUrl>
<Name>String</Name>
<OwnerCardTypeId>0</OwnerCardTypeId>
<Price>0</Price>
<ValidFromUTC>0001-01-01T00:00:00</ValidFromUTC>
<ValidToUTC>0001-01-01T00:00:00</ValidToUTC>
</OwnerCardUpgradeTarget>
</Candidates>
<CardPrice>0</CardPrice>
<CardValidFromUTC>0001-01-01T00:00:00</CardValidFromUTC>
<CardValidToUTC>0001-01-01T00:00:00</CardValidToUTC>
<Eligible>false</Eligible>
<OwnerCardTypeId>0</OwnerCardTypeId>
<OwnerId>0</OwnerId>
<PaymentStatus>String</PaymentStatus>
<PricePaid>0</PricePaid>
<Reason>String</Reason>
<ReasonCode>0</ReasonCode>
<SourceOwnerCardId>0</SourceOwnerCardId>
<TypeName>String</TypeName>
</OwnerCardUpgradeSource>
</Cards>
<Enabled>false</Enabled>
</OwnerCardsUpgradeCandidatesResult>