Mercedes.VehicleManagement.API

<back to all web services

VehicleDetailsRequest

Vehicle
Requires Authentication
The following routes are available for this service:
GET/v1/details/{vehicleType}/{Identifier}Get Vehicle Details
GET/details/{vehicleType}/{Identifier}Get Vehicle Details
<?php namespace dtos;

use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};


class VehicleAuditDetails implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $userId='',
        /** @var bool|null */
        public ?bool $status=null,
        /** @var string */
        public string $notes='',
        /** @var string */
        public string $creationDate=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['userId'])) $this->userId = $o['userId'];
        if (isset($o['status'])) $this->status = $o['status'];
        if (isset($o['notes'])) $this->notes = $o['notes'];
        if (isset($o['creationDate'])) $this->creationDate = $o['creationDate'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->userId)) $o['userId'] = $this->userId;
        if (isset($this->status)) $o['status'] = $this->status;
        if (isset($this->notes)) $o['notes'] = $this->notes;
        if (isset($this->creationDate)) $o['creationDate'] = $this->creationDate;
        return empty($o) ? new class(){} : $o;
    }
}

class BackOrderVehicleDetailsBase implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $vin='',
        /** @var string */
        public string $commissionNumber='',
        /** @var string */
        public string $description='',
        /** @var string */
        public string $model='',
        /** @var string */
        public string $fullModelYearCode='',
        /** @var int */
        public int $retailerId=0,
        /** @var string */
        public string $imageUrl='',
        /** @var string */
        public string $colour='',
        /** @var string */
        public string $colourDescription='',
        /** @var string */
        public string $bodyStyle='',
        /** @var string */
        public string $fuelType='',
        /** @var string */
        public string $transmission='',
        /** @var string */
        public string $transmissionType='',
        /** @var string */
        public string $package='',
        /** @var array<string>|null */
        public ?array $packages=null,
        /** @var string */
        public string $line='',
        /** @var string */
        public string $upholstery='',
        /** @var string */
        public string $upholsteryDescription='',
        /** @var string */
        public string $usageCode='',
        /** @var string */
        public string $account='',
        /** @var string */
        public string $nst='',
        /** @var string */
        public string $baumuster='',
        /** @var float|null */
        public ?float $electricRange=null,
        /** @var float|null */
        public ?float $electricConsumption=null,
        /** @var float */
        public float $retailPrice_ExVAT=0.0,
        /** @var float|null */
        public ?float $actualPrice=null,
        /** @var float */
        public float $otrPrice=0.0,
        /** @var string */
        public string $vehicleType='',
        /** @var bool|null */
        public ?bool $secured=null,
        /** @var string */
        public string $productionDate='',
        /** @var DateTime|null */
        public ?DateTime $portArrivalDate=null,
        /** @var string */
        public string $displayRetailer='',
        /** @var string */
        public string $location='',
        /** @var string */
        public string $bm7NST='',
        /** @var bool|null */
        public ?bool $isAvailableOnline=null,
        /** @var bool|null */
        public ?bool $isSpecialistCar=null,
        /** @var bool|null */
        public ?bool $isSellable=null,
        /** @var bool|null */
        public ?bool $inBackOrderAccount=null,
        /** @var array<VehicleAuditDetails>|null */
        public ?array $vehicleAuditDetails=null,
        /** @var array<string>|null */
        public ?array $ispVehicleCustomerDescriptions=null,
        /** @var bool|null */
        public ?bool $underOffer=null,
        /** @var bool|null */
        public ?bool $isAllocatedToBackOrder=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['vin'])) $this->vin = $o['vin'];
        if (isset($o['commissionNumber'])) $this->commissionNumber = $o['commissionNumber'];
        if (isset($o['description'])) $this->description = $o['description'];
        if (isset($o['model'])) $this->model = $o['model'];
        if (isset($o['fullModelYearCode'])) $this->fullModelYearCode = $o['fullModelYearCode'];
        if (isset($o['retailerId'])) $this->retailerId = $o['retailerId'];
        if (isset($o['imageUrl'])) $this->imageUrl = $o['imageUrl'];
        if (isset($o['colour'])) $this->colour = $o['colour'];
        if (isset($o['colourDescription'])) $this->colourDescription = $o['colourDescription'];
        if (isset($o['bodyStyle'])) $this->bodyStyle = $o['bodyStyle'];
        if (isset($o['fuelType'])) $this->fuelType = $o['fuelType'];
        if (isset($o['transmission'])) $this->transmission = $o['transmission'];
        if (isset($o['transmissionType'])) $this->transmissionType = $o['transmissionType'];
        if (isset($o['package'])) $this->package = $o['package'];
        if (isset($o['packages'])) $this->packages = JsonConverters::fromArray('string', $o['packages']);
        if (isset($o['line'])) $this->line = $o['line'];
        if (isset($o['upholstery'])) $this->upholstery = $o['upholstery'];
        if (isset($o['upholsteryDescription'])) $this->upholsteryDescription = $o['upholsteryDescription'];
        if (isset($o['usageCode'])) $this->usageCode = $o['usageCode'];
        if (isset($o['account'])) $this->account = $o['account'];
        if (isset($o['nst'])) $this->nst = $o['nst'];
        if (isset($o['baumuster'])) $this->baumuster = $o['baumuster'];
        if (isset($o['electricRange'])) $this->electricRange = $o['electricRange'];
        if (isset($o['electricConsumption'])) $this->electricConsumption = $o['electricConsumption'];
        if (isset($o['retailPrice_ExVAT'])) $this->retailPrice_ExVAT = $o['retailPrice_ExVAT'];
        if (isset($o['actualPrice'])) $this->actualPrice = $o['actualPrice'];
        if (isset($o['otrPrice'])) $this->otrPrice = $o['otrPrice'];
        if (isset($o['vehicleType'])) $this->vehicleType = $o['vehicleType'];
        if (isset($o['secured'])) $this->secured = $o['secured'];
        if (isset($o['productionDate'])) $this->productionDate = $o['productionDate'];
        if (isset($o['portArrivalDate'])) $this->portArrivalDate = JsonConverters::from('DateTime', $o['portArrivalDate']);
        if (isset($o['displayRetailer'])) $this->displayRetailer = $o['displayRetailer'];
        if (isset($o['location'])) $this->location = $o['location'];
        if (isset($o['bm7NST'])) $this->bm7NST = $o['bm7NST'];
        if (isset($o['isAvailableOnline'])) $this->isAvailableOnline = $o['isAvailableOnline'];
        if (isset($o['isSpecialistCar'])) $this->isSpecialistCar = $o['isSpecialistCar'];
        if (isset($o['isSellable'])) $this->isSellable = $o['isSellable'];
        if (isset($o['inBackOrderAccount'])) $this->inBackOrderAccount = $o['inBackOrderAccount'];
        if (isset($o['vehicleAuditDetails'])) $this->vehicleAuditDetails = JsonConverters::fromArray('VehicleAuditDetails', $o['vehicleAuditDetails']);
        if (isset($o['ispVehicleCustomerDescriptions'])) $this->ispVehicleCustomerDescriptions = JsonConverters::fromArray('string', $o['ispVehicleCustomerDescriptions']);
        if (isset($o['underOffer'])) $this->underOffer = $o['underOffer'];
        if (isset($o['isAllocatedToBackOrder'])) $this->isAllocatedToBackOrder = $o['isAllocatedToBackOrder'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->vin)) $o['vin'] = $this->vin;
        if (isset($this->commissionNumber)) $o['commissionNumber'] = $this->commissionNumber;
        if (isset($this->description)) $o['description'] = $this->description;
        if (isset($this->model)) $o['model'] = $this->model;
        if (isset($this->fullModelYearCode)) $o['fullModelYearCode'] = $this->fullModelYearCode;
        if (isset($this->retailerId)) $o['retailerId'] = $this->retailerId;
        if (isset($this->imageUrl)) $o['imageUrl'] = $this->imageUrl;
        if (isset($this->colour)) $o['colour'] = $this->colour;
        if (isset($this->colourDescription)) $o['colourDescription'] = $this->colourDescription;
        if (isset($this->bodyStyle)) $o['bodyStyle'] = $this->bodyStyle;
        if (isset($this->fuelType)) $o['fuelType'] = $this->fuelType;
        if (isset($this->transmission)) $o['transmission'] = $this->transmission;
        if (isset($this->transmissionType)) $o['transmissionType'] = $this->transmissionType;
        if (isset($this->package)) $o['package'] = $this->package;
        if (isset($this->packages)) $o['packages'] = JsonConverters::toArray('string', $this->packages);
        if (isset($this->line)) $o['line'] = $this->line;
        if (isset($this->upholstery)) $o['upholstery'] = $this->upholstery;
        if (isset($this->upholsteryDescription)) $o['upholsteryDescription'] = $this->upholsteryDescription;
        if (isset($this->usageCode)) $o['usageCode'] = $this->usageCode;
        if (isset($this->account)) $o['account'] = $this->account;
        if (isset($this->nst)) $o['nst'] = $this->nst;
        if (isset($this->baumuster)) $o['baumuster'] = $this->baumuster;
        if (isset($this->electricRange)) $o['electricRange'] = $this->electricRange;
        if (isset($this->electricConsumption)) $o['electricConsumption'] = $this->electricConsumption;
        if (isset($this->retailPrice_ExVAT)) $o['retailPrice_ExVAT'] = $this->retailPrice_ExVAT;
        if (isset($this->actualPrice)) $o['actualPrice'] = $this->actualPrice;
        if (isset($this->otrPrice)) $o['otrPrice'] = $this->otrPrice;
        if (isset($this->vehicleType)) $o['vehicleType'] = $this->vehicleType;
        if (isset($this->secured)) $o['secured'] = $this->secured;
        if (isset($this->productionDate)) $o['productionDate'] = $this->productionDate;
        if (isset($this->portArrivalDate)) $o['portArrivalDate'] = JsonConverters::to('DateTime', $this->portArrivalDate);
        if (isset($this->displayRetailer)) $o['displayRetailer'] = $this->displayRetailer;
        if (isset($this->location)) $o['location'] = $this->location;
        if (isset($this->bm7NST)) $o['bm7NST'] = $this->bm7NST;
        if (isset($this->isAvailableOnline)) $o['isAvailableOnline'] = $this->isAvailableOnline;
        if (isset($this->isSpecialistCar)) $o['isSpecialistCar'] = $this->isSpecialistCar;
        if (isset($this->isSellable)) $o['isSellable'] = $this->isSellable;
        if (isset($this->inBackOrderAccount)) $o['inBackOrderAccount'] = $this->inBackOrderAccount;
        if (isset($this->vehicleAuditDetails)) $o['vehicleAuditDetails'] = JsonConverters::toArray('VehicleAuditDetails', $this->vehicleAuditDetails);
        if (isset($this->ispVehicleCustomerDescriptions)) $o['ispVehicleCustomerDescriptions'] = JsonConverters::toArray('string', $this->ispVehicleCustomerDescriptions);
        if (isset($this->underOffer)) $o['underOffer'] = $this->underOffer;
        if (isset($this->isAllocatedToBackOrder)) $o['isAllocatedToBackOrder'] = $this->isAllocatedToBackOrder;
        return empty($o) ? new class(){} : $o;
    }
}

