Antel API

<back to all web services

CloseOrderArrival

Requires Authentication
The following routes are available for this service:
POST/stock/closeArrival/order
<?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 ApiServiceRequest implements IServiceRequest, IHasApiKey, IHasDeviceInfo, JsonSerializable
{
    public function __construct(
        /** @description The API Key required for authentication */
        // @ApiMember(DataType="string", Description="The API Key required for authentication", IsRequired=true)
        /** @var string */
        public string $apiKey='',

        /** @description Latitude of the user making this request */
        // @ApiMember(DataType="double", Description="Latitude of the user making this request")
        /** @var float */
        public float $latitude=0.0,

        /** @description Longitude of the user making this request */
        // @ApiMember(DataType="double", Description="Longitude of the user making this request")
        /** @var float */
        public float $longitude=0.0
    ) {
    }

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

class ApiServiceResponse implements IServiceResponse, JsonSerializable
{
    public function __construct(
        /** @description Information about the response. */
        // @ApiMember(Description="Information about the response.", IsRequired=true)
        /** @var string */
        public string $description='',

        /** @description Heading or summary of the response. */
        // @ApiMember(Description="Heading or summary of the response.", IsRequired=true)
        /** @var string */
        public string $heading='',

        /** @description Did the intended operation for this response complete successfully? */
        // @ApiMember(DataType="boolean", Description="Did the intended operation for this response complete successfully?", IsRequired=true)
        /** @var bool|null */
        public ?bool $wasSuccessful=null,

        /** @var ResponseStatus|null */
        public ?ResponseStatus $responseStatus=null
    ) {
    }

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

class StockOperationSealItem implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $upliftNumber=null,
        /** @var string|null */
        public ?string $sealNumber=null,
        /** @var string|null */
        public ?string $principalName=null,
        /** @var float */
        public float $currentWeight=0.0,
        /** @var float */
        public float $weightDifference=0.0,
        /** @var string|null */
        public ?string $operatorName=null,
        /** @var string|null */
        public ?string $outletName=null,
        /** @var string|null */
        public ?string $upliftDate=null,
        /** @var bool|null */
        public ?bool $pausedAwaitingAuth=null,
        /** @var string|null */
        public ?string $upliftPdfLink=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['upliftNumber'])) $this->upliftNumber = $o['upliftNumber'];
        if (isset($o['sealNumber'])) $this->sealNumber = $o['sealNumber'];
        if (isset($o['principalName'])) $this->principalName = $o['principalName'];
        if (isset($o['currentWeight'])) $this->currentWeight = $o['currentWeight'];
        if (isset($o['weightDifference'])) $this->weightDifference = $o['weightDifference'];
        if (isset($o['operatorName'])) $this->operatorName = $o['operatorName'];
        if (isset($o['outletName'])) $this->outletName = $o['outletName'];
        if (isset($o['upliftDate'])) $this->upliftDate = $o['upliftDate'];
        if (isset($o['pausedAwaitingAuth'])) $this->pausedAwaitingAuth = $o['pausedAwaitingAuth'];
        if (isset($o['upliftPdfLink'])) $this->upliftPdfLink = $o['upliftPdfLink'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->upliftNumber)) $o['upliftNumber'] = $this->upliftNumber;
        if (isset($this->sealNumber)) $o['sealNumber'] = $this->sealNumber;
        if (isset($this->principalName)) $o['principalName'] = $this->principalName;
        if (isset($this->currentWeight)) $o['currentWeight'] = $this->currentWeight;
        if (isset($this->weightDifference)) $o['weightDifference'] = $this->weightDifference;
        if (isset($this->operatorName)) $o['operatorName'] = $this->operatorName;
        if (isset($this->outletName)) $o['outletName'] = $this->outletName;
        if (isset($this->upliftDate)) $o['upliftDate'] = $this->upliftDate;
        if (isset($this->pausedAwaitingAuth)) $o['pausedAwaitingAuth'] = $this->pausedAwaitingAuth;
        if (isset($this->upliftPdfLink)) $o['upliftPdfLink'] = $this->upliftPdfLink;
        return empty($o) ? new class(){} : $o;
    }
}

