Trendsic Platform Service

<back to all web services

CourierDriverPayRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/worker/dispatch/od/pay
<?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 CourierPayLineView implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $DispatchLoadID=0,
        /** @var string|null */
        public ?string $Kind=null,
        /** @var string|null */
        public ?string $Label=null,
        /** @var float|null */
        public ?float $Qty=null,
        /** @var float|null */
        public ?float $Rate=null,
        /** @var float */
        public float $Amount=0.0
    ) {
    }

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

class CourierDriverPayRow implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $DispatchLoadID=0,
        /** @var string|null */
        public ?string $Code=null,
        /** @var string|null */
        public ?string $Kind=null,
        /** @var string|null */
        public ?string $OrderCode=null,
        /** @var string|null */
        public ?string $RunCode=null,
        /** @var string|null */
        public ?string $QtyText=null,
        /** @var string|null */
        public ?string $SourceLabel=null,
        /** @var string|null */
        public ?string $DestinationLabel=null,
        /** @var string|null */
        public ?string $Status=null,
        /** @var float|null */
        public ?float $Pay=null,
        /** @var DateTime|null */
        public ?DateTime $OpenedUtc=null,
        /** @var DateTime|null */
        public ?DateTime $ClosedUtc=null,
        /** @var array<CourierPayLineView>|null */
        public ?array $Lines=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['DispatchLoadID'])) $this->DispatchLoadID = $o['DispatchLoadID'];
        if (isset($o['Code'])) $this->Code = $o['Code'];
        if (isset($o['Kind'])) $this->Kind = $o['Kind'];
        if (isset($o['OrderCode'])) $this->OrderCode = $o['OrderCode'];
        if (isset($o['RunCode'])) $this->RunCode = $o['RunCode'];
        if (isset($o['QtyText'])) $this->QtyText = $o['QtyText'];
        if (isset($o['SourceLabel'])) $this->SourceLabel = $o['SourceLabel'];
        if (isset($o['DestinationLabel'])) $this->DestinationLabel = $o['DestinationLabel'];
        if (isset($o['Status'])) $this->Status = $o['Status'];
        if (isset($o['Pay'])) $this->Pay = $o['Pay'];
        if (isset($o['OpenedUtc'])) $this->OpenedUtc = JsonConverters::from('DateTime', $o['OpenedUtc']);
        if (isset($o['ClosedUtc'])) $this->ClosedUtc = JsonConverters::from('DateTime', $o['ClosedUtc']);
        if (isset($o['Lines'])) $this->Lines = JsonConverters::fromArray('CourierPayLineView', $o['Lines']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->DispatchLoadID)) $o['DispatchLoadID'] = $this->DispatchLoadID;
        if (isset($this->Code)) $o['Code'] = $this->Code;
        if (isset($this->Kind)) $o['Kind'] = $this->Kind;
        if (isset($this->OrderCode)) $o['OrderCode'] = $this->OrderCode;
        if (isset($this->RunCode)) $o['RunCode'] = $this->RunCode;
        if (isset($this->QtyText)) $o['QtyText'] = $this->QtyText;
        if (isset($this->SourceLabel)) $o['SourceLabel'] = $this->SourceLabel;
        if (isset($this->DestinationLabel)) $o['DestinationLabel'] = $this->DestinationLabel;
        if (isset($this->Status)) $o['Status'] = $this->Status;
        if (isset($this->Pay)) $o['Pay'] = $this->Pay;
        if (isset($this->OpenedUtc)) $o['OpenedUtc'] = JsonConverters::to('DateTime', $this->OpenedUtc);
        if (isset($this->ClosedUtc)) $o['ClosedUtc'] = JsonConverters::to('DateTime', $this->ClosedUtc);
        if (isset($this->Lines)) $o['Lines'] = JsonConverters::toArray('CourierPayLineView', $this->Lines);
        return empty($o) ? new class(){} : $o;
    }
}

class CourierDriverPayResponse implements JsonSerializable
{
    public function __construct(
        /** @var array<CourierDriverPayRow>|null */
        public ?array $Rows=null,
        /** @var float */
        public float $Total=0.0,
        /** @var bool|null */
        public ?bool $Available=null,
        /** @var DateTime */
        public DateTime $ServerUtc=new DateTime(),
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Rows'])) $this->Rows = JsonConverters::fromArray('CourierDriverPayRow', $o['Rows']);
        if (isset($o['Total'])) $this->Total = $o['Total'];
        if (isset($o['Available'])) $this->Available = $o['Available'];
        if (isset($o['ServerUtc'])) $this->ServerUtc = JsonConverters::from('DateTime', $o['ServerUtc']);
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Rows)) $o['Rows'] = JsonConverters::toArray('CourierDriverPayRow', $this->Rows);
        if (isset($this->Total)) $o['Total'] = $this->Total;
        if (isset($this->Available)) $o['Available'] = $this->Available;
        if (isset($this->ServerUtc)) $o['ServerUtc'] = JsonConverters::to('DateTime', $this->ServerUtc);
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        return empty($o) ? new class(){} : $o;
    }
}

class CourierDriverPayRequest implements JsonSerializable
{
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        return empty($o) ? new class(){} : $o;
    }
}

PHP CourierDriverPayRequest 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/worker/dispatch/od/pay HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<CourierDriverPayResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Available>false</Available>
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
        <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringstring>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>String</d5p1:Value>
          </d5p1:KeyValueOfstringstring>
        </d2p1:Meta>
      </d2p1:ResponseError>
    </d2p1:Errors>
    <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>String</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </d2p1:Meta>
  </ResponseStatus>
  <Rows>
    <CourierDriverPayRow>
      <ClosedUtc>0001-01-01T00:00:00</ClosedUtc>
      <Code>String</Code>
      <DestinationLabel>String</DestinationLabel>
      <DispatchLoadID>0</DispatchLoadID>
      <Kind>String</Kind>
      <Lines>
        <CourierPayLineView>
          <Amount>0</Amount>
          <DispatchLoadID>0</DispatchLoadID>
          <Kind>String</Kind>
          <Label>String</Label>
          <Qty>0</Qty>
          <Rate>0</Rate>
        </CourierPayLineView>
      </Lines>
      <OpenedUtc>0001-01-01T00:00:00</OpenedUtc>
      <OrderCode>String</OrderCode>
      <Pay>0</Pay>
      <QtyText>String</QtyText>
      <RunCode>String</RunCode>
      <SourceLabel>String</SourceLabel>
      <Status>String</Status>
    </CourierDriverPayRow>
  </Rows>
  <ServerUtc>0001-01-01T00:00:00</ServerUtc>
  <Total>0</Total>
</CourierDriverPayResponse>