POST | /v1/pricingdetails | Creates a detailed pricing of a vehicle |
---|
import 'package:servicestack/servicestack.dart';
enum Source
{
OnlineShowroom,
OneAdmin,
}
class Address implements IConvertible
{
String? Property;
String? Street;
String? Town;
String? County;
String? Locality;
String? Postcode;
Address({this.Property,this.Street,this.Town,this.County,this.Locality,this.Postcode});
Address.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Property = json['Property'];
Street = json['Street'];
Town = json['Town'];
County = json['County'];
Locality = json['Locality'];
Postcode = json['Postcode'];
return this;
}
Map<String, dynamic> toJson() => {
'Property': Property,
'Street': Street,
'Town': Town,
'County': County,
'Locality': Locality,
'Postcode': Postcode
};
getTypeName() => "Address";
TypeContext? context = _ctx;
}
enum CustomerMode
{
Private,
Business,
Motability,
}
class SalesforceCustomer implements ICustomer, IConvertible
{
String? CustomerId;
bool? IsCiam;
String? CompanyName;
String? Title;
String? Firstname;
String? Surname;
String? EmailAddress;
String? Telephone;
Address? Address;
CustomerMode? Mode;
SalesforceCustomer({this.CustomerId,this.IsCiam,this.CompanyName,this.Title,this.Firstname,this.Surname,this.EmailAddress,this.Telephone,this.Address,this.Mode});
SalesforceCustomer.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
CustomerId = json['CustomerId'];
IsCiam = json['IsCiam'];
CompanyName = json['CompanyName'];
Title = json['Title'];
Firstname = json['Firstname'];
Surname = json['Surname'];
EmailAddress = json['EmailAddress'];
Telephone = json['Telephone'];
Address = JsonConverters.fromJson(json['Address'],'Address',context!);
Mode = JsonConverters.fromJson(json['Mode'],'CustomerMode',context!);
return this;
}
Map<String, dynamic> toJson() => {
'CustomerId': CustomerId,
'IsCiam': IsCiam,
'CompanyName': CompanyName,
'Title': Title,
'Firstname': Firstname,
'Surname': Surname,
'EmailAddress': EmailAddress,
'Telephone': Telephone,
'Address': JsonConverters.toJson(Address,'Address',context!),
'Mode': JsonConverters.toJson(Mode,'CustomerMode',context!)
};
getTypeName() => "SalesforceCustomer";
TypeContext? context = _ctx;
}
class Preferences implements IConvertible
{
bool? OptinEmail;
bool? OptinPost;
bool? OptinSMS;
bool? OptinTelephone;
Preferences({this.OptinEmail,this.OptinPost,this.OptinSMS,this.OptinTelephone});
Preferences.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
OptinEmail = json['OptinEmail'];
OptinPost = json['OptinPost'];
OptinSMS = json['OptinSMS'];
OptinTelephone = json['OptinTelephone'];
return this;
}
Map<String, dynamic> toJson() => {
'OptinEmail': OptinEmail,
'OptinPost': OptinPost,
'OptinSMS': OptinSMS,
'OptinTelephone': OptinTelephone
};
getTypeName() => "Preferences";
TypeContext? context = _ctx;
}
class Customer extends SalesforceCustomer implements IConvertible
{
String? ProfileId;
Preferences? Preferences;
Customer({this.ProfileId,this.Preferences});
Customer.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
ProfileId = json['ProfileId'];
Preferences = JsonConverters.fromJson(json['Preferences'],'Preferences',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'ProfileId': ProfileId,
'Preferences': JsonConverters.toJson(Preferences,'Preferences',context!)
});
getTypeName() => "Customer";
TypeContext? context = _ctx;
}
class Vehicle implements IConvertible
{
String? Vin;
Vehicle({this.Vin});
Vehicle.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Vin = json['Vin'];
return this;
}
Map<String, dynamic> toJson() => {
'Vin': Vin
};
getTypeName() => "Vehicle";
TypeContext? context = _ctx;
}
class Option implements IConvertible
{
bool? IsDefault;
int? Value;
Option({this.IsDefault,this.Value});
Option.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
IsDefault = json['IsDefault'];
Value = json['Value'];
return this;
}
Map<String, dynamic> toJson() => {
'IsDefault': IsDefault,
'Value': Value
};
getTypeName() => "Option";
TypeContext? context = _ctx;
}
class Term implements IConvertible
{
List<Option>? Options = [];
Term({this.Options});
Term.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Options = JsonConverters.fromJson(json['Options'],'List<Option>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Options': JsonConverters.toJson(Options,'List<Option>',context!)
};
getTypeName() => "Term";
TypeContext? context = _ctx;
}
class Deposit implements IConvertible
{
String? Default;
Deposit({this.Default});
Deposit.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Default = json['Default'];
return this;
}
Map<String, dynamic> toJson() => {
'Default': Default
};
getTypeName() => "Deposit";
TypeContext? context = _ctx;
}
class Mileage implements IConvertible
{
List<Option>? Options = [];
Mileage({this.Options});
Mileage.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Options = JsonConverters.fromJson(json['Options'],'List<Option>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Options': JsonConverters.toJson(Options,'List<Option>',context!)
};
getTypeName() => "Mileage";
TypeContext? context = _ctx;
}
class AdvanceRentals implements IConvertible
{
List<Option>? Options = [];
AdvanceRentals({this.Options});
AdvanceRentals.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Options = JsonConverters.fromJson(json['Options'],'List<Option>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Options': JsonConverters.toJson(Options,'List<Option>',context!)
};
getTypeName() => "AdvanceRentals";
TypeContext? context = _ctx;
}
enum VehicleType
{
UNASSIGNED,
NEW,
USED,
}
class FinanceCriteria implements IConvertible
{
String? Key;
String? Name;
String? Type;
bool? IsDefault;
Term? Term;
Deposit? Deposit;
Mileage? Mileage;
AdvanceRentals? AdvanceRentals;
bool? IsPersonalised;
String? RegularPayment;
String? PartExchange;
String? Settlement;
String? CustomerType;
VehicleType? VehicleType;
FinanceCriteria({this.Key,this.Name,this.Type,this.IsDefault,this.Term,this.Deposit,this.Mileage,this.AdvanceRentals,this.IsPersonalised,this.RegularPayment,this.PartExchange,this.Settlement,this.CustomerType,this.VehicleType});
FinanceCriteria.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Key = json['Key'];
Name = json['Name'];
Type = json['Type'];
IsDefault = json['IsDefault'];
Term = JsonConverters.fromJson(json['Term'],'Term',context!);
Deposit = JsonConverters.fromJson(json['Deposit'],'Deposit',context!);
Mileage = JsonConverters.fromJson(json['Mileage'],'Mileage',context!);
AdvanceRentals = JsonConverters.fromJson(json['AdvanceRentals'],'AdvanceRentals',context!);
IsPersonalised = json['IsPersonalised'];
RegularPayment = json['RegularPayment'];
PartExchange = json['PartExchange'];
Settlement = json['Settlement'];
CustomerType = json['CustomerType'];
VehicleType = JsonConverters.fromJson(json['VehicleType'],'VehicleType',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Key': Key,
'Name': Name,
'Type': Type,
'IsDefault': IsDefault,
'Term': JsonConverters.toJson(Term,'Term',context!),
'Deposit': JsonConverters.toJson(Deposit,'Deposit',context!),
'Mileage': JsonConverters.toJson(Mileage,'Mileage',context!),
'AdvanceRentals': JsonConverters.toJson(AdvanceRentals,'AdvanceRentals',context!),
'IsPersonalised': IsPersonalised,
'RegularPayment': RegularPayment,
'PartExchange': PartExchange,
'Settlement': Settlement,
'CustomerType': CustomerType,
'VehicleType': JsonConverters.toJson(VehicleType,'VehicleType',context!)
};
getTypeName() => "FinanceCriteria";
TypeContext? context = _ctx;
}
class OutrightPurchase implements IConvertible
{
bool? IsOutrightPurchase;
String? Reference;
double? DiscountRate;
String? Bm7NST;
bool? IsBackOrder;
bool? IsCOPConverter;
OutrightPurchase({this.IsOutrightPurchase,this.Reference,this.DiscountRate,this.Bm7NST,this.IsBackOrder,this.IsCOPConverter});
OutrightPurchase.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
IsOutrightPurchase = json['IsOutrightPurchase'];
Reference = json['Reference'];
DiscountRate = JsonConverters.toDouble(json['DiscountRate']);
Bm7NST = json['Bm7NST'];
IsBackOrder = json['IsBackOrder'];
IsCOPConverter = json['IsCOPConverter'];
return this;
}
Map<String, dynamic> toJson() => {
'IsOutrightPurchase': IsOutrightPurchase,
'Reference': Reference,
'DiscountRate': DiscountRate,
'Bm7NST': Bm7NST,
'IsBackOrder': IsBackOrder,
'IsCOPConverter': IsCOPConverter
};
getTypeName() => "OutrightPurchase";
TypeContext? context = _ctx;
}
enum MotabilityType
{
PIP,
WPMS,
UNASSIGNED,
}
class CreateOrderBase implements IConvertible
{
Source? Source;
String? GssnId;
String? AdditionalInformation;
bool? Cash;
bool? Finance;
Customer? Customer;
Vehicle? Vehicle;
FinanceCriteria? FinanceCriteria;
String? BackOrderGuid;
String? TagUrl;
OutrightPurchase? OutrightPurchase;
bool? Motability;
int? MotabilityPricingId;
String? FinanceApplicationReference;
bool? Specialist;
String? GasId;
List<int>? PersonalisedItemOfferIds;
String? SuggestedVin;
String? NonOptimumReason;
MotabilityType? MotabilityType;
String? EstimatedHandoverDate;
CreateOrderBase({this.Source,this.GssnId,this.AdditionalInformation,this.Cash,this.Finance,this.Customer,this.Vehicle,this.FinanceCriteria,this.BackOrderGuid,this.TagUrl,this.OutrightPurchase,this.Motability,this.MotabilityPricingId,this.FinanceApplicationReference,this.Specialist,this.GasId,this.PersonalisedItemOfferIds,this.SuggestedVin,this.NonOptimumReason,this.MotabilityType,this.EstimatedHandoverDate});
CreateOrderBase.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Source = JsonConverters.fromJson(json['Source'],'Source',context!);
GssnId = json['GssnId'];
AdditionalInformation = json['AdditionalInformation'];
Cash = json['Cash'];
Finance = json['Finance'];
Customer = JsonConverters.fromJson(json['Customer'],'Customer',context!);
Vehicle = JsonConverters.fromJson(json['Vehicle'],'Vehicle',context!);
FinanceCriteria = JsonConverters.fromJson(json['FinanceCriteria'],'FinanceCriteria',context!);
BackOrderGuid = json['BackOrderGuid'];
TagUrl = json['TagUrl'];
OutrightPurchase = JsonConverters.fromJson(json['OutrightPurchase'],'OutrightPurchase',context!);
Motability = json['Motability'];
MotabilityPricingId = json['MotabilityPricingId'];
FinanceApplicationReference = json['FinanceApplicationReference'];
Specialist = json['Specialist'];
GasId = json['GasId'];
PersonalisedItemOfferIds = JsonConverters.fromJson(json['PersonalisedItemOfferIds'],'List<int>',context!);
SuggestedVin = json['SuggestedVin'];
NonOptimumReason = json['NonOptimumReason'];
MotabilityType = JsonConverters.fromJson(json['MotabilityType'],'MotabilityType',context!);
EstimatedHandoverDate = json['EstimatedHandoverDate'];
return this;
}
Map<String, dynamic> toJson() => {
'Source': JsonConverters.toJson(Source,'Source',context!),
'GssnId': GssnId,
'AdditionalInformation': AdditionalInformation,
'Cash': Cash,
'Finance': Finance,
'Customer': JsonConverters.toJson(Customer,'Customer',context!),
'Vehicle': JsonConverters.toJson(Vehicle,'Vehicle',context!),
'FinanceCriteria': JsonConverters.toJson(FinanceCriteria,'FinanceCriteria',context!),
'BackOrderGuid': BackOrderGuid,
'TagUrl': TagUrl,
'OutrightPurchase': JsonConverters.toJson(OutrightPurchase,'OutrightPurchase',context!),
'Motability': Motability,
'MotabilityPricingId': MotabilityPricingId,
'FinanceApplicationReference': FinanceApplicationReference,
'Specialist': Specialist,
'GasId': GasId,
'PersonalisedItemOfferIds': JsonConverters.toJson(PersonalisedItemOfferIds,'List<int>',context!),
'SuggestedVin': SuggestedVin,
'NonOptimumReason': NonOptimumReason,
'MotabilityType': JsonConverters.toJson(MotabilityType,'MotabilityType',context!),
'EstimatedHandoverDate': EstimatedHandoverDate
};
getTypeName() => "CreateOrderBase";
TypeContext? context = _ctx;
}
enum OfferPriceProductType
{
LIST_PRICE,
NUMBER_PLATE_FEE,
DELIVERY_CHARGE,
FUEL_CHARGE,
MANUFACTURER_OFFER,
PERSONALISED_MONEYOFFER,
PERSONALISED_NONMONEYOFFER,
PERSONALISED_NONMONEYOFFER_NEG,
SERVICE,
SERVICE_NEG,
GOVERNMENT_GRANT,
OUTRIGHT_PURCHASE_DISCOUNT,
VIP_OFFER,
WALLBOX_OFFER,
WALLBOX_OFFER_NEG,
ROAD_FUND_LICENCE,
FIRST_REGISTRATION_FEE,
NOT_FOUND,
ACCESSORY_OFFER,
ACCESSORY_OFFER_NEG,
MOTABILITY_DISCOUNT,
}
class Price implements IConvertible
{
String? Id;
String? Description;
double? Net;
double? VAT;
double? Gross;
OfferPriceProductType? Product;
Price({this.Id,this.Description,this.Net,this.VAT,this.Gross,this.Product});
Price.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Id = json['Id'];
Description = json['Description'];
Net = JsonConverters.toDouble(json['Net']);
VAT = JsonConverters.toDouble(json['VAT']);
Gross = JsonConverters.toDouble(json['Gross']);
Product = JsonConverters.fromJson(json['Product'],'OfferPriceProductType',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Id': Id,
'Description': Description,
'Net': Net,
'VAT': VAT,
'Gross': Gross,
'Product': JsonConverters.toJson(Product,'OfferPriceProductType',context!)
};
getTypeName() => "Price";
TypeContext? context = _ctx;
}
class GetPricingDetailsResponse implements IConvertible
{
Price? Price;
GetPricingDetailsResponse({this.Price});
GetPricingDetailsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Price = JsonConverters.fromJson(json['Price'],'Price',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Price': JsonConverters.toJson(Price,'Price',context!)
};
getTypeName() => "GetPricingDetailsResponse";
TypeContext? context = _ctx;
}
class GetPricingDetailsRequest extends CreateOrderBase implements IPost, IConvertible
{
GetPricingDetailsRequest();
GetPricingDetailsRequest.fromJson(Map<String, dynamic> json) : super.fromJson(json);
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
return this;
}
Map<String, dynamic> toJson() => super.toJson();
getTypeName() => "GetPricingDetailsRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'prod_api_agency_orch_mb_dhc.rapp_customers.co.uk', types: <String, TypeInfo> {
'Source': TypeInfo(TypeOf.Enum, enumValues:Source.values),
'Address': TypeInfo(TypeOf.Class, create:() => Address()),
'CustomerMode': TypeInfo(TypeOf.Enum, enumValues:CustomerMode.values),
'SalesforceCustomer': TypeInfo(TypeOf.Class, create:() => SalesforceCustomer()),
'Preferences': TypeInfo(TypeOf.Class, create:() => Preferences()),
'Customer': TypeInfo(TypeOf.Class, create:() => Customer()),
'Vehicle': TypeInfo(TypeOf.Class, create:() => Vehicle()),
'Option': TypeInfo(TypeOf.Class, create:() => Option()),
'Term': TypeInfo(TypeOf.Class, create:() => Term()),
'List<Option>': TypeInfo(TypeOf.Class, create:() => <Option>[]),
'Deposit': TypeInfo(TypeOf.Class, create:() => Deposit()),
'Mileage': TypeInfo(TypeOf.Class, create:() => Mileage()),
'AdvanceRentals': TypeInfo(TypeOf.Class, create:() => AdvanceRentals()),
'VehicleType': TypeInfo(TypeOf.Enum, enumValues:VehicleType.values),
'FinanceCriteria': TypeInfo(TypeOf.Class, create:() => FinanceCriteria()),
'OutrightPurchase': TypeInfo(TypeOf.Class, create:() => OutrightPurchase()),
'MotabilityType': TypeInfo(TypeOf.Enum, enumValues:MotabilityType.values),
'CreateOrderBase': TypeInfo(TypeOf.Class, create:() => CreateOrderBase()),
'OfferPriceProductType': TypeInfo(TypeOf.Enum, enumValues:OfferPriceProductType.values),
'Price': TypeInfo(TypeOf.Class, create:() => Price()),
'GetPricingDetailsResponse': TypeInfo(TypeOf.Class, create:() => GetPricingDetailsResponse()),
'GetPricingDetailsRequest': TypeInfo(TypeOf.Class, create:() => GetPricingDetailsRequest()),
});
Dart GetPricingDetailsRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
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/jsonl
Content-Type: text/jsonl
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/jsonl Content-Length: length {"Price":{"Id":"String","Description":"String","Net":0,"VAT":0,"Gross":0,"Product":"LIST_PRICE"}}