class BackOrderVehicleDetails extends BackOrderVehicleDetailsBase implements JsonSerializable
{
    /**
     * @param string $vin
     * @param string $commissionNumber
     * @param string $description
     * @param string $model
     * @param string $fullModelYearCode
     * @param int $retailerId
     * @param string $imageUrl
     * @param string $colour
     * @param string $colourDescription
     * @param string $bodyStyle
     * @param string $fuelType
     * @param string $transmission
     * @param string $transmissionType
     * @param string $package
     * @param array<string>|null $packages
     * @param string $line
     * @param string $upholstery
     * @param string $upholsteryDescription
     * @param string $usageCode
     * @param string $account
     * @param string $nst
     * @param string $baumuster
     * @param float|null $electricRange
     * @param float|null $electricConsumption
     * @param float $retailPrice_ExVAT
     * @param float|null $actualPrice
     * @param float $otrPrice
     * @param string $vehicleType
     * @param bool|null $secured
     * @param string $productionDate
     * @param DateTime|null $portArrivalDate
     * @param string $displayRetailer
     * @param string $location
     * @param string $bm7NST
     * @param bool|null $isAvailableOnline
     * @param bool|null $isSpecialistCar
     * @param bool|null $isSellable
     * @param bool|null $inBackOrderAccount
     * @param array<VehicleAuditDetails>|null $vehicleAuditDetails
     * @param array<string>|null $ispVehicleCustomerDescriptions
     * @param bool|null $underOffer
     * @param bool|null $isAllocatedToBackOrder
     */
    public function __construct(
        string $vin='',
        string $commissionNumber='',
        string $description='',
        string $model='',
        string $fullModelYearCode='',
        int $retailerId=0,
        string $imageUrl='',
        string $colour='',
        string $colourDescription='',
        string $bodyStyle='',
        string $fuelType='',
        string $transmission='',
        string $transmissionType='',
        string $package='',
        ?array $packages=null,
        string $line='',
        string $upholstery='',
        string $upholsteryDescription='',
        string $usageCode='',
        string $account='',
        string $nst='',
        string $baumuster='',
        ?float $electricRange=null,
        ?float $electricConsumption=null,
        float $retailPrice_ExVAT=0.0,
        ?float $actualPrice=null,
        float $otrPrice=0.0,
        string $vehicleType='',
        ?bool $secured=null,
        string $productionDate='',
        ?DateTime $portArrivalDate=null,
        string $displayRetailer='',
        string $location='',
        string $bm7NST='',
        ?bool $isAvailableOnline=null,
        ?bool $isSpecialistCar=null,
        ?bool $isSellable=null,
        ?bool $inBackOrderAccount=null,
        ?array $vehicleAuditDetails=null,
        ?array $ispVehicleCustomerDescriptions=null,
        ?bool $underOffer=null,
        ?bool $isAllocatedToBackOrder=null,
        /** @var string|null */
        public ?string $engine=null
    ) {
        parent::__construct($vin,$commissionNumber,$description,$model,$fullModelYearCode,$retailerId,$imageUrl,$colour,$colourDescription,$bodyStyle,$fuelType,$transmission,$transmissionType,$package,$packages,$line,$upholstery,$upholsteryDescription,$usageCode,$account,$nst,$baumuster,$electricRange,$electricConsumption,$retailPrice_ExVAT,$actualPrice,$otrPrice,$vehicleType,$secured,$productionDate,$portArrivalDate,$displayRetailer,$location,$bm7NST,$isAvailableOnline,$isSpecialistCar,$isSellable,$inBackOrderAccount,$vehicleAuditDetails,$ispVehicleCustomerDescriptions,$underOffer,$isAllocatedToBackOrder);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['engine'])) $this->engine = $o['engine'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->engine)) $o['engine'] = $this->engine;
        return empty($o) ? new class(){} : $o;
    }
}

