Trendsic Platform Service

<back to all web services

CustomerAppInvoicePayRequest

The following routes are available for this service:
POST/v1/c/app/invoices/{Uid}/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 CustomerAppSessionRequest implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Slug=null,
        /** @var string|null */
        public ?string $Profile=null
    ) {
    }

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

class CourierTrackBusiness implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Phone=null
    ) {
    }

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

class CourierBookLevel implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Code=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Ready=null,
        /** @var int */
        public int $WithinMin=0,
        /** @var string|null */
        public ?string $InBy=null,
        /** @var float */
        public float $Surcharge=0.0,
        /** @var array<int>|null */
        public ?array $Days=null,
        /** @var int|null */
        public ?int $DeadlineMin=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Code'])) $this->Code = $o['Code'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Ready'])) $this->Ready = $o['Ready'];
        if (isset($o['WithinMin'])) $this->WithinMin = $o['WithinMin'];
        if (isset($o['InBy'])) $this->InBy = $o['InBy'];
        if (isset($o['Surcharge'])) $this->Surcharge = $o['Surcharge'];
        if (isset($o['Days'])) $this->Days = JsonConverters::fromArray('int', $o['Days']);
        if (isset($o['DeadlineMin'])) $this->DeadlineMin = $o['DeadlineMin'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Code)) $o['Code'] = $this->Code;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Ready)) $o['Ready'] = $this->Ready;
        if (isset($this->WithinMin)) $o['WithinMin'] = $this->WithinMin;
        if (isset($this->InBy)) $o['InBy'] = $this->InBy;
        if (isset($this->Surcharge)) $o['Surcharge'] = $this->Surcharge;
        if (isset($this->Days)) $o['Days'] = JsonConverters::toArray('int', $this->Days);
        if (isset($this->DeadlineMin)) $o['DeadlineMin'] = $this->DeadlineMin;
        return empty($o) ? new class(){} : $o;
    }
}

class HandoffOptions implements JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $Hand=null,
        /** @var bool|null */
        public ?bool $Porch=null,
        /** @var bool|null */
        public ?bool $Desk=null,
        /** @var bool|null */
        public ?bool $SigRequired=null,
        /** @var bool|null */
        public ?bool $IdRequired=null,
        /** @var bool|null */
        public ?bool $CodeRequired=null
    ) {
    }

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

class CourierBookProfile implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Code=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Shape=null,
        /** @var string|null */
        public ?string $Template=null,
        /** @var string|null */
        public ?string $UnitOne=null,
        /** @var string|null */
        public ?string $UnitMany=null,
        /** @var string|null */
        public ?string $UnitOneEs=null,
        /** @var string|null */
        public ?string $UnitManyEs=null,
        /** @var string|null */
        public ?string $FacilityNoun=null,
        /** @var string|null */
        public ?string $FacilityNounEs=null,
        /** @var string|null */
        public ?string $FacilityName=null,
        /** @var array<CourierBookLevel>|null */
        public ?array $Levels=null,
        /** @var bool|null */
        public ?bool $Asap=null,
        /** @var bool|null */
        public ?bool $Recurring=null,
        /** @var string|null */
        public ?string $PayTiming=null,
        /** @var bool|null */
        public ?bool $FinalAfterCount=null,
        /** @var float */
        public float $CancelFee=0.0,
        /** @var float */
        public float $MissedFee=0.0,
        /** @var int */
        public int $MissedWaitMin=0,
        /** @var array<string>|null */
        public ?array $ServiceArea=null,
        /** @var array<string>|null */
        public ?array $Zips=null,
        /** @var HandoffOptions|null */
        public ?HandoffOptions $Handoffs=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Code'])) $this->Code = $o['Code'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Shape'])) $this->Shape = $o['Shape'];
        if (isset($o['Template'])) $this->Template = $o['Template'];
        if (isset($o['UnitOne'])) $this->UnitOne = $o['UnitOne'];
        if (isset($o['UnitMany'])) $this->UnitMany = $o['UnitMany'];
        if (isset($o['UnitOneEs'])) $this->UnitOneEs = $o['UnitOneEs'];
        if (isset($o['UnitManyEs'])) $this->UnitManyEs = $o['UnitManyEs'];
        if (isset($o['FacilityNoun'])) $this->FacilityNoun = $o['FacilityNoun'];
        if (isset($o['FacilityNounEs'])) $this->FacilityNounEs = $o['FacilityNounEs'];
        if (isset($o['FacilityName'])) $this->FacilityName = $o['FacilityName'];
        if (isset($o['Levels'])) $this->Levels = JsonConverters::fromArray('CourierBookLevel', $o['Levels']);
        if (isset($o['Asap'])) $this->Asap = $o['Asap'];
        if (isset($o['Recurring'])) $this->Recurring = $o['Recurring'];
        if (isset($o['PayTiming'])) $this->PayTiming = $o['PayTiming'];
        if (isset($o['FinalAfterCount'])) $this->FinalAfterCount = $o['FinalAfterCount'];
        if (isset($o['CancelFee'])) $this->CancelFee = $o['CancelFee'];
        if (isset($o['MissedFee'])) $this->MissedFee = $o['MissedFee'];
        if (isset($o['MissedWaitMin'])) $this->MissedWaitMin = $o['MissedWaitMin'];
        if (isset($o['ServiceArea'])) $this->ServiceArea = JsonConverters::fromArray('string', $o['ServiceArea']);
        if (isset($o['Zips'])) $this->Zips = JsonConverters::fromArray('string', $o['Zips']);
        if (isset($o['Handoffs'])) $this->Handoffs = JsonConverters::from('HandoffOptions', $o['Handoffs']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Code)) $o['Code'] = $this->Code;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Shape)) $o['Shape'] = $this->Shape;
        if (isset($this->Template)) $o['Template'] = $this->Template;
        if (isset($this->UnitOne)) $o['UnitOne'] = $this->UnitOne;
        if (isset($this->UnitMany)) $o['UnitMany'] = $this->UnitMany;
        if (isset($this->UnitOneEs)) $o['UnitOneEs'] = $this->UnitOneEs;
        if (isset($this->UnitManyEs)) $o['UnitManyEs'] = $this->UnitManyEs;
        if (isset($this->FacilityNoun)) $o['FacilityNoun'] = $this->FacilityNoun;
        if (isset($this->FacilityNounEs)) $o['FacilityNounEs'] = $this->FacilityNounEs;
        if (isset($this->FacilityName)) $o['FacilityName'] = $this->FacilityName;
        if (isset($this->Levels)) $o['Levels'] = JsonConverters::toArray('CourierBookLevel', $this->Levels);
        if (isset($this->Asap)) $o['Asap'] = $this->Asap;
        if (isset($this->Recurring)) $o['Recurring'] = $this->Recurring;
        if (isset($this->PayTiming)) $o['PayTiming'] = $this->PayTiming;
        if (isset($this->FinalAfterCount)) $o['FinalAfterCount'] = $this->FinalAfterCount;
        if (isset($this->CancelFee)) $o['CancelFee'] = $this->CancelFee;
        if (isset($this->MissedFee)) $o['MissedFee'] = $this->MissedFee;
        if (isset($this->MissedWaitMin)) $o['MissedWaitMin'] = $this->MissedWaitMin;
        if (isset($this->ServiceArea)) $o['ServiceArea'] = JsonConverters::toArray('string', $this->ServiceArea);
        if (isset($this->Zips)) $o['Zips'] = JsonConverters::toArray('string', $this->Zips);
        if (isset($this->Handoffs)) $o['Handoffs'] = JsonConverters::to('HandoffOptions', $this->Handoffs);
        return empty($o) ? new class(){} : $o;
    }
}

