POST | /v1/pricingdetails | Creates a detailed pricing of a vehicle |
---|
import Foundation
import ServiceStack
public class GetPricingDetailsRequest : CreateOrderBase, IPost
{
required public init(){ super.init() }
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
}
}
public class CreateOrderBase : Codable
{
public var source:Source
public var gssnId:String
public var additionalInformation:String
public var cash:Bool
public var finance:Bool
public var customer:Customer
public var vehicle:Vehicle
public var financeCriteria:FinanceCriteria
public var backOrderGuid:String?
public var tagUrl:String
public var outrightPurchase:OutrightPurchase
public var motability:Bool
public var motabilityPricingId:Int?
public var financeApplicationReference:String
public var specialist:Bool
public var gasId:String
public var personalisedItemOfferIds:[Int]
public var suggestedVin:String
public var nonOptimumReason:String
public var motabilityType:MotabilityType
public var estimatedHandoverDate:String
required public init(){}
}
public enum Source : Int, Codable
{
case OnlineShowroom = 1
case OneAdmin = 2
}
public class Customer : SalesforceCustomer
{
public var profileId:String?
public var preferences:Preferences
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case profileId
case preferences
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
profileId = try container.decodeIfPresent(String.self, forKey: .profileId)
preferences = try container.decodeIfPresent(Preferences.self, forKey: .preferences)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if profileId != nil { try container.encode(profileId, forKey: .profileId) }
if preferences != nil { try container.encode(preferences, forKey: .preferences) }
}
}
public class SalesforceCustomer : ICustomer, Codable
{
public var customerId:String
public var isCiam:Bool
public var companyName:String
public var title:String
public var firstname:String
public var surname:String
public var emailAddress:String
public var telephone:String
public var address:Address
public var mode:CustomerMode
required public init(){}
}
public class Address : Codable
{
public var property:String
public var street:String
public var town:String
public var county:String
public var locality:String
public var postcode:String
required public init(){}
}
public enum CustomerMode : Int, Codable
{
case Private = 1
case Business = 2
case Motability = 3
}
public class Preferences : Codable
{
public var optinEmail:Bool
public var optinPost:Bool
public var optinSMS:Bool
public var optinTelephone:Bool
required public init(){}
}
public class Vehicle : Codable
{
public var vin:String
required public init(){}
}
public class FinanceCriteria : Codable
{
public var key:String
public var name:String
public var type:String
public var isDefault:Bool
public var term:Term
public var deposit:Deposit
public var mileage:Mileage
public var advanceRentals:AdvanceRentals
public var isPersonalised:Bool
public var regularPayment:String
public var partExchange:String
public var settlement:String
public var customerType:String
public var vehicleType:VehicleType
required public init(){}
}
public class Term : Codable
{
public var options:[Option] = []
required public init(){}
}
public class Option : Codable
{
public var isDefault:Bool
public var value:Int
required public init(){}
}
public class Deposit : Codable
{
public var `default`:String
required public init(){}
}
public class Mileage : Codable
{
public var options:[Option] = []
required public init(){}
}
public class AdvanceRentals : Codable
{
public var options:[Option] = []
required public init(){}
}
public enum VehicleType : String, Codable
{
case UNASSIGNED
case NEW
case USED
}
public class OutrightPurchase : Codable
{
public var isOutrightPurchase:Bool
public var reference:String
public var discountRate:Double
public var bm7NST:String
public var isBackOrder:Bool
public var isCOPConverter:Bool
required public init(){}
}
public enum MotabilityType : Int, Codable
{
case PIP = 1
case WPMS = 2
case UNASSIGNED = 3
}
public class GetPricingDetailsResponse : Codable
{
public var price:Price
required public init(){}
}
public class Price : Codable
{
public var id:String
public var Description:String
public var net:Double
public var vat:Double
public var gross:Double
public var product:OfferPriceProductType
required public init(){}
}
public enum OfferPriceProductType : String, Codable
{
case LIST_PRICE
case NUMBER_PLATE_FEE
case DELIVERY_CHARGE
case FUEL_CHARGE
case MANUFACTURER_OFFER
case PERSONALISED_MONEYOFFER
case PERSONALISED_NONMONEYOFFER
case PERSONALISED_NONMONEYOFFER_NEG
case SERVICE
case SERVICE_NEG
case GOVERNMENT_GRANT
case OUTRIGHT_PURCHASE_DISCOUNT
case VIP_OFFER
case WALLBOX_OFFER
case WALLBOX_OFFER_NEG
case ROAD_FUND_LICENCE
case FIRST_REGISTRATION_FEE
case NOT_FOUND
case ACCESSORY_OFFER
case ACCESSORY_OFFER_NEG
case MOTABILITY_DISCOUNT
}
Swift GetPricingDetailsRequest 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 /v1/pricingdetails HTTP/1.1
Host: prod-api-agency-orch-mb-dhc.rapp-customers.co.uk
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
Source: OnlineShowroom,
GssnId: String,
AdditionalInformation: String,
Cash: False,
Finance: False,
Customer:
{
ProfileId: 00000000000000000000000000000000,
Preferences:
{
OptinEmail: False,
OptinPost: False,
OptinSMS: False,
OptinTelephone: False
},
CustomerId: String,
IsCiam: False,
CompanyName: String,
Title: String,
Firstname: String,
Surname: String,
EmailAddress: String,
Telephone: String,
Address:
{
Property: String,
Street: String,
Town: String,
County: String,
Locality: String,
Postcode: String
},
Mode: Private
},
Vehicle:
{
Vin: String
},
FinanceCriteria:
{
Key: String,
Name: String,
Type: String,
IsDefault: False,
Term:
{
Options:
[
{
IsDefault: False,
Value: 0
}
]
},
Deposit:
{
Default: String
},
Mileage:
{
Options:
[
{
IsDefault: False,
Value: 0
}
]
},
AdvanceRentals:
{
Options:
[
{
IsDefault: False,
Value: 0
}
]
},
IsPersonalised: False,
RegularPayment: String,
PartExchange: String,
Settlement: String,
CustomerType: String,
VehicleType: UNASSIGNED
},
BackOrderGuid: 00000000000000000000000000000000,
TagUrl: String,
OutrightPurchase:
{
IsOutrightPurchase: False,
Reference: String,
DiscountRate: 0,
Bm7NST: String,
IsBackOrder: False,
IsCOPConverter: False
},
Motability: False,
MotabilityPricingId: 0,
FinanceApplicationReference: String,
Specialist: False,
GasId: String,
PersonalisedItemOfferIds:
[
0
],
SuggestedVin: String,
NonOptimumReason: String,
MotabilityType: PIP,
EstimatedHandoverDate: String
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { Price: { Id: String, Description: String, Net: 0, VAT: 0, Gross: 0, Product: LIST_PRICE } }