POST | /v1/backorder | Create Back Order (Online Showroom) |
---|
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 JsonVersion implements IJsonVersion, IConvertible
{
int? Version;
JsonVersion({this.Version});
JsonVersion.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Version = json['Version'];
return this;
}
Map<String, dynamic> toJson() => {
'Version': Version
};
getTypeName() => "JsonVersion";
TypeContext? context = _ctx;
}
class CriteriaModel implements IConvertible
{
String? Description;
int? Id;
CriteriaModel({this.Description,this.Id});
CriteriaModel.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Description = json['Description'];
Id = json['Id'];
return this;
}
Map<String, dynamic> toJson() => {
'Description': Description,
'Id': Id
};
getTypeName() => "CriteriaModel";
TypeContext? context = _ctx;
}
class CriteriaDifference implements IConvertible
{
bool? Model;
bool? Transmission;
bool? Fuel;
bool? Upholstery;
bool? Equipment;
bool? Line;
bool? BodyStyle;
bool? ColourGroup;
bool? Packages;
bool? Engine;
bool? AdditionalInformation;
bool? UrlReferrer;
bool? PreferredDeliveryDate;
bool? IsSmart;
bool? IsSpecialised;
CriteriaDifference({this.Model,this.Transmission,this.Fuel,this.Upholstery,this.Equipment,this.Line,this.BodyStyle,this.ColourGroup,this.Packages,this.Engine,this.AdditionalInformation,this.UrlReferrer,this.PreferredDeliveryDate,this.IsSmart,this.IsSpecialised});
CriteriaDifference.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Model = json['Model'];
Transmission = json['Transmission'];
Fuel = json['Fuel'];
Upholstery = json['Upholstery'];
Equipment = json['Equipment'];
Line = json['Line'];
BodyStyle = json['BodyStyle'];
ColourGroup = json['ColourGroup'];
Packages = json['Packages'];
Engine = json['Engine'];
AdditionalInformation = json['AdditionalInformation'];
UrlReferrer = json['UrlReferrer'];
PreferredDeliveryDate = json['PreferredDeliveryDate'];
IsSmart = json['IsSmart'];
IsSpecialised = json['IsSpecialised'];
return this;
}
Map<String, dynamic> toJson() => {
'Model': Model,
'Transmission': Transmission,
'Fuel': Fuel,
'Upholstery': Upholstery,
'Equipment': Equipment,
'Line': Line,
'BodyStyle': BodyStyle,
'ColourGroup': ColourGroup,
'Packages': Packages,
'Engine': Engine,
'AdditionalInformation': AdditionalInformation,
'UrlReferrer': UrlReferrer,
'PreferredDeliveryDate': PreferredDeliveryDate,
'IsSmart': IsSmart,
'IsSpecialised': IsSpecialised
};
getTypeName() => "CriteriaDifference";
TypeContext? context = _ctx;
}
class CriteriaBase extends JsonVersion implements IConvertible
{
List<String>? Transmission = [];
List<String>? Fuel = [];
List<String>? Upholstery = [];
List<String>? Equipment = [];
List<String>? Line = [];
List<String>? BodyStyle = [];
List<String>? ColourGroup = [];
List<String>? Packages = [];
List<CriteriaModel>? Model = [];
String? UrlReferrer;
String? PreferredDeliveryDate;
// @ApiMember(ExcludeInSchema=true)
bool? IsNewModel;
// @ApiMember(ExcludeInSchema=true)
bool? IsSmart;
// @ApiMember(ExcludeInSchema=true)
bool? IsSpecialised;
// @ApiMember(ExcludeInSchema=true)
CriteriaDifference? CriteriaDifference;
CriteriaBase({this.Transmission,this.Fuel,this.Upholstery,this.Equipment,this.Line,this.BodyStyle,this.ColourGroup,this.Packages,this.Model,this.UrlReferrer,this.PreferredDeliveryDate,this.IsNewModel,this.IsSmart,this.IsSpecialised,this.CriteriaDifference});
CriteriaBase.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
Transmission = JsonConverters.fromJson(json['Transmission'],'List<String>',context!);
Fuel = JsonConverters.fromJson(json['Fuel'],'List<String>',context!);
Upholstery = JsonConverters.fromJson(json['Upholstery'],'List<String>',context!);
Equipment = JsonConverters.fromJson(json['Equipment'],'List<String>',context!);
Line = JsonConverters.fromJson(json['Line'],'List<String>',context!);
BodyStyle = JsonConverters.fromJson(json['BodyStyle'],'List<String>',context!);
ColourGroup = JsonConverters.fromJson(json['ColourGroup'],'List<String>',context!);
Packages = JsonConverters.fromJson(json['Packages'],'List<String>',context!);
Model = JsonConverters.fromJson(json['Model'],'List<CriteriaModel>',context!);
UrlReferrer = json['UrlReferrer'];
PreferredDeliveryDate = json['PreferredDeliveryDate'];
IsNewModel = json['IsNewModel'];
IsSmart = json['IsSmart'];
IsSpecialised = json['IsSpecialised'];
CriteriaDifference = JsonConverters.fromJson(json['CriteriaDifference'],'CriteriaDifference',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'Transmission': JsonConverters.toJson(Transmission,'List<String>',context!),
'Fuel': JsonConverters.toJson(Fuel,'List<String>',context!),
'Upholstery': JsonConverters.toJson(Upholstery,'List<String>',context!),
'Equipment': JsonConverters.toJson(Equipment,'List<String>',context!),
'Line': JsonConverters.toJson(Line,'List<String>',context!),
'BodyStyle': JsonConverters.toJson(BodyStyle,'List<String>',context!),
'ColourGroup': JsonConverters.toJson(ColourGroup,'List<String>',context!),
'Packages': JsonConverters.toJson(Packages,'List<String>',context!),
'Model': JsonConverters.toJson(Model,'List<CriteriaModel>',context!),
'UrlReferrer': UrlReferrer,
'PreferredDeliveryDate': PreferredDeliveryDate,
'IsNewModel': IsNewModel,
'IsSmart': IsSmart,
'IsSpecialised': IsSpecialised,
'CriteriaDifference': JsonConverters.toJson(CriteriaDifference,'CriteriaDifference',context!)
});
getTypeName() => "CriteriaBase";
TypeContext? context = _ctx;
}
class Criteria extends CriteriaBase implements IConvertible
{
List<String>? Engine = [];
Criteria({this.Engine});
Criteria.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
Engine = JsonConverters.fromJson(json['Engine'],'List<String>',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'Engine': JsonConverters.toJson(Engine,'List<String>',context!)
});
getTypeName() => "Criteria";
TypeContext? context = _ctx;
}
class V2EngineCriteria implements IConvertible
{
String? Badge;
String? Brand;
V2EngineCriteria({this.Badge,this.Brand});
V2EngineCriteria.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Badge = json['Badge'];
Brand = json['Brand'];
return this;
}
Map<String, dynamic> toJson() => {
'Badge': Badge,
'Brand': Brand
};
getTypeName() => "V2EngineCriteria";
TypeContext? context = _ctx;
}
class V2Criteria extends CriteriaBase implements IConvertible
{
List<V2EngineCriteria>? Engine = [];
V2Criteria({this.Engine});
V2Criteria.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
super.fromMap(json);
Engine = JsonConverters.fromJson(json['Engine'],'List<V2EngineCriteria>',context!);
return this;
}
Map<String, dynamic> toJson() => super.toJson()..addAll({
'Engine': JsonConverters.toJson(Engine,'List<V2EngineCriteria>',context!)
});
getTypeName() => "V2Criteria";
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;
}
class CreateBackOrderBase implements IConvertible
{
String? GssnId;
String? AdditionalInformation;
String? ConfigCode;
Source? Source;
String? TagUrl;
Customer? Customer;
Criteria? CustomerCriteria;
V2Criteria? AgentCriteria;
OutrightPurchase? OutrightPurchase;
String? GasId;
bool? Motability;
int? MotabilityPricingId;
int? AssistanceProviderId;
String? AssistanceDetail;
String? ConfiguratorCode;
CreateBackOrderBase({this.GssnId,this.AdditionalInformation,this.ConfigCode,this.Source,this.TagUrl,this.Customer,this.CustomerCriteria,this.AgentCriteria,this.OutrightPurchase,this.GasId,this.Motability,this.MotabilityPricingId,this.AssistanceProviderId,this.AssistanceDetail,this.ConfiguratorCode});
CreateBackOrderBase.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
GssnId = json['GssnId'];
AdditionalInformation = json['AdditionalInformation'];
ConfigCode = json['ConfigCode'];
Source = JsonConverters.fromJson(json['Source'],'Source',context!);
TagUrl = json['TagUrl'];
Customer = JsonConverters.fromJson(json['Customer'],'Customer',context!);
CustomerCriteria = JsonConverters.fromJson(json['CustomerCriteria'],'Criteria',context!);
AgentCriteria = JsonConverters.fromJson(json['AgentCriteria'],'V2Criteria',context!);
OutrightPurchase = JsonConverters.fromJson(json['OutrightPurchase'],'OutrightPurchase',context!);
GasId = json['GasId'];
Motability = json['Motability'];
MotabilityPricingId = json['MotabilityPricingId'];
AssistanceProviderId = json['AssistanceProviderId'];
AssistanceDetail = json['AssistanceDetail'];
ConfiguratorCode = json['ConfiguratorCode'];
return this;
}
Map<String, dynamic> toJson() => {
'GssnId': GssnId,
'AdditionalInformation': AdditionalInformation,
'ConfigCode': ConfigCode,
'Source': JsonConverters.toJson(Source,'Source',context!),
'TagUrl': TagUrl,
'Customer': JsonConverters.toJson(Customer,'Customer',context!),
'CustomerCriteria': JsonConverters.toJson(CustomerCriteria,'Criteria',context!),
'AgentCriteria': JsonConverters.toJson(AgentCriteria,'V2Criteria',context!),
'OutrightPurchase': JsonConverters.toJson(OutrightPurchase,'OutrightPurchase',context!),
'GasId': GasId,
'Motability': Motability,
'MotabilityPricingId': MotabilityPricingId,
'AssistanceProviderId': AssistanceProviderId,
'AssistanceDetail': AssistanceDetail,
'ConfiguratorCode': ConfiguratorCode
};
getTypeName() => "CreateBackOrderBase";
TypeContext? context = _ctx;
}
class CreateBackOrderResponse implements IConvertible
{
String? Guid;
String? Reference;
CreateBackOrderResponse({this.Guid,this.Reference});
CreateBackOrderResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Guid = json['Guid'];
Reference = json['Reference'];
return this;
}
Map<String, dynamic> toJson() => {
'Guid': Guid,
'Reference': Reference
};
getTypeName() => "CreateBackOrderResponse";
TypeContext? context = _ctx;
}
class CreateBackOrderRequest extends CreateBackOrderBase implements IPost, IConvertible
{
CreateBackOrderRequest();
CreateBackOrderRequest.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() => "CreateBackOrderRequest";
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()),
'JsonVersion': TypeInfo(TypeOf.Class, create:() => JsonVersion()),
'CriteriaModel': TypeInfo(TypeOf.Class, create:() => CriteriaModel()),
'CriteriaDifference': TypeInfo(TypeOf.Class, create:() => CriteriaDifference()),
'CriteriaBase': TypeInfo(TypeOf.Class, create:() => CriteriaBase()),
'List<CriteriaModel>': TypeInfo(TypeOf.Class, create:() => <CriteriaModel>[]),
'Criteria': TypeInfo(TypeOf.Class, create:() => Criteria()),
'V2EngineCriteria': TypeInfo(TypeOf.Class, create:() => V2EngineCriteria()),
'V2Criteria': TypeInfo(TypeOf.Class, create:() => V2Criteria()),
'List<V2EngineCriteria>': TypeInfo(TypeOf.Class, create:() => <V2EngineCriteria>[]),
'OutrightPurchase': TypeInfo(TypeOf.Class, create:() => OutrightPurchase()),
'CreateBackOrderBase': TypeInfo(TypeOf.Class, create:() => CreateBackOrderBase()),
'CreateBackOrderResponse': TypeInfo(TypeOf.Class, create:() => CreateBackOrderResponse()),
'CreateBackOrderRequest': TypeInfo(TypeOf.Class, create:() => CreateBackOrderRequest()),
});
Dart CreateBackOrderRequest 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/backorder HTTP/1.1
Host: prod-api-agency-orch-mb-dhc.rapp-customers.co.uk
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
GssnId: String,
AdditionalInformation: String,
ConfigCode: String,
Source: OnlineShowroom,
TagUrl: String,
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
},
CustomerCriteria:
{
Engine:
[
String
],
Transmission:
[
String
],
Fuel:
[
String
],
Upholstery:
[
String
],
Equipment:
[
String
],
Line:
[
String
],
BodyStyle:
[
String
],
ColourGroup:
[
String
],
Packages:
[
String
],
Model:
[
{
Description: String,
Id: 0
}
],
UrlReferrer: String,
PreferredDeliveryDate: String,
IsNewModel: False,
IsSmart: False,
IsSpecialised: False,
CriteriaDifference:
{
Model: False,
Transmission: False,
Fuel: False,
Upholstery: False,
Equipment: False,
Line: False,
BodyStyle: False,
ColourGroup: False,
Packages: False,
Engine: False,
AdditionalInformation: False,
UrlReferrer: False,
PreferredDeliveryDate: False,
IsSmart: False,
IsSpecialised: False
},
Version: 0
},
AgentCriteria:
{
Engine:
[
{
Badge: String,
Brand: String
}
],
Transmission:
[
String
],
Fuel:
[
String
],
Upholstery:
[
String
],
Equipment:
[
String
],
Line:
[
String
],
BodyStyle:
[
String
],
ColourGroup:
[
String
],
Packages:
[
String
],
Model:
[
{
Description: String,
Id: 0
}
],
UrlReferrer: String,
PreferredDeliveryDate: String,
IsNewModel: False,
IsSmart: False,
IsSpecialised: False,
CriteriaDifference:
{
Model: False,
Transmission: False,
Fuel: False,
Upholstery: False,
Equipment: False,
Line: False,
BodyStyle: False,
ColourGroup: False,
Packages: False,
Engine: False,
AdditionalInformation: False,
UrlReferrer: False,
PreferredDeliveryDate: False,
IsSmart: False,
IsSpecialised: False
},
Version: 0
},
OutrightPurchase:
{
IsOutrightPurchase: False,
Reference: String,
DiscountRate: 0,
Bm7NST: String,
IsBackOrder: False,
IsCOPConverter: False
},
GasId: String,
Motability: False,
MotabilityPricingId: 0,
AssistanceProviderId: 0,
AssistanceDetail: String,
ConfiguratorCode: String
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { Guid: String, Reference: String }