class CourierBookProfileLink implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Code=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Shape=null
    ) {
    }

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

class CourierBookPageView implements JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $Available=null,
        /** @var bool|null */
        public ?bool $BookingOn=null,
        /** @var CourierTrackBusiness|null */
        public ?CourierTrackBusiness $Business=null,
        /** @var CourierBookProfile|null */
        public ?CourierBookProfile $Profile=null,
        /** @var array<CourierBookProfileLink>|null */
        public ?array $Profiles=null,
        /** @var bool|null */
        public ?bool $CardEnabled=null,
        /** @var string|null */
        public ?string $PublishableKey=null,
        /** @var string|null */
        public ?string $AppUrl=null,
        /** @var string|null */
        public ?string $Today=null,
        /** @var int */
        public int $Weekday=0,
        /** @var int */
        public int $NowMin=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Available'])) $this->Available = $o['Available'];
        if (isset($o['BookingOn'])) $this->BookingOn = $o['BookingOn'];
        if (isset($o['Business'])) $this->Business = JsonConverters::from('CourierTrackBusiness', $o['Business']);
        if (isset($o['Profile'])) $this->Profile = JsonConverters::from('CourierBookProfile', $o['Profile']);
        if (isset($o['Profiles'])) $this->Profiles = JsonConverters::fromArray('CourierBookProfileLink', $o['Profiles']);
        if (isset($o['CardEnabled'])) $this->CardEnabled = $o['CardEnabled'];
        if (isset($o['PublishableKey'])) $this->PublishableKey = $o['PublishableKey'];
        if (isset($o['AppUrl'])) $this->AppUrl = $o['AppUrl'];
        if (isset($o['Today'])) $this->Today = $o['Today'];
        if (isset($o['Weekday'])) $this->Weekday = $o['Weekday'];
        if (isset($o['NowMin'])) $this->NowMin = $o['NowMin'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Available)) $o['Available'] = $this->Available;
        if (isset($this->BookingOn)) $o['BookingOn'] = $this->BookingOn;
        if (isset($this->Business)) $o['Business'] = JsonConverters::to('CourierTrackBusiness', $this->Business);
        if (isset($this->Profile)) $o['Profile'] = JsonConverters::to('CourierBookProfile', $this->Profile);
        if (isset($this->Profiles)) $o['Profiles'] = JsonConverters::toArray('CourierBookProfileLink', $this->Profiles);
        if (isset($this->CardEnabled)) $o['CardEnabled'] = $this->CardEnabled;
        if (isset($this->PublishableKey)) $o['PublishableKey'] = $this->PublishableKey;
        if (isset($this->AppUrl)) $o['AppUrl'] = $this->AppUrl;
        if (isset($this->Today)) $o['Today'] = $this->Today;
        if (isset($this->Weekday)) $o['Weekday'] = $this->Weekday;
        if (isset($this->NowMin)) $o['NowMin'] = $this->NowMin;
        return empty($o) ? new class(){} : $o;
    }
}

class CustomerAppBoot implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Profile=null,
        /** @var bool|null */
        public ?bool $Available=null,
        /** @var string|null */
        public ?string $Reason=null,
        /** @var string|null */
        public ?string $AuthMethod=null,
        /** @var string|null */
        public ?string $Slug=null,
        /** @var CourierBookPageView|null */
        public ?CourierBookPageView $Page=null,
        /** @var string|null */
        public ?string $ManifestUrl=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Profile'])) $this->Profile = $o['Profile'];
        if (isset($o['Available'])) $this->Available = $o['Available'];
        if (isset($o['Reason'])) $this->Reason = $o['Reason'];
        if (isset($o['AuthMethod'])) $this->AuthMethod = $o['AuthMethod'];
        if (isset($o['Slug'])) $this->Slug = $o['Slug'];
        if (isset($o['Page'])) $this->Page = JsonConverters::from('CourierBookPageView', $o['Page']);
        if (isset($o['ManifestUrl'])) $this->ManifestUrl = $o['ManifestUrl'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Profile)) $o['Profile'] = $this->Profile;
        if (isset($this->Available)) $o['Available'] = $this->Available;
        if (isset($this->Reason)) $o['Reason'] = $this->Reason;
        if (isset($this->AuthMethod)) $o['AuthMethod'] = $this->AuthMethod;
        if (isset($this->Slug)) $o['Slug'] = $this->Slug;
        if (isset($this->Page)) $o['Page'] = JsonConverters::to('CourierBookPageView', $this->Page);
        if (isset($this->ManifestUrl)) $o['ManifestUrl'] = $this->ManifestUrl;
        return empty($o) ? new class(){} : $o;
    }
}

