Trendsic Platform Service

<back to all web services

CourierBookOrderRequest

The following routes are available for this service:
POST,OPTIONS/v1/book/{Slug}/orders
POST,OPTIONS/v1/book/{Slug}/orders/confirm
<?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 CourierBookOrderResponse implements JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $Done=null,
        /** @var bool|null */
        public ?bool $NeedsAction=null,
        /** @var string|null */
        public ?string $ClientSecret=null,
        /** @var string|null */
        public ?string $SetupIntentId=null,
        /** @var string|null */
        public ?string $Code=null,
        /** @var string|null */
        public ?string $TrackUrl=null,
        /** @var string|null */
        public ?string $IcsUrl=null,
        /** @var string|null */
        public ?string $WindowText=null,
        /** @var string|null */
        public ?string $Promise=null,
        /** @var float */
        public float $Total=0.0,
        /** @var string|null */
        public ?string $PayTiming=null,
        /** @var string|null */
        public ?string $CardLast4=null,
        /** @var string|null */
        public ?string $Repeats=null,
        /** @var string|null */
        public ?string $LinkSentBy=null,
        /** @var string|null */
        public ?string $ReopenStep=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Done'])) $this->Done = $o['Done'];
        if (isset($o['NeedsAction'])) $this->NeedsAction = $o['NeedsAction'];
        if (isset($o['ClientSecret'])) $this->ClientSecret = $o['ClientSecret'];
        if (isset($o['SetupIntentId'])) $this->SetupIntentId = $o['SetupIntentId'];
        if (isset($o['Code'])) $this->Code = $o['Code'];
        if (isset($o['TrackUrl'])) $this->TrackUrl = $o['TrackUrl'];
        if (isset($o['IcsUrl'])) $this->IcsUrl = $o['IcsUrl'];
        if (isset($o['WindowText'])) $this->WindowText = $o['WindowText'];
        if (isset($o['Promise'])) $this->Promise = $o['Promise'];
        if (isset($o['Total'])) $this->Total = $o['Total'];
        if (isset($o['PayTiming'])) $this->PayTiming = $o['PayTiming'];
        if (isset($o['CardLast4'])) $this->CardLast4 = $o['CardLast4'];
        if (isset($o['Repeats'])) $this->Repeats = $o['Repeats'];
        if (isset($o['LinkSentBy'])) $this->LinkSentBy = $o['LinkSentBy'];
        if (isset($o['ReopenStep'])) $this->ReopenStep = $o['ReopenStep'];
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Done)) $o['Done'] = $this->Done;
        if (isset($this->NeedsAction)) $o['NeedsAction'] = $this->NeedsAction;
        if (isset($this->ClientSecret)) $o['ClientSecret'] = $this->ClientSecret;
        if (isset($this->SetupIntentId)) $o['SetupIntentId'] = $this->SetupIntentId;
        if (isset($this->Code)) $o['Code'] = $this->Code;
        if (isset($this->TrackUrl)) $o['TrackUrl'] = $this->TrackUrl;
        if (isset($this->IcsUrl)) $o['IcsUrl'] = $this->IcsUrl;
        if (isset($this->WindowText)) $o['WindowText'] = $this->WindowText;
        if (isset($this->Promise)) $o['Promise'] = $this->Promise;
        if (isset($this->Total)) $o['Total'] = $this->Total;
        if (isset($this->PayTiming)) $o['PayTiming'] = $this->PayTiming;
        if (isset($this->CardLast4)) $o['CardLast4'] = $this->CardLast4;
        if (isset($this->Repeats)) $o['Repeats'] = $this->Repeats;
        if (isset($this->LinkSentBy)) $o['LinkSentBy'] = $this->LinkSentBy;
        if (isset($this->ReopenStep)) $o['ReopenStep'] = $this->ReopenStep;
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        return empty($o) ? new class(){} : $o;
    }
}

