Mercedes.Agency.Orchestration.API

<back to all web services

UpdateInflightOrderVoucherRequest

Requires Authentication
The following routes are available for this service:
PUT/v1/order/inflight/voucherUpdate inflight order voucher codeUpdates an existing active order with a new voucher code offer
<?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 UpdateInflightOrderVoucherResponse implements JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $Success=null
    ) {
    }

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

class UpdateInflightOrderVoucherRequest implements IPut, JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $OrderId=0,
        /** @var int */
        public int $VoucherOfferItemId=0,
        /** @var string */
        public string $VoucherCode='',
        /** @var string */
        public string $VIN='',
        /** @var string */
        public string $OrderReference='',
        /** @var string|null */
        public ?string $CommissionNumber=null
    ) {
    }

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

PHP UpdateInflightOrderVoucherRequest DTOs

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

HTTP + JSV

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

PUT /v1/order/inflight/voucher HTTP/1.1 
Host: prod-api-agency-orch-mb-dhc.rapp-customers.co.uk 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	OrderId: 0,
	VoucherOfferItemId: 0,
	VoucherCode: String,
	VIN: String,
	OrderReference: String,
	CommissionNumber: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Success: False
}