class CustomerAppAddress implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Id=0,
        /** @var string|null */
        public ?string $Label=null,
        /** @var string|null */
        public ?string $Street=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 bool|null */
        public ?bool $InArea=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['Label'])) $this->Label = $o['Label'];
        if (isset($o['Street'])) $this->Street = $o['Street'];
        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['InArea'])) $this->InArea = $o['InArea'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->Label)) $o['Label'] = $this->Label;
        if (isset($this->Street)) $o['Street'] = $this->Street;
        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->InArea)) $o['InArea'] = $this->InArea;
        return empty($o) ? new class(){} : $o;
    }
}

class CustomerAppCard implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Id=0,
        /** @var string|null */
        public ?string $Label=null,
        /** @var string|null */
        public ?string $Brand=null,
        /** @var string|null */
        public ?string $Last4=null,
        /** @var bool|null */
        public ?bool $IsDefault=null
    ) {
    }

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

class CustomerAppNotif implements JsonSerializable
{
    public function __construct(
        /** @var bool|null */
        public ?bool $Texts=null,
        /** @var bool|null */
        public ?bool $Push=null,
        /** @var bool|null */
        public ?bool $Promos=null
    ) {
    }

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

class CustomerAppStep implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $Key=null,
        /** @var bool|null */
        public ?bool $Done=null,
        /** @var string|null */
        public ?string $Time=null
    ) {
    }

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

class CustomerAppOrder implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Id=0,
        /** @var string|null */
        public ?string $Code=null,
        /** @var string|null */
        public ?string $Status=null,
        /** @var string|null */
        public ?string $State=null,
        /** @var bool|null */
        public ?bool $Active=null,
        /** @var string|null */
        public ?string $LevelCode=null,
        /** @var string|null */
        public ?string $LevelName=null,
        /** @var int */
        public int $Units=0,
        /** @var int|null */
        public ?int $UnitsFound=null,
        /** @var string|null */
        public ?string $Address=null,
        /** @var string|null */
        public ?string $Unit=null,
        /** @var string|null */
        public ?string $Zip=null,
        /** @var string|null */
        public ?string $DropAddress=null,
        /** @var string|null */
        public ?string $RecipientName=null,
        /** @var string|null */
        public ?string $Handoff=null,
        /** @var bool|null */
        public ?bool $IsAsap=null,
        /** @var int */
        public int $DayIx=0,
        /** @var string|null */
        public ?string $DateText=null,
        /** @var int|null */
        public ?int $StartMin=null,
        /** @var int|null */
        public ?int $EndMin=null,
        /** @var string|null */
        public ?string $DriverFirstName=null,
        /** @var int|null */
        public ?int $EtaMin=null,
        /** @var string|null */
        public ?string $Promise=null,
        /** @var string|null */
        public ?string $PayMode=null,
        /** @var float */
        public float $Amount=0.0,
        /** @var float|null */
        public ?float $Charged=null,
        /** @var float|null */
        public ?float $Tip=null,
        /** @var string|null */
        public ?string $CardLast4=null,
        /** @var int|null */
        public ?int $RecurrenceId=null,
        /** @var array<CustomerAppStep>|null */
        public ?array $Steps=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['Code'])) $this->Code = $o['Code'];
        if (isset($o['Status'])) $this->Status = $o['Status'];
        if (isset($o['State'])) $this->State = $o['State'];
        if (isset($o['Active'])) $this->Active = $o['Active'];
        if (isset($o['LevelCode'])) $this->LevelCode = $o['LevelCode'];
        if (isset($o['LevelName'])) $this->LevelName = $o['LevelName'];
        if (isset($o['Units'])) $this->Units = $o['Units'];
        if (isset($o['UnitsFound'])) $this->UnitsFound = $o['UnitsFound'];
        if (isset($o['Address'])) $this->Address = $o['Address'];
        if (isset($o['Unit'])) $this->Unit = $o['Unit'];
        if (isset($o['Zip'])) $this->Zip = $o['Zip'];
        if (isset($o['DropAddress'])) $this->DropAddress = $o['DropAddress'];
        if (isset($o['RecipientName'])) $this->RecipientName = $o['RecipientName'];
        if (isset($o['Handoff'])) $this->Handoff = $o['Handoff'];
        if (isset($o['IsAsap'])) $this->IsAsap = $o['IsAsap'];
        if (isset($o['DayIx'])) $this->DayIx = $o['DayIx'];
        if (isset($o['DateText'])) $this->DateText = $o['DateText'];
        if (isset($o['StartMin'])) $this->StartMin = $o['StartMin'];
        if (isset($o['EndMin'])) $this->EndMin = $o['EndMin'];
        if (isset($o['DriverFirstName'])) $this->DriverFirstName = $o['DriverFirstName'];
        if (isset($o['EtaMin'])) $this->EtaMin = $o['EtaMin'];
        if (isset($o['Promise'])) $this->Promise = $o['Promise'];
        if (isset($o['PayMode'])) $this->PayMode = $o['PayMode'];
        if (isset($o['Amount'])) $this->Amount = $o['Amount'];
        if (isset($o['Charged'])) $this->Charged = $o['Charged'];
        if (isset($o['Tip'])) $this->Tip = $o['Tip'];
        if (isset($o['CardLast4'])) $this->CardLast4 = $o['CardLast4'];
        if (isset($o['RecurrenceId'])) $this->RecurrenceId = $o['RecurrenceId'];
        if (isset($o['Steps'])) $this->Steps = JsonConverters::fromArray('CustomerAppStep', $o['Steps']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->Code)) $o['Code'] = $this->Code;
        if (isset($this->Status)) $o['Status'] = $this->Status;
        if (isset($this->State)) $o['State'] = $this->State;
        if (isset($this->Active)) $o['Active'] = $this->Active;
        if (isset($this->LevelCode)) $o['LevelCode'] = $this->LevelCode;
        if (isset($this->LevelName)) $o['LevelName'] = $this->LevelName;
        if (isset($this->Units)) $o['Units'] = $this->Units;
        if (isset($this->UnitsFound)) $o['UnitsFound'] = $this->UnitsFound;
        if (isset($this->Address)) $o['Address'] = $this->Address;
        if (isset($this->Unit)) $o['Unit'] = $this->Unit;
        if (isset($this->Zip)) $o['Zip'] = $this->Zip;
        if (isset($this->DropAddress)) $o['DropAddress'] = $this->DropAddress;
        if (isset($this->RecipientName)) $o['RecipientName'] = $this->RecipientName;
        if (isset($this->Handoff)) $o['Handoff'] = $this->Handoff;
        if (isset($this->IsAsap)) $o['IsAsap'] = $this->IsAsap;
        if (isset($this->DayIx)) $o['DayIx'] = $this->DayIx;
        if (isset($this->DateText)) $o['DateText'] = $this->DateText;
        if (isset($this->StartMin)) $o['StartMin'] = $this->StartMin;
        if (isset($this->EndMin)) $o['EndMin'] = $this->EndMin;
        if (isset($this->DriverFirstName)) $o['DriverFirstName'] = $this->DriverFirstName;
        if (isset($this->EtaMin)) $o['EtaMin'] = $this->EtaMin;
        if (isset($this->Promise)) $o['Promise'] = $this->Promise;
        if (isset($this->PayMode)) $o['PayMode'] = $this->PayMode;
        if (isset($this->Amount)) $o['Amount'] = $this->Amount;
        if (isset($this->Charged)) $o['Charged'] = $this->Charged;
        if (isset($this->Tip)) $o['Tip'] = $this->Tip;
        if (isset($this->CardLast4)) $o['CardLast4'] = $this->CardLast4;
        if (isset($this->RecurrenceId)) $o['RecurrenceId'] = $this->RecurrenceId;
        if (isset($this->Steps)) $o['Steps'] = JsonConverters::toArray('CustomerAppStep', $this->Steps);
        return empty($o) ? new class(){} : $o;
    }
}

class CustomerAppRecurrence implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Id=0,
        /** @var int */
        public int $Weekday=0,
        /** @var int */
        public int $StartMin=0,
        /** @var int */
        public int $EndMin=0,
        /** @var string|null */
        public ?string $Cadence=null,
        /** @var string|null */
        public ?string $LevelCode=null,
        /** @var int */
        public int $Units=0,
        /** @var string|null */
        public ?string $Handoff=null,
        /** @var string|null */
        public ?string $Address=null,
        /** @var bool|null */
        public ?bool $Paused=null,
        /** @var string|null */
        public ?string $PayMode=null,
        /** @var string|null */
        public ?string $CardLast4=null,
        /** @var string|null */
        public ?string $NextDate=null,
        /** @var string|null */
        public ?string $SkippedDate=null,
        /** @var int */
        public int $AheadDays=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Id'])) $this->Id = $o['Id'];
        if (isset($o['Weekday'])) $this->Weekday = $o['Weekday'];
        if (isset($o['StartMin'])) $this->StartMin = $o['StartMin'];
        if (isset($o['EndMin'])) $this->EndMin = $o['EndMin'];
        if (isset($o['Cadence'])) $this->Cadence = $o['Cadence'];
        if (isset($o['LevelCode'])) $this->LevelCode = $o['LevelCode'];
        if (isset($o['Units'])) $this->Units = $o['Units'];
        if (isset($o['Handoff'])) $this->Handoff = $o['Handoff'];
        if (isset($o['Address'])) $this->Address = $o['Address'];
        if (isset($o['Paused'])) $this->Paused = $o['Paused'];
        if (isset($o['PayMode'])) $this->PayMode = $o['PayMode'];
        if (isset($o['CardLast4'])) $this->CardLast4 = $o['CardLast4'];
        if (isset($o['NextDate'])) $this->NextDate = $o['NextDate'];
        if (isset($o['SkippedDate'])) $this->SkippedDate = $o['SkippedDate'];
        if (isset($o['AheadDays'])) $this->AheadDays = $o['AheadDays'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Id)) $o['Id'] = $this->Id;
        if (isset($this->Weekday)) $o['Weekday'] = $this->Weekday;
        if (isset($this->StartMin)) $o['StartMin'] = $this->StartMin;
        if (isset($this->EndMin)) $o['EndMin'] = $this->EndMin;
        if (isset($this->Cadence)) $o['Cadence'] = $this->Cadence;
        if (isset($this->LevelCode)) $o['LevelCode'] = $this->LevelCode;
        if (isset($this->Units)) $o['Units'] = $this->Units;
        if (isset($this->Handoff)) $o['Handoff'] = $this->Handoff;
        if (isset($this->Address)) $o['Address'] = $this->Address;
        if (isset($this->Paused)) $o['Paused'] = $this->Paused;
        if (isset($this->PayMode)) $o['PayMode'] = $this->PayMode;
        if (isset($this->CardLast4)) $o['CardLast4'] = $this->CardLast4;
        if (isset($this->NextDate)) $o['NextDate'] = $this->NextDate;
        if (isset($this->SkippedDate)) $o['SkippedDate'] = $this->SkippedDate;
        if (isset($this->AheadDays)) $o['AheadDays'] = $this->AheadDays;
        return empty($o) ? new class(){} : $o;
    }
}