class CourierBookOrderRequest implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Slug=null,
        /** @var string|null */
        public ?string $Profile=null,
        /** @var string|null */
        public ?string $TurnstileToken=null,
        /** @var string|null */
        public ?string $Level=null,
        /** @var string|null */
        public ?string $WindowId=null,
        /** @var string|null */
        public ?string $Recur=null,
        /** @var string|null */
        public ?string $Address=null,
        /** @var string|null */
        public ?string $Unit=null,
        /** @var string|null */
        public ?string $City=null,
        /** @var string|null */
        public ?string $Zip=null,
        /** @var float|null */
        public ?float $Lat=null,
        /** @var float|null */
        public ?float $Lng=null,
        /** @var string|null */
        public ?string $PickupName=null,
        /** @var string|null */
        public ?string $DropAddress=null,
        /** @var string|null */
        public ?string $DropUnit=null,
        /** @var string|null */
        public ?string $DropCity=null,
        /** @var string|null */
        public ?string $DropZip=null,
        /** @var float|null */
        public ?float $DropLat=null,
        /** @var float|null */
        public ?float $DropLng=null,
        /** @var string|null */
        public ?string $RecipientName=null,
        /** @var int */
        public int $Units=0,
        /** @var string|null */
        public ?string $Handoff=null,
        /** @var string|null */
        public ?string $GateCode=null,
        /** @var string|null */
        public ?string $Note=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Phone=null,
        /** @var string|null */
        public ?string $Email=null,
        /** @var bool|null */
        public ?bool $SmsConsent=null,
        /** @var bool|null */
        public ?bool $Terms=null,
        /** @var string|null */
        public ?string $PaymentMethodId=null,
        /** @var string|null */
        public ?string $SetupIntentId=null,
        /** @var float|null */
        public ?float $QuotedTotal=null,
        /** @var string|null */
        public ?string $Lang=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Slug'])) $this->Slug = $o['Slug'];
        if (isset($o['Profile'])) $this->Profile = $o['Profile'];
        if (isset($o['TurnstileToken'])) $this->TurnstileToken = $o['TurnstileToken'];
        if (isset($o['Level'])) $this->Level = $o['Level'];
        if (isset($o['WindowId'])) $this->WindowId = $o['WindowId'];
        if (isset($o['Recur'])) $this->Recur = $o['Recur'];
        if (isset($o['Address'])) $this->Address = $o['Address'];
        if (isset($o['Unit'])) $this->Unit = $o['Unit'];
        if (isset($o['City'])) $this->City = $o['City'];
        if (isset($o['Zip'])) $this->Zip = $o['Zip'];
        if (isset($o['Lat'])) $this->Lat = $o['Lat'];
        if (isset($o['Lng'])) $this->Lng = $o['Lng'];
        if (isset($o['PickupName'])) $this->PickupName = $o['PickupName'];
        if (isset($o['DropAddress'])) $this->DropAddress = $o['DropAddress'];
        if (isset($o['DropUnit'])) $this->DropUnit = $o['DropUnit'];
        if (isset($o['DropCity'])) $this->DropCity = $o['DropCity'];
        if (isset($o['DropZip'])) $this->DropZip = $o['DropZip'];
        if (isset($o['DropLat'])) $this->DropLat = $o['DropLat'];
        if (isset($o['DropLng'])) $this->DropLng = $o['DropLng'];
        if (isset($o['RecipientName'])) $this->RecipientName = $o['RecipientName'];
        if (isset($o['Units'])) $this->Units = $o['Units'];
        if (isset($o['Handoff'])) $this->Handoff = $o['Handoff'];
        if (isset($o['GateCode'])) $this->GateCode = $o['GateCode'];
        if (isset($o['Note'])) $this->Note = $o['Note'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Phone'])) $this->Phone = $o['Phone'];
        if (isset($o['Email'])) $this->Email = $o['Email'];
        if (isset($o['SmsConsent'])) $this->SmsConsent = $o['SmsConsent'];
        if (isset($o['Terms'])) $this->Terms = $o['Terms'];
        if (isset($o['PaymentMethodId'])) $this->PaymentMethodId = $o['PaymentMethodId'];
        if (isset($o['SetupIntentId'])) $this->SetupIntentId = $o['SetupIntentId'];
        if (isset($o['QuotedTotal'])) $this->QuotedTotal = $o['QuotedTotal'];
        if (isset($o['Lang'])) $this->Lang = $o['Lang'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Slug)) $o['Slug'] = $this->Slug;
        if (isset($this->Profile)) $o['Profile'] = $this->Profile;
        if (isset($this->TurnstileToken)) $o['TurnstileToken'] = $this->TurnstileToken;
        if (isset($this->Level)) $o['Level'] = $this->Level;
        if (isset($this->WindowId)) $o['WindowId'] = $this->WindowId;
        if (isset($this->Recur)) $o['Recur'] = $this->Recur;
        if (isset($this->Address)) $o['Address'] = $this->Address;
        if (isset($this->Unit)) $o['Unit'] = $this->Unit;
        if (isset($this->City)) $o['City'] = $this->City;
        if (isset($this->Zip)) $o['Zip'] = $this->Zip;
        if (isset($this->Lat)) $o['Lat'] = $this->Lat;
        if (isset($this->Lng)) $o['Lng'] = $this->Lng;
        if (isset($this->PickupName)) $o['PickupName'] = $this->PickupName;
        if (isset($this->DropAddress)) $o['DropAddress'] = $this->DropAddress;
        if (isset($this->DropUnit)) $o['DropUnit'] = $this->DropUnit;
        if (isset($this->DropCity)) $o['DropCity'] = $this->DropCity;
        if (isset($this->DropZip)) $o['DropZip'] = $this->DropZip;
        if (isset($this->DropLat)) $o['DropLat'] = $this->DropLat;
        if (isset($this->DropLng)) $o['DropLng'] = $this->DropLng;
        if (isset($this->RecipientName)) $o['RecipientName'] = $this->RecipientName;
        if (isset($this->Units)) $o['Units'] = $this->Units;
        if (isset($this->Handoff)) $o['Handoff'] = $this->Handoff;
        if (isset($this->GateCode)) $o['GateCode'] = $this->GateCode;
        if (isset($this->Note)) $o['Note'] = $this->Note;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Phone)) $o['Phone'] = $this->Phone;
        if (isset($this->Email)) $o['Email'] = $this->Email;
        if (isset($this->SmsConsent)) $o['SmsConsent'] = $this->SmsConsent;
        if (isset($this->Terms)) $o['Terms'] = $this->Terms;
        if (isset($this->PaymentMethodId)) $o['PaymentMethodId'] = $this->PaymentMethodId;
        if (isset($this->SetupIntentId)) $o['SetupIntentId'] = $this->SetupIntentId;
        if (isset($this->QuotedTotal)) $o['QuotedTotal'] = $this->QuotedTotal;
        if (isset($this->Lang)) $o['Lang'] = $this->Lang;
        return empty($o) ? new class(){} : $o;
    }
}