class StockOperationSummary implements JsonSerializable
{
    public function __construct(
        /** @var array<StockOperationSealItem>|null */
        public ?array $scannedSeals=null,
        /** @var array<StockOperationSealItem>|null */
        public ?array $missingSeals=null,
        /** @var array<StockOperationSealItem>|null */
        public ?array $unknownUpliftSeals=null,
        /** @var array<StockOperationSealItem>|null */
        public ?array $pausedSeals=null,
        /** @var array<StockOperationSealItem>|null */
        public ?array $weightDifferenceSeals=null,
        /** @var bool|null */
        public ?bool $hasScannedSeals=null,
        /** @var bool|null */
        public ?bool $hasMissingSeals=null,
        /** @var bool|null */
        public ?bool $hasWeightDifferenceSeals=null,
        /** @var bool|null */
        public ?bool $hasUnknownUpliftSeals=null,
        /** @var bool|null */
        public ?bool $hasPausedSeals=null,
        /** @var bool|null */
        public ?bool $hasException=null,
        /** @var int */
        public int $totalSealsCount=0,
        /** @var float */
        public float $totalSealsWeight=0.0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['scannedSeals'])) $this->scannedSeals = JsonConverters::fromArray('StockOperationSealItem', $o['scannedSeals']);
        if (isset($o['missingSeals'])) $this->missingSeals = JsonConverters::fromArray('StockOperationSealItem', $o['missingSeals']);
        if (isset($o['unknownUpliftSeals'])) $this->unknownUpliftSeals = JsonConverters::fromArray('StockOperationSealItem', $o['unknownUpliftSeals']);
        if (isset($o['pausedSeals'])) $this->pausedSeals = JsonConverters::fromArray('StockOperationSealItem', $o['pausedSeals']);
        if (isset($o['weightDifferenceSeals'])) $this->weightDifferenceSeals = JsonConverters::fromArray('StockOperationSealItem', $o['weightDifferenceSeals']);
        if (isset($o['hasScannedSeals'])) $this->hasScannedSeals = $o['hasScannedSeals'];
        if (isset($o['hasMissingSeals'])) $this->hasMissingSeals = $o['hasMissingSeals'];
        if (isset($o['hasWeightDifferenceSeals'])) $this->hasWeightDifferenceSeals = $o['hasWeightDifferenceSeals'];
        if (isset($o['hasUnknownUpliftSeals'])) $this->hasUnknownUpliftSeals = $o['hasUnknownUpliftSeals'];
        if (isset($o['hasPausedSeals'])) $this->hasPausedSeals = $o['hasPausedSeals'];
        if (isset($o['hasException'])) $this->hasException = $o['hasException'];
        if (isset($o['totalSealsCount'])) $this->totalSealsCount = $o['totalSealsCount'];
        if (isset($o['totalSealsWeight'])) $this->totalSealsWeight = $o['totalSealsWeight'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->scannedSeals)) $o['scannedSeals'] = JsonConverters::toArray('StockOperationSealItem', $this->scannedSeals);
        if (isset($this->missingSeals)) $o['missingSeals'] = JsonConverters::toArray('StockOperationSealItem', $this->missingSeals);
        if (isset($this->unknownUpliftSeals)) $o['unknownUpliftSeals'] = JsonConverters::toArray('StockOperationSealItem', $this->unknownUpliftSeals);
        if (isset($this->pausedSeals)) $o['pausedSeals'] = JsonConverters::toArray('StockOperationSealItem', $this->pausedSeals);
        if (isset($this->weightDifferenceSeals)) $o['weightDifferenceSeals'] = JsonConverters::toArray('StockOperationSealItem', $this->weightDifferenceSeals);
        if (isset($this->hasScannedSeals)) $o['hasScannedSeals'] = $this->hasScannedSeals;
        if (isset($this->hasMissingSeals)) $o['hasMissingSeals'] = $this->hasMissingSeals;
        if (isset($this->hasWeightDifferenceSeals)) $o['hasWeightDifferenceSeals'] = $this->hasWeightDifferenceSeals;
        if (isset($this->hasUnknownUpliftSeals)) $o['hasUnknownUpliftSeals'] = $this->hasUnknownUpliftSeals;
        if (isset($this->hasPausedSeals)) $o['hasPausedSeals'] = $this->hasPausedSeals;
        if (isset($this->hasException)) $o['hasException'] = $this->hasException;
        if (isset($this->totalSealsCount)) $o['totalSealsCount'] = $this->totalSealsCount;
        if (isset($this->totalSealsWeight)) $o['totalSealsWeight'] = $this->totalSealsWeight;
        return empty($o) ? new class(){} : $o;
    }
}