class CustomerAppInvoice implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $Uid='',
        /** @var string|null */
        public ?string $Number=null,
        /** @var string|null */
        public ?string $DateText=null,
        /** @var float */
        public float $Total=0.0,
        /** @var float */
        public float $Balance=0.0,
        /** @var bool|null */
        public ?bool $Paid=null
    ) {
    }

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

class CustomerAppMe implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $ContactId=0,
        /** @var string|null */
        public ?string $FirstName=null,
        /** @var string|null */
        public ?string $LastName=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Phone=null,
        /** @var bool|null */
        public ?bool $NeedsName=null,
        /** @var string|null */
        public ?string $BillingMode=null,
        /** @var string|null */
        public ?string $AccountCode=null,
        /** @var array<CustomerAppAddress>|null */
        public ?array $Addresses=null,
        /** @var array<CustomerAppCard>|null */
        public ?array $Cards=null,
        /** @var CustomerAppNotif|null */
        public ?CustomerAppNotif $Notif=null,
        /** @var array<CustomerAppOrder>|null */
        public ?array $Orders=null,
        /** @var array<CustomerAppRecurrence>|null */
        public ?array $Recurring=null,
        /** @var array<CustomerAppInvoice>|null */
        public ?array $Invoices=null,
        /** @var string|null */
        public ?string $Today=null,
        /** @var int */
        public int $NowMin=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ContactId'])) $this->ContactId = $o['ContactId'];
        if (isset($o['FirstName'])) $this->FirstName = $o['FirstName'];
        if (isset($o['LastName'])) $this->LastName = $o['LastName'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Phone'])) $this->Phone = $o['Phone'];
        if (isset($o['NeedsName'])) $this->NeedsName = $o['NeedsName'];
        if (isset($o['BillingMode'])) $this->BillingMode = $o['BillingMode'];
        if (isset($o['AccountCode'])) $this->AccountCode = $o['AccountCode'];
        if (isset($o['Addresses'])) $this->Addresses = JsonConverters::fromArray('CustomerAppAddress', $o['Addresses']);
        if (isset($o['Cards'])) $this->Cards = JsonConverters::fromArray('CustomerAppCard', $o['Cards']);
        if (isset($o['Notif'])) $this->Notif = JsonConverters::from('CustomerAppNotif', $o['Notif']);
        if (isset($o['Orders'])) $this->Orders = JsonConverters::fromArray('CustomerAppOrder', $o['Orders']);
        if (isset($o['Recurring'])) $this->Recurring = JsonConverters::fromArray('CustomerAppRecurrence', $o['Recurring']);
        if (isset($o['Invoices'])) $this->Invoices = JsonConverters::fromArray('CustomerAppInvoice', $o['Invoices']);
        if (isset($o['Today'])) $this->Today = $o['Today'];
        if (isset($o['NowMin'])) $this->NowMin = $o['NowMin'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ContactId)) $o['ContactId'] = $this->ContactId;
        if (isset($this->FirstName)) $o['FirstName'] = $this->FirstName;
        if (isset($this->LastName)) $o['LastName'] = $this->LastName;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Phone)) $o['Phone'] = $this->Phone;
        if (isset($this->NeedsName)) $o['NeedsName'] = $this->NeedsName;
        if (isset($this->BillingMode)) $o['BillingMode'] = $this->BillingMode;
        if (isset($this->AccountCode)) $o['AccountCode'] = $this->AccountCode;
        if (isset($this->Addresses)) $o['Addresses'] = JsonConverters::toArray('CustomerAppAddress', $this->Addresses);
        if (isset($this->Cards)) $o['Cards'] = JsonConverters::toArray('CustomerAppCard', $this->Cards);
        if (isset($this->Notif)) $o['Notif'] = JsonConverters::to('CustomerAppNotif', $this->Notif);
        if (isset($this->Orders)) $o['Orders'] = JsonConverters::toArray('CustomerAppOrder', $this->Orders);
        if (isset($this->Recurring)) $o['Recurring'] = JsonConverters::toArray('CustomerAppRecurrence', $this->Recurring);
        if (isset($this->Invoices)) $o['Invoices'] = JsonConverters::toArray('CustomerAppInvoice', $this->Invoices);
        if (isset($this->Today)) $o['Today'] = $this->Today;
        if (isset($this->NowMin)) $o['NowMin'] = $this->NowMin;
        return empty($o) ? new class(){} : $o;
    }
}

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 CourierCustomerRow implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $ContactId=0,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Phone=null,
        /** @var string|null */
        public ?string $BillingMode=null,
        /** @var string|null */
        public ?string $AccountCode=null,
        /** @var int */
        public int $Orders=0,
        /** @var DateTime|null */
        public ?DateTime $LastOrderAt=null,
        /** @var int */
        public int $Unbilled=0,
        /** @var float */
        public float $UnbilledAmount=0.0,
        /** @var int */
        public int $Cards=0
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ContactId'])) $this->ContactId = $o['ContactId'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Phone'])) $this->Phone = $o['Phone'];
        if (isset($o['BillingMode'])) $this->BillingMode = $o['BillingMode'];
        if (isset($o['AccountCode'])) $this->AccountCode = $o['AccountCode'];
        if (isset($o['Orders'])) $this->Orders = $o['Orders'];
        if (isset($o['LastOrderAt'])) $this->LastOrderAt = JsonConverters::from('DateTime', $o['LastOrderAt']);
        if (isset($o['Unbilled'])) $this->Unbilled = $o['Unbilled'];
        if (isset($o['UnbilledAmount'])) $this->UnbilledAmount = $o['UnbilledAmount'];
        if (isset($o['Cards'])) $this->Cards = $o['Cards'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ContactId)) $o['ContactId'] = $this->ContactId;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Phone)) $o['Phone'] = $this->Phone;
        if (isset($this->BillingMode)) $o['BillingMode'] = $this->BillingMode;
        if (isset($this->AccountCode)) $o['AccountCode'] = $this->AccountCode;
        if (isset($this->Orders)) $o['Orders'] = $this->Orders;
        if (isset($this->LastOrderAt)) $o['LastOrderAt'] = JsonConverters::to('DateTime', $this->LastOrderAt);
        if (isset($this->Unbilled)) $o['Unbilled'] = $this->Unbilled;
        if (isset($this->UnbilledAmount)) $o['UnbilledAmount'] = $this->UnbilledAmount;
        if (isset($this->Cards)) $o['Cards'] = $this->Cards;
        return empty($o) ? new class(){} : $o;
    }
}

