POST | /v1/backorder/vehicleimports |
---|
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class UpdateBackOrderVehicleImportsResponse:
pass
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Vehicle:
vin: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class VehicleCriteriaMatch:
fuel: bool = False
transmission: bool = False
colour: bool = False
upholstery: bool = False
line: bool = False
engine: bool = False
body_style: bool = False
packages: bool = False
class OfferPriceProductType(str, Enum):
LIS_T__P_R_I_C_E = 'LIST_PRICE'
NUMBE_R__P_L_A_T_E__F_E_E = 'NUMBER_PLATE_FEE'
DELIVER_Y__C_H_A_R_G_E = 'DELIVERY_CHARGE'
FUE_L__C_H_A_R_G_E = 'FUEL_CHARGE'
MANUFACTURE_R__O_F_F_E_R = 'MANUFACTURER_OFFER'
PERSONALISE_D__M_O_N_E_Y_O_F_F_E_R = 'PERSONALISED_MONEYOFFER'
PERSONALISE_D__N_O_N_M_O_N_E_Y_O_F_F_E_R = 'PERSONALISED_NONMONEYOFFER'
PERSONALISE_D__N_O_N_M_O_N_E_Y_O_F_F_E_R__N_E_G = 'PERSONALISED_NONMONEYOFFER_NEG'
SERVICE = 'SERVICE'
SERVIC_E__N_E_G = 'SERVICE_NEG'
GOVERNMEN_T__G_R_A_N_T = 'GOVERNMENT_GRANT'
OUTRIGH_T__P_U_R_C_H_A_S_E__D_I_S_C_O_U_N_T = 'OUTRIGHT_PURCHASE_DISCOUNT'
VI_P__O_F_F_E_R = 'VIP_OFFER'
WALLBO_X__O_F_F_E_R = 'WALLBOX_OFFER'
WALLBO_X__O_F_F_E_R__N_E_G = 'WALLBOX_OFFER_NEG'
ROA_D__F_U_N_D__L_I_C_E_N_C_E = 'ROAD_FUND_LICENCE'
FIRS_T__R_E_G_I_S_T_R_A_T_I_O_N__F_E_E = 'FIRST_REGISTRATION_FEE'
NO_T__F_O_U_N_D = 'NOT_FOUND'
ACCESSOR_Y__O_F_F_E_R = 'ACCESSORY_OFFER'
ACCESSOR_Y__O_F_F_E_R__N_E_G = 'ACCESSORY_OFFER_NEG'
MOTABILIT_Y__D_I_S_C_O_U_N_T = 'MOTABILITY_DISCOUNT'
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Price:
id: Optional[str] = None
description: Optional[str] = None
net: Decimal = decimal.Decimal(0)
vat: Decimal = decimal.Decimal(0)
gross: Decimal = decimal.Decimal(0)
product: Optional[OfferPriceProductType] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class RetailerOpeningTime:
day: Optional[str] = None
open_from: Optional[str] = None
open_to: Optional[str] = None
special: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class RetailerOpeningTimes:
new: List[RetailerOpeningTime] = field(default_factory=list)
used: List[RetailerOpeningTime] = field(default_factory=list)
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Retailer:
id: int = 0
gssn_id: Optional[str] = None
description: Optional[str] = None
street: Optional[str] = None
city: Optional[str] = None
postcode: Optional[str] = None
google_map_postcode: Optional[str] = None
phone: Optional[str] = None
fax: Optional[str] = None
email: Optional[str] = None
website: Optional[str] = None
retailer_group_id: Optional[str] = None
retailer_group_name: Optional[str] = None
is_online: bool = False
is_new_car_retailer: bool = False
is_used_car_retailer: bool = False
is_central_retailer: bool = False
chat_enabled: bool = False
trade_in_enabled: bool = False
smart: bool = False
display_phone_number_new: Optional[str] = None
display_phone_number_used: Optional[str] = None
latitude: Decimal = decimal.Decimal(0)
longitude: Decimal = decimal.Decimal(0)
smart_description: Optional[str] = None
smart_website: Optional[str] = None
smart_phone: Optional[str] = None
legacy_id: Optional[str] = None
agent: bool = False
market_area_id: int = 0
digital_lounge_parent_gssn_id: Optional[str] = None
send_leads_to_digital_lounge_parent: bool = False
opening_times: Optional[RetailerOpeningTimes] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class VehicleBaseDetail(Vehicle, ICommissionNumber):
description: Optional[str] = None
commission_number: Optional[str] = None
port_arrival_date: Optional[str] = None
offer_expiry_date: Optional[str] = None
fuel: Optional[str] = None
transmission: Optional[str] = None
transmission_type: Optional[str] = None
colour: Optional[str] = None
colour_description: Optional[str] = None
image_url: Optional[str] = None
specialist: bool = False
vehicle_criteria_match: Optional[VehicleCriteriaMatch] = None
colour_group: Optional[str] = None
model: Optional[str] = None
body_style: Optional[str] = None
brand: Optional[str] = None
engine: Optional[str] = None
engine_description: Optional[str] = None
line: Optional[str] = None
upholstery: Optional[str] = None
upholstery_description: Optional[str] = None
packages: List[str] = field(default_factory=list)
p11_d: Decimal = decimal.Decimal(0)
prices: List[Price] = field(default_factory=list)
vehicle_class: Optional[str] = None
product_range: Optional[str] = None
vehicle_type: Optional[str] = None
emission: Optional[Decimal] = None
baumuster: Optional[str] = None
is_sellable: bool = False
bm7_n_s_t: Optional[str] = None
electric_range: Optional[Decimal] = None
electric_consumption: Optional[Decimal] = None
is_display_stock: bool = False
display_retailer__id: Optional[int] = None
display_retailer: Optional[str] = None
display_retailer_gssn_id: Optional[str] = None
retailer: Optional[Retailer] = None
age: Optional[int] = None
model_year_code: Optional[str] = None
half_model_year_code: Optional[str] = None
full_model_year_code: Optional[str] = None
production_date: Optional[str] = None
chassis_number: Optional[str] = None
eligible_for_integrated_service_care: bool = False
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class VehicleConsumption:
id: int = 0
lkm: Decimal = decimal.Decimal(0)
mpg: Decimal = decimal.Decimal(0)
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Equipment:
id: int = 0
code: Optional[str] = None
description: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Equipmentv2(Equipment):
importance: int = 0
is_additional: bool = False
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class VehicleEquipmentCategory:
order: int = 0
code: Optional[str] = None
description: Optional[str] = None
equipment: Optional[List[Equipmentv2]] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class VehicleEmissionClass:
colour: Optional[str] = None
rating: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class VehicleAttribute:
description: Optional[str] = None
value: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class VehicleIntegratedServiceCareOption:
option_code: Optional[str] = None
b_m7_n_s_t: Optional[str] = None
full_model_year: Optional[str] = None
integrated_product_type: Optional[str] = None
customer_description: Optional[str] = None
one_agent_product_type: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class VehicleDetail(VehicleBaseDetail):
retail_price__ex_v_a_t: Optional[str] = None
otr: Optional[str] = None
actual_price: Optional[str] = None
total_offer_value: Optional[str] = None
is_h_o_back_order_account_vehicle: bool = False
consumption_combined: Optional[VehicleConsumption] = None
consumption_extra_urban: Optional[VehicleConsumption] = None
consumption_urban: Optional[VehicleConsumption] = None
wltp_fuel_consumption_combined: Optional[VehicleConsumption] = None
wltp_fuel_consumption_extra_high: Optional[VehicleConsumption] = None
wltp_fuel_consumption_high: Optional[VehicleConsumption] = None
wltp_fuel_consumption_low: Optional[VehicleConsumption] = None
wltp_fuel_consumption_medium: Optional[VehicleConsumption] = None
equipment_categories: Optional[List[VehicleEquipmentCategory]] = None
vehicle_energy_efficiency_class: Optional[VehicleEmissionClass] = None
vehicle_data: Optional[List[VehicleAttribute]] = None
integrated_products: List[VehicleIntegratedServiceCareOption] = field(default_factory=list)
isp_vehicle_customer_descriptions: Optional[List[str]] = None
colour_code: Optional[str] = None
upholstery_code: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class VehicleImport(Vehicle):
commission_number: Optional[str] = None
sellable: bool = False
vehicle: Optional[VehicleDetail] = None
# @ApiResponse(Description="Success", StatusCode=200)
# @ApiResponse(Description="BadRequest", StatusCode=400)
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class UpdateBackOrderVehicleImportsRequest(IPost):
vehicle_imports: List[VehicleImport] = field(default_factory=list)
Python UpdateBackOrderVehicleImportsRequest 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/vehicleimports HTTP/1.1
Host: prod-api-agency-orch-mb-dhc.rapp-customers.co.uk
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
VehicleImports:
[
{
CommissionNumber: String,
Sellable: False,
Vehicle:
{
RetailPrice_ExVAT: String,
OTR: String,
ActualPrice: String,
TotalOfferValue: String,
IsHOBackOrderAccountVehicle: False,
ConsumptionCombined:
{
Id: 0,
Lkm: 0,
Mpg: 0
},
ConsumptionExtraUrban:
{
Id: 0,
Lkm: 0,
Mpg: 0
},
ConsumptionUrban:
{
Id: 0,
Lkm: 0,
Mpg: 0
},
WltpFuelConsumptionCombined:
{
Id: 0,
Lkm: 0,
Mpg: 0
},
WltpFuelConsumptionExtraHigh:
{
Id: 0,
Lkm: 0,
Mpg: 0
},
WltpFuelConsumptionHigh:
{
Id: 0,
Lkm: 0,
Mpg: 0
},
WltpFuelConsumptionLow:
{
Id: 0,
Lkm: 0,
Mpg: 0
},
WltpFuelConsumptionMedium:
{
Id: 0,
Lkm: 0,
Mpg: 0
},
EquipmentCategories:
[
{
Order: 0,
Code: String,
Description: String,
Equipment:
[
{
Importance: 0,
IsAdditional: False,
Id: 0,
Code: String,
Description: String
}
]
}
],
VehicleEnergyEfficiencyClass:
{
Colour: String,
Rating: String
},
VehicleData:
[
{
Description: String,
Value: String
}
],
IntegratedProducts:
[
{
OptionCode: String,
BM7NST: String,
FullModelYear: String,
IntegratedProductType: String,
CustomerDescription: String,
OneAgentProductType: String
}
],
IspVehicleCustomerDescriptions:
[
String
],
ColourCode: String,
UpholsteryCode: String,
Description: String,
CommissionNumber: String,
PortArrivalDate: String,
OfferExpiryDate: String,
Fuel: String,
Transmission: String,
TransmissionType: String,
Colour: String,
ColourDescription: String,
ImageUrl: String,
Specialist: False,
VehicleCriteriaMatch:
{
Fuel: False,
Transmission: False,
Colour: False,
Upholstery: False,
Line: False,
Engine: False,
BodyStyle: False,
Packages: False
},
ColourGroup: String,
Model: String,
BodyStyle: String,
Brand: String,
Engine: String,
EngineDescription: String,
Line: String,
Upholstery: String,
UpholsteryDescription: String,
Packages:
[
String
],
P11D: 0,
Prices:
[
{
Id: String,
Description: String,
Net: 0,
VAT: 0,
Gross: 0,
Product: LIST_PRICE
}
],
VehicleClass: String,
ProductRange: String,
VehicleType: String,
Emission: 0,
Baumuster: String,
IsSellable: False,
Bm7NST: String,
ElectricRange: 0,
ElectricConsumption: 0,
IsDisplayStock: False,
DisplayRetailer_Id: 0,
DisplayRetailer: String,
DisplayRetailerGssnId: String,
Retailer:
{
Id: 0,
GssnId: String,
Description: String,
Street: String,
City: String,
Postcode: String,
GoogleMapPostcode: String,
Phone: String,
Fax: String,
Email: String,
Website: String,
RetailerGroupId: String,
RetailerGroupName: String,
IsOnline: False,
IsNewCarRetailer: False,
IsUsedCarRetailer: False,
IsCentralRetailer: False,
ChatEnabled: False,
TradeInEnabled: False,
smart: False,
DisplayPhoneNumberNew: String,
DisplayPhoneNumberUsed: String,
Latitude: 0,
Longitude: 0,
smartDescription: String,
smartWebsite: String,
smartPhone: String,
LegacyId: String,
Agent: False,
MarketAreaId: 0,
DigitalLoungeParentGssnId: String,
SendLeadsToDigitalLoungeParent: False,
OpeningTimes:
{
New:
[
{
Day: String,
OpenFrom: String,
OpenTo: String,
Special: String
}
],
Used:
[
{
Day: String,
OpenFrom: String,
OpenTo: String,
Special: String
}
]
}
},
Age: 0,
ModelYearCode: String,
HalfModelYearCode: String,
FullModelYearCode: String,
ProductionDate: String,
ChassisNumber: String,
EligibleForIntegratedServiceCare: False,
Vin: String
},
Vin: String
}
]
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { }