Mercedes.Agency.Orchestration.API

<back to all web services

GetOrderDetailByGuidRequest

Order
Requires Authentication
The following routes are available for this service:
GET/v1/order/detail/{OrderGuid}Get Order by Guid
<?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 GetOrderDetailByGuidRequest implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $OrderGuid=null
    ) {
    }

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

class OrderDetailByGuid implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $Guid='',
        /** @var string|null */
        public ?string $BackOrderReference=null,
        /** @var string */
        public string $Reference='',
        /** @var string */
        public string $Agent='',
        /** @var string */
        public string $Vin='',
        /** @var string */
        public string $Description='',
        /** @var string */
        public string $ImageUrl='',
        /** @var string */
        public string $OutrightPurchaseCorporation='',
        /** @var string|null */
        public ?string $NetPrice=null,
        /** @var string|null */
        public ?string $OtrPrice=null,
        /** @var string|null */
        public ?string $ActualPrice=null,
        /** @var string */
        public string $CommissionNumber='',
        /** @var string */
        public string $BodyStyle='',
        /** @var string */
        public string $Line='',
        /** @var string */
        public string $Engine='',
        /** @var string */
        public string $Transmission='',
        /** @var string */
        public string $Fuel='',
        /** @var string */
        public string $Colour='',
        /** @var string */
        public string $Upholstery='',
        /** @var string|null */
        public ?string $Package=null,
        /** @var string|null */
        public ?string $FullModelYearCode=null,
        /** @var string|null */
        public ?string $PortArrivalDate=null,
        /** @var string|null */
        public ?string $ProductionDate=null,
        /** @var string[] */
        public array $PersonalisedOffer=[]
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Guid'])) $this->Guid = $o['Guid'];
        if (isset($o['BackOrderReference'])) $this->BackOrderReference = $o['BackOrderReference'];
        if (isset($o['Reference'])) $this->Reference = $o['Reference'];
        if (isset($o['Agent'])) $this->Agent = $o['Agent'];
        if (isset($o['Vin'])) $this->Vin = $o['Vin'];
        if (isset($o['Description'])) $this->Description = $o['Description'];
        if (isset($o['ImageUrl'])) $this->ImageUrl = $o['ImageUrl'];
        if (isset($o['OutrightPurchaseCorporation'])) $this->OutrightPurchaseCorporation = $o['OutrightPurchaseCorporation'];
        if (isset($o['NetPrice'])) $this->NetPrice = $o['NetPrice'];
        if (isset($o['OtrPrice'])) $this->OtrPrice = $o['OtrPrice'];
        if (isset($o['ActualPrice'])) $this->ActualPrice = $o['ActualPrice'];
        if (isset($o['CommissionNumber'])) $this->CommissionNumber = $o['CommissionNumber'];
        if (isset($o['BodyStyle'])) $this->BodyStyle = $o['BodyStyle'];
        if (isset($o['Line'])) $this->Line = $o['Line'];
        if (isset($o['Engine'])) $this->Engine = $o['Engine'];
        if (isset($o['Transmission'])) $this->Transmission = $o['Transmission'];
        if (isset($o['Fuel'])) $this->Fuel = $o['Fuel'];
        if (isset($o['Colour'])) $this->Colour = $o['Colour'];
        if (isset($o['Upholstery'])) $this->Upholstery = $o['Upholstery'];
        if (isset($o['Package'])) $this->Package = $o['Package'];
        if (isset($o['FullModelYearCode'])) $this->FullModelYearCode = $o['FullModelYearCode'];
        if (isset($o['PortArrivalDate'])) $this->PortArrivalDate = $o['PortArrivalDate'];
        if (isset($o['ProductionDate'])) $this->ProductionDate = $o['ProductionDate'];
        if (isset($o['PersonalisedOffer'])) $this->PersonalisedOffer = JsonConverters::fromArray('string', $o['PersonalisedOffer']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Guid)) $o['Guid'] = $this->Guid;
        if (isset($this->BackOrderReference)) $o['BackOrderReference'] = $this->BackOrderReference;
        if (isset($this->Reference)) $o['Reference'] = $this->Reference;
        if (isset($this->Agent)) $o['Agent'] = $this->Agent;
        if (isset($this->Vin)) $o['Vin'] = $this->Vin;
        if (isset($this->Description)) $o['Description'] = $this->Description;
        if (isset($this->ImageUrl)) $o['ImageUrl'] = $this->ImageUrl;
        if (isset($this->OutrightPurchaseCorporation)) $o['OutrightPurchaseCorporation'] = $this->OutrightPurchaseCorporation;
        if (isset($this->NetPrice)) $o['NetPrice'] = $this->NetPrice;
        if (isset($this->OtrPrice)) $o['OtrPrice'] = $this->OtrPrice;
        if (isset($this->ActualPrice)) $o['ActualPrice'] = $this->ActualPrice;
        if (isset($this->CommissionNumber)) $o['CommissionNumber'] = $this->CommissionNumber;
        if (isset($this->BodyStyle)) $o['BodyStyle'] = $this->BodyStyle;
        if (isset($this->Line)) $o['Line'] = $this->Line;
        if (isset($this->Engine)) $o['Engine'] = $this->Engine;
        if (isset($this->Transmission)) $o['Transmission'] = $this->Transmission;
        if (isset($this->Fuel)) $o['Fuel'] = $this->Fuel;
        if (isset($this->Colour)) $o['Colour'] = $this->Colour;
        if (isset($this->Upholstery)) $o['Upholstery'] = $this->Upholstery;
        if (isset($this->Package)) $o['Package'] = $this->Package;
        if (isset($this->FullModelYearCode)) $o['FullModelYearCode'] = $this->FullModelYearCode;
        if (isset($this->PortArrivalDate)) $o['PortArrivalDate'] = $this->PortArrivalDate;
        if (isset($this->ProductionDate)) $o['ProductionDate'] = $this->ProductionDate;
        if (isset($this->PersonalisedOffer)) $o['PersonalisedOffer'] = JsonConverters::toArray('string', $this->PersonalisedOffer);
        return empty($o) ? new class(){} : $o;
    }
}

class GetOrderDetailByGuidResponse implements JsonSerializable
{
    public function __construct(
        /** @var OrderDetailByGuid|null */
        public ?OrderDetailByGuid $Order=null
    ) {
    }

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

PHP GetOrderDetailByGuidRequest DTOs

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

HTTP + CSV

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

GET /v1/order/detail/{OrderGuid} HTTP/1.1 
Host: prod-api-agency-orch-mb-dhc.rapp-customers.co.uk 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"Order":{"Guid":"String","BackOrderReference":"String","Reference":"String","Agent":"String","Vin":"String","Description":"String","ImageUrl":"String","OutrightPurchaseCorporation":"String","NetPrice":"String","OtrPrice":"String","ActualPrice":"String","CommissionNumber":"String","BodyStyle":"String","Line":"String","Engine":"String","Transmission":"String","Fuel":"String","Colour":"String","Upholstery":"String","Package":"String","FullModelYearCode":"String","PortArrivalDate":"String","ProductionDate":"String","PersonalisedOffer":["String"]}}