class RunResult implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $Invoices=0,
        /** @var int */
        public int $Orders=0,
        /** @var float */
        public float $Total=0.0,
        /** @var array<string>|null */
        public ?array $Skipped=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Invoices'])) $this->Invoices = $o['Invoices'];
        if (isset($o['Orders'])) $this->Orders = $o['Orders'];
        if (isset($o['Total'])) $this->Total = $o['Total'];
        if (isset($o['Skipped'])) $this->Skipped = JsonConverters::fromArray('string', $o['Skipped']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Invoices)) $o['Invoices'] = $this->Invoices;
        if (isset($this->Orders)) $o['Orders'] = $this->Orders;
        if (isset($this->Total)) $o['Total'] = $this->Total;
        if (isset($this->Skipped)) $o['Skipped'] = JsonConverters::toArray('string', $this->Skipped);
        return empty($o) ? new class(){} : $o;
    }
}

class CustomerAppResponse implements JsonSerializable
{
    public function __construct(
        /** @var CustomerAppBoot|null */
        public ?CustomerAppBoot $Boot=null,
        /** @var CustomerAppMe|null */
        public ?CustomerAppMe $Customer=null,
        /** @var array<CustomerAppAddress>|null */
        public ?array $Addresses=null,
        /** @var array<CustomerAppCard>|null */
        public ?array $Cards=null,
        /** @var CustomerAppNotif|null */
        public ?CustomerAppNotif $Notif=null,
        /** @var array<CustomerAppRecurrence>|null */
        public ?array $Recurring=null,
        /** @var CourierBookOrderResponse|null */
        public ?CourierBookOrderResponse $Booked=null,
        /** @var bool|null */
        public ?bool $Sent=null,
        /** @var string|null */
        public ?string $Token=null,
        /** @var bool|null */
        public ?bool $NeedsName=null,
        /** @var string|null */
        public ?string $Name=null,
        /** @var string|null */
        public ?string $Url=null,
        /** @var string|null */
        public ?string $ClientSecret=null,
        /** @var string|null */
        public ?string $PublishableKey=null,
        /** @var string|null */
        public ?string $Message=null,
        /** @var string|null */
        public ?string $ReopenStep=null,
        /** @var array<CourierCustomerRow>|null */
        public ?array $Customers=null,
        /** @var RunResult|null */
        public ?RunResult $Run=null,
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['Boot'])) $this->Boot = JsonConverters::from('CustomerAppBoot', $o['Boot']);
        if (isset($o['Customer'])) $this->Customer = JsonConverters::from('CustomerAppMe', $o['Customer']);
        if (isset($o['Addresses'])) $this->Addresses = JsonConverters::fromArray('CustomerAppAddress', $o['Addresses']);
        if (isset($o['Cards'])) $this->Cards = JsonConverters::fromArray('CustomerAppCard', $o['Cards']);
        if (isset($o['Notif'])) $this->Notif = JsonConverters::from('CustomerAppNotif', $o['Notif']);
        if (isset($o['Recurring'])) $this->Recurring = JsonConverters::fromArray('CustomerAppRecurrence', $o['Recurring']);
        if (isset($o['Booked'])) $this->Booked = JsonConverters::from('CourierBookOrderResponse', $o['Booked']);
        if (isset($o['Sent'])) $this->Sent = $o['Sent'];
        if (isset($o['Token'])) $this->Token = $o['Token'];
        if (isset($o['NeedsName'])) $this->NeedsName = $o['NeedsName'];
        if (isset($o['Name'])) $this->Name = $o['Name'];
        if (isset($o['Url'])) $this->Url = $o['Url'];
        if (isset($o['ClientSecret'])) $this->ClientSecret = $o['ClientSecret'];
        if (isset($o['PublishableKey'])) $this->PublishableKey = $o['PublishableKey'];
        if (isset($o['Message'])) $this->Message = $o['Message'];
        if (isset($o['ReopenStep'])) $this->ReopenStep = $o['ReopenStep'];
        if (isset($o['Customers'])) $this->Customers = JsonConverters::fromArray('CourierCustomerRow', $o['Customers']);
        if (isset($o['Run'])) $this->Run = JsonConverters::from('RunResult', $o['Run']);
        if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->Boot)) $o['Boot'] = JsonConverters::to('CustomerAppBoot', $this->Boot);
        if (isset($this->Customer)) $o['Customer'] = JsonConverters::to('CustomerAppMe', $this->Customer);
        if (isset($this->Addresses)) $o['Addresses'] = JsonConverters::toArray('CustomerAppAddress', $this->Addresses);
        if (isset($this->Cards)) $o['Cards'] = JsonConverters::toArray('CustomerAppCard', $this->Cards);
        if (isset($this->Notif)) $o['Notif'] = JsonConverters::to('CustomerAppNotif', $this->Notif);
        if (isset($this->Recurring)) $o['Recurring'] = JsonConverters::toArray('CustomerAppRecurrence', $this->Recurring);
        if (isset($this->Booked)) $o['Booked'] = JsonConverters::to('CourierBookOrderResponse', $this->Booked);
        if (isset($this->Sent)) $o['Sent'] = $this->Sent;
        if (isset($this->Token)) $o['Token'] = $this->Token;
        if (isset($this->NeedsName)) $o['NeedsName'] = $this->NeedsName;
        if (isset($this->Name)) $o['Name'] = $this->Name;
        if (isset($this->Url)) $o['Url'] = $this->Url;
        if (isset($this->ClientSecret)) $o['ClientSecret'] = $this->ClientSecret;
        if (isset($this->PublishableKey)) $o['PublishableKey'] = $this->PublishableKey;
        if (isset($this->Message)) $o['Message'] = $this->Message;
        if (isset($this->ReopenStep)) $o['ReopenStep'] = $this->ReopenStep;
        if (isset($this->Customers)) $o['Customers'] = JsonConverters::toArray('CourierCustomerRow', $this->Customers);
        if (isset($this->Run)) $o['Run'] = JsonConverters::to('RunResult', $this->Run);
        if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
        return empty($o) ? new class(){} : $o;
    }
}