class CloseOrderArrivalResponse extends ApiServiceResponse implements JsonSerializable
{
    /**
     * @param string $description
     * @param string $heading
     * @param bool|null $wasSuccessful
     * @param ResponseStatus|null $responseStatus
     */
    public function __construct(
        string $description='',
        string $heading='',
        ?bool $wasSuccessful=null,
        ?ResponseStatus $responseStatus=null,
        /** @var string|null */
        public ?string $orderNumber=null,
        /** @var string|null */
        public ?string $requestingOperatorName=null,
        /** @var string|null */
        public ?string $operatorName=null,
        /** @var string|null */
        public ?string $destinationDepot=null,
        /** @var string|null */
        public ?string $driverName=null,
        /** @var string|null */
        public ?string $companyName=null,
        /** @var string|null */
        public ?string $licensePlate=null,
        /** @var int */
        public int $orderId=0,
        /** @var int */
        public int $estimatedSeals=0,
        /** @var StockOperationSummary|null */
        public ?StockOperationSummary $operationSummary=null
    ) {
        parent::__construct($description,$heading,$wasSuccessful,$responseStatus);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['orderNumber'])) $this->orderNumber = $o['orderNumber'];
        if (isset($o['requestingOperatorName'])) $this->requestingOperatorName = $o['requestingOperatorName'];
        if (isset($o['operatorName'])) $this->operatorName = $o['operatorName'];
        if (isset($o['destinationDepot'])) $this->destinationDepot = $o['destinationDepot'];
        if (isset($o['driverName'])) $this->driverName = $o['driverName'];
        if (isset($o['companyName'])) $this->companyName = $o['companyName'];
        if (isset($o['licensePlate'])) $this->licensePlate = $o['licensePlate'];
        if (isset($o['orderId'])) $this->orderId = $o['orderId'];
        if (isset($o['estimatedSeals'])) $this->estimatedSeals = $o['estimatedSeals'];
        if (isset($o['operationSummary'])) $this->operationSummary = JsonConverters::from('StockOperationSummary', $o['operationSummary']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->orderNumber)) $o['orderNumber'] = $this->orderNumber;
        if (isset($this->requestingOperatorName)) $o['requestingOperatorName'] = $this->requestingOperatorName;
        if (isset($this->operatorName)) $o['operatorName'] = $this->operatorName;
        if (isset($this->destinationDepot)) $o['destinationDepot'] = $this->destinationDepot;
        if (isset($this->driverName)) $o['driverName'] = $this->driverName;
        if (isset($this->companyName)) $o['companyName'] = $this->companyName;
        if (isset($this->licensePlate)) $o['licensePlate'] = $this->licensePlate;
        if (isset($this->orderId)) $o['orderId'] = $this->orderId;
        if (isset($this->estimatedSeals)) $o['estimatedSeals'] = $this->estimatedSeals;
        if (isset($this->operationSummary)) $o['operationSummary'] = JsonConverters::to('StockOperationSummary', $this->operationSummary);
        return empty($o) ? new class(){} : $o;
    }
}

class CloseOrderArrival extends ApiServiceRequest implements JsonSerializable
{
    /**
     * @param string $apiKey
     * @param float $latitude
     * @param float $longitude
     */
    public function __construct(
        string $apiKey='',
        float $latitude=0.0,
        float $longitude=0.0,
        /** @var string|null */
        public ?string $orderNumber=null
    ) {
        parent::__construct($apiKey,$latitude,$longitude);
    }

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

PHP CloseOrderArrival DTOs

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

HTTP + OTHER

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

POST /stock/closeArrival/order HTTP/1.1 
Host: antel.api.dev.86degrees.com 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"orderNumber":"String","apiKey":"String","latitude":0,"longitude":0}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"orderNumber":"String","requestingOperatorName":"String","operatorName":"String","destinationDepot":"String","driverName":"String","companyName":"String","licensePlate":"String","orderId":0,"estimatedSeals":0,"operationSummary":{"scannedSeals":[{"upliftNumber":"String","sealNumber":"String","principalName":"String","currentWeight":0,"weightDifference":0,"operatorName":"String","outletName":"String","upliftDate":"String","pausedAwaitingAuth":false,"upliftPdfLink":"String"}],"missingSeals":[{"upliftNumber":"String","sealNumber":"String","principalName":"String","currentWeight":0,"weightDifference":0,"operatorName":"String","outletName":"String","upliftDate":"String","pausedAwaitingAuth":false,"upliftPdfLink":"String"}],"unknownUpliftSeals":[{"upliftNumber":"String","sealNumber":"String","principalName":"String","currentWeight":0,"weightDifference":0,"operatorName":"String","outletName":"String","upliftDate":"String","pausedAwaitingAuth":false,"upliftPdfLink":"String"}],"pausedSeals":[{"upliftNumber":"String","sealNumber":"String","principalName":"String","currentWeight":0,"weightDifference":0,"operatorName":"String","outletName":"String","upliftDate":"String","pausedAwaitingAuth":false,"upliftPdfLink":"String"}],"weightDifferenceSeals":[{"upliftNumber":"String","sealNumber":"String","principalName":"String","currentWeight":0,"weightDifference":0,"operatorName":"String","outletName":"String","upliftDate":"String","pausedAwaitingAuth":false,"upliftPdfLink":"String"}],"hasScannedSeals":true,"hasMissingSeals":true,"hasWeightDifferenceSeals":true,"hasUnknownUpliftSeals":true,"hasPausedSeals":true,"hasException":true,"totalSealsCount":4,"totalSealsWeight":0},"description":"String","heading":"String","wasSuccessful":false,"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}