PHP CourierBookOrderRequest 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.

POST /v1/book/{Slug}/orders HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<CourierBookOrderRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Address>String</Address>
  <City>String</City>
  <DropAddress>String</DropAddress>
  <DropCity>String</DropCity>
  <DropLat>0</DropLat>
  <DropLng>0</DropLng>
  <DropUnit>String</DropUnit>
  <DropZip>String</DropZip>
  <Email>String</Email>
  <GateCode>String</GateCode>
  <Handoff>String</Handoff>
  <Lang>String</Lang>
  <Lat>0</Lat>
  <Level>String</Level>
  <Lng>0</Lng>
  <Name>String</Name>
  <Note>String</Note>
  <PaymentMethodId>String</PaymentMethodId>
  <Phone>String</Phone>
  <PickupName>String</PickupName>
  <Profile>String</Profile>
  <QuotedTotal>0</QuotedTotal>
  <RecipientName>String</RecipientName>
  <Recur>String</Recur>
  <SetupIntentId>String</SetupIntentId>
  <Slug>String</Slug>
  <SmsConsent>false</SmsConsent>
  <Terms>false</Terms>
  <TurnstileToken>String</TurnstileToken>
  <Unit>String</Unit>
  <Units>0</Units>
  <WindowId>String</WindowId>
  <Zip>String</Zip>
</CourierBookOrderRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<CourierBookOrderResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <CardLast4>String</CardLast4>
  <ClientSecret>String</ClientSecret>
  <Code>String</Code>
  <Done>false</Done>
  <IcsUrl>String</IcsUrl>
  <LinkSentBy>String</LinkSentBy>
  <NeedsAction>false</NeedsAction>
  <PayTiming>String</PayTiming>
  <Promise>String</Promise>
  <ReopenStep>String</ReopenStep>
  <Repeats>String</Repeats>
  <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>
  <SetupIntentId>String</SetupIntentId>
  <Total>0</Total>
  <TrackUrl>String</TrackUrl>
  <WindowText>String</WindowText>
</CourierBookOrderResponse>