class CustomerAppInvoicePayRequest extends CustomerAppSessionRequest implements JsonSerializable
{
    /**
     * @param string|null $Slug
     * @param string|null $Profile
     */
    public function __construct(
        ?string $Slug=null,
        ?string $Profile=null,
        /** @var string */
        public string $Uid=''
    ) {
        parent::__construct($Slug,$Profile);
    }

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

PHP CustomerAppInvoicePayRequest 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/c/app/invoices/{Uid}/pay HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<CustomerAppInvoicePayRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Profile>String</Profile>
  <Slug>String</Slug>
  <Uid>00000000-0000-0000-0000-000000000000</Uid>
</CustomerAppInvoicePayRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<CustomerAppResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <Addresses>
    <CustomerAppAddress>
      <City>String</City>
      <Id>0</Id>
      <InArea>false</InArea>
      <Label>String</Label>
      <Lat>0</Lat>
      <Lng>0</Lng>
      <Street>String</Street>
      <Unit>String</Unit>
      <Zip>String</Zip>
    </CustomerAppAddress>
  </Addresses>
  <Booked>
    <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:d3p1="http://schemas.servicestack.net/types">
      <d3p1:ErrorCode>String</d3p1:ErrorCode>
      <d3p1:Message>String</d3p1:Message>
      <d3p1:StackTrace>String</d3p1:StackTrace>
      <d3p1:Errors>
        <d3p1:ResponseError>
          <d3p1:ErrorCode>String</d3p1:ErrorCode>
          <d3p1:FieldName>String</d3p1:FieldName>
          <d3p1:Message>String</d3p1:Message>
          <d3p1:Meta xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <d6p1:KeyValueOfstringstring>
              <d6p1:Key>String</d6p1:Key>
              <d6p1:Value>String</d6p1:Value>
            </d6p1:KeyValueOfstringstring>
          </d3p1:Meta>
        </d3p1:ResponseError>
      </d3p1:Errors>
      <d3p1:Meta xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:KeyValueOfstringstring>
          <d4p1:Key>String</d4p1:Key>
          <d4p1:Value>String</d4p1:Value>
        </d4p1:KeyValueOfstringstring>
      </d3p1:Meta>
    </ResponseStatus>
    <SetupIntentId>String</SetupIntentId>
    <Total>0</Total>
    <TrackUrl>String</TrackUrl>
    <WindowText>String</WindowText>
  </Booked>
  <Boot>
    <AuthMethod>String</AuthMethod>
    <Available>false</Available>
    <ManifestUrl>String</ManifestUrl>
    <Page>
      <AppUrl>String</AppUrl>
      <Available>false</Available>
      <BookingOn>false</BookingOn>
      <Business>
        <Name>String</Name>
        <Phone>String</Phone>
      </Business>
      <CardEnabled>false</CardEnabled>
      <NowMin>0</NowMin>
      <Profile>
        <Asap>false</Asap>
        <CancelFee>0</CancelFee>
        <Code>String</Code>
        <FacilityName>String</FacilityName>
        <FacilityNoun>String</FacilityNoun>
        <FacilityNounEs>String</FacilityNounEs>
        <FinalAfterCount>false</FinalAfterCount>
        <Handoffs>
          <CodeRequired>false</CodeRequired>
          <Desk>false</Desk>
          <Hand>false</Hand>
          <IdRequired>false</IdRequired>
          <Porch>false</Porch>
          <SigRequired>false</SigRequired>
        </Handoffs>
        <Levels>
          <CourierBookLevel>
            <Code>String</Code>
            <Days xmlns:d7p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
              <d7p1:int>0</d7p1:int>
            </Days>
            <DeadlineMin>0</DeadlineMin>
            <InBy>String</InBy>
            <Name>String</Name>
            <Ready>String</Ready>
            <Surcharge>0</Surcharge>
            <WithinMin>0</WithinMin>
          </CourierBookLevel>
        </Levels>
        <MissedFee>0</MissedFee>
        <MissedWaitMin>0</MissedWaitMin>
        <Name>String</Name>
        <PayTiming>String</PayTiming>
        <Recurring>false</Recurring>
        <ServiceArea xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:string>String</d5p1:string>
        </ServiceArea>
        <Shape>String</Shape>
        <Template>String</Template>
        <UnitMany>String</UnitMany>
        <UnitManyEs>String</UnitManyEs>
        <UnitOne>String</UnitOne>
        <UnitOneEs>String</UnitOneEs>
        <Zips xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:string>String</d5p1:string>
        </Zips>
      </Profile>
      <Profiles>
        <CourierBookProfileLink>
          <Code>String</Code>
          <Name>String</Name>
          <Shape>String</Shape>
        </CourierBookProfileLink>
      </Profiles>
      <PublishableKey>String</PublishableKey>
      <Today>String</Today>
      <Weekday>0</Weekday>
    </Page>
    <Profile>String</Profile>
    <Reason>String</Reason>
    <Slug>String</Slug>
  </Boot>
  <Cards>
    <CustomerAppCard>
      <Brand>String</Brand>
      <Id>0</Id>
      <IsDefault>false</IsDefault>
      <Label>String</Label>
      <Last4>String</Last4>
    </CustomerAppCard>
  </Cards>
  <ClientSecret>String</ClientSecret>
  <Customer>
    <AccountCode>String</AccountCode>
    <Addresses>
      <CustomerAppAddress>
        <City>String</City>
        <Id>0</Id>
        <InArea>false</InArea>
        <Label>String</Label>
        <Lat>0</Lat>
        <Lng>0</Lng>
        <Street>String</Street>
        <Unit>String</Unit>
        <Zip>String</Zip>
      </CustomerAppAddress>
    </Addresses>
    <BillingMode>String</BillingMode>
    <Cards>
      <CustomerAppCard>
        <Brand>String</Brand>
        <Id>0</Id>
        <IsDefault>false</IsDefault>
        <Label>String</Label>
        <Last4>String</Last4>
      </CustomerAppCard>
    </Cards>
    <ContactId>0</ContactId>
    <FirstName>String</FirstName>
    <Invoices>
      <CustomerAppInvoice>
        <Balance>0</Balance>
        <DateText>String</DateText>
        <Number>String</Number>
        <Paid>false</Paid>
        <Total>0</Total>
        <Uid>00000000-0000-0000-0000-000000000000</Uid>
      </CustomerAppInvoice>
    </Invoices>
    <LastName>String</LastName>
    <Name>String</Name>
    <NeedsName>false</NeedsName>
    <Notif>
      <Promos>false</Promos>
      <Push>false</Push>
      <Texts>false</Texts>
    </Notif>
    <NowMin>0</NowMin>
    <Orders>
      <CustomerAppOrder>
        <Active>false</Active>
        <Address>String</Address>
        <Amount>0</Amount>
        <CardLast4>String</CardLast4>
        <Charged>0</Charged>
        <Code>String</Code>
        <DateText>String</DateText>
        <DayIx>0</DayIx>
        <DriverFirstName>String</DriverFirstName>
        <DropAddress>String</DropAddress>
        <EndMin>0</EndMin>
        <EtaMin>0</EtaMin>
        <Handoff>String</Handoff>
        <Id>0</Id>
        <IsAsap>false</IsAsap>
        <LevelCode>String</LevelCode>
        <LevelName>String</LevelName>
        <PayMode>String</PayMode>
        <Promise>String</Promise>
        <RecipientName>String</RecipientName>
        <RecurrenceId>0</RecurrenceId>
        <StartMin>0</StartMin>
        <State>String</State>
        <Status>String</Status>
        <Steps>
          <CustomerAppStep>
            <Done>false</Done>
            <Key>String</Key>
            <Time>String</Time>
          </CustomerAppStep>
        </Steps>
        <Tip>0</Tip>
        <Unit>String</Unit>
        <Units>0</Units>
        <UnitsFound>0</UnitsFound>
        <Zip>String</Zip>
      </CustomerAppOrder>
    </Orders>
    <Phone>String</Phone>
    <Recurring>
      <CustomerAppRecurrence>
        <Address>String</Address>
        <AheadDays>0</AheadDays>
        <Cadence>String</Cadence>
        <CardLast4>String</CardLast4>
        <EndMin>0</EndMin>
        <Handoff>String</Handoff>
        <Id>0</Id>
        <LevelCode>String</LevelCode>
        <NextDate>String</NextDate>
        <Paused>false</Paused>
        <PayMode>String</PayMode>
        <SkippedDate>String</SkippedDate>
        <StartMin>0</StartMin>
        <Units>0</Units>
        <Weekday>0</Weekday>
      </CustomerAppRecurrence>
    </Recurring>
    <Today>String</Today>
  </Customer>
  <Customers>
    <CourierCustomerRow>
      <AccountCode>String</AccountCode>
      <BillingMode>String</BillingMode>
      <Cards>0</Cards>
      <ContactId>0</ContactId>
      <LastOrderAt>0001-01-01T00:00:00</LastOrderAt>
      <Name>String</Name>
      <Orders>0</Orders>
      <Phone>String</Phone>
      <Unbilled>0</Unbilled>
      <UnbilledAmount>0</UnbilledAmount>
    </CourierCustomerRow>
  </Customers>
  <Message>String</Message>
  <Name>String</Name>
  <NeedsName>false</NeedsName>
  <Notif>
    <Promos>false</Promos>
    <Push>false</Push>
    <Texts>false</Texts>
  </Notif>
  <PublishableKey>String</PublishableKey>
  <Recurring>
    <CustomerAppRecurrence>
      <Address>String</Address>
      <AheadDays>0</AheadDays>
      <Cadence>String</Cadence>
      <CardLast4>String</CardLast4>
      <EndMin>0</EndMin>
      <Handoff>String</Handoff>
      <Id>0</Id>
      <LevelCode>String</LevelCode>
      <NextDate>String</NextDate>
      <Paused>false</Paused>
      <PayMode>String</PayMode>
      <SkippedDate>String</SkippedDate>
      <StartMin>0</StartMin>
      <Units>0</Units>
      <Weekday>0</Weekday>
    </CustomerAppRecurrence>
  </Recurring>
  <ReopenStep>String</ReopenStep>
  <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>
  <Run>
    <Invoices>0</Invoices>
    <Orders>0</Orders>
    <Skipped xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:string>String</d3p1:string>
    </Skipped>
    <Total>0</Total>
  </Run>
  <Sent>false</Sent>
  <Token>String</Token>
  <Url>String</Url>
</CustomerAppResponse>