class VehicleDetailsResponse implements JsonSerializable
{
    public function __construct(
        /** @var BackOrderVehicleDetails|null */
        public ?BackOrderVehicleDetails $vehicle=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['vehicle'])) $this->vehicle = JsonConverters::from('BackOrderVehicleDetails', $o['vehicle']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->vehicle)) $o['vehicle'] = JsonConverters::to('BackOrderVehicleDetails', $this->vehicle);
        return empty($o) ? new class(){} : $o;
    }
}

class VehicleDetailsRequest implements IGet, JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $identifier='',
        /** @var string */
        public string $vehicleType=''
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['identifier'])) $this->identifier = $o['identifier'];
        if (isset($o['vehicleType'])) $this->vehicleType = $o['vehicleType'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->identifier)) $o['identifier'] = $this->identifier;
        if (isset($this->vehicleType)) $o['vehicleType'] = $this->vehicleType;
        return empty($o) ? new class(){} : $o;
    }
}

PHP VehicleDetailsRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /v1/details/{vehicleType}/{Identifier} HTTP/1.1 
Host: uat-api-vehicle-mgt-mb-dhc.rapp-customers.co.uk 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<VehicleDetailsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Mercedes.VehicleManagement.API.Shared.POCO.V3">
  <Vehicle>
    <Account>String</Account>
    <ActualPrice>0</ActualPrice>
    <Baumuster>String</Baumuster>
    <Bm7NST>String</Bm7NST>
    <BodyStyle>String</BodyStyle>
    <Colour>String</Colour>
    <ColourDescription>String</ColourDescription>
    <CommissionNumber>String</CommissionNumber>
    <Description>String</Description>
    <DisplayRetailer>String</DisplayRetailer>
    <ElectricConsumption>0</ElectricConsumption>
    <ElectricRange>0</ElectricRange>
    <FuelType>String</FuelType>
    <FullModelYearCode>String</FullModelYearCode>
    <ImageUrl>String</ImageUrl>
    <InBackOrderAccount>false</InBackOrderAccount>
    <IsAllocatedToBackOrder>false</IsAllocatedToBackOrder>
    <IsAvailableOnline>false</IsAvailableOnline>
    <IsSellable>false</IsSellable>
    <IsSpecialistCar>false</IsSpecialistCar>
    <IspVehicleCustomerDescriptions xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>String</d3p1:string>
    </IspVehicleCustomerDescriptions>
    <Line>String</Line>
    <Location>String</Location>
    <Model>String</Model>
    <NST>String</NST>
    <OTRPrice>0</OTRPrice>
    <Package>String</Package>
    <Packages xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>String</d3p1:string>
    </Packages>
    <PortArrivalDate>0001-01-01T00:00:00</PortArrivalDate>
    <ProductionDate>String</ProductionDate>
    <RetailPrice_ExVAT>0</RetailPrice_ExVAT>
    <RetailerId>0</RetailerId>
    <Secured>false</Secured>
    <Transmission>String</Transmission>
    <TransmissionType>String</TransmissionType>
    <UnderOffer>false</UnderOffer>
    <Upholstery>String</Upholstery>
    <UpholsteryDescription>String</UpholsteryDescription>
    <UsageCode>String</UsageCode>
    <VehicleAuditDetails>
      <VehicleAuditDetails>
        <CreationDate>String</CreationDate>
        <Notes>String</Notes>
        <Status>false</Status>
        <UserId>String</UserId>
      </VehicleAuditDetails>
    </VehicleAuditDetails>
    <VehicleType>String</VehicleType>
    <Vin>String</Vin>
    <Engine>String</Engine>
  </Vehicle>
</VehicleDetailsResponse>