Trendsic Platform Service

<back to all web services

OrderLinesToMultiRequest

The following routes are available for this service:
POST, OPTIONS/v1/OrderLinesToMulti
<?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 OrderLine implements JsonSerializable
{
    public function __construct(
        /** @var int */
        public int $ID=0,
        /** @var string */
        public string $OrderHeaderID='',
        /** @var int */
        public int $OrderLineNumber=0,
        /** @var int */
        public int $ProductID=0,
        /** @var string|null */
        public ?string $StripeProductId=null,
        /** @var int */
        public int $ProductCategory=0,
        /** @var int */
        public int $ProductSubCategory=0,
        /** @var int */
        public int $Quantity=0,
        /** @var float */
        public float $TotalOrderLineCost=0.0,
        /** @var float */
        public float $ProductCost=0.0,
        /** @var float */
        public float $PerUnitProductCost=0.0,
        /** @var float */
        public float $OrderLineTax=0.0,
        /** @var float */
        public float $OrderLineShippingCost=0.0,
        /** @var float */
        public float $PerUnitShippingCost=0.0,
        /** @var int */
        public int $OrderLineStatusID=0,
        /** @var int */
        public int $ShipMethodID=0,
        /** @var DateTime */
        public DateTime $EstimatedShipDate=new DateTime(),
        /** @var DateTime */
        public DateTime $EstimatedDeliveryDate=new DateTime(),
        /** @var DateTime */
        public DateTime $ActualShipDate=new DateTime(),
        /** @var DateTime */
        public DateTime $ActualDeliveryDate=new DateTime(),
        /** @var DateTime */
        public DateTime $OrderLineCreatedDate=new DateTime(),
        /** @var DateTime */
        public DateTime $OrderLineModifiedDate=new DateTime(),
        /** @var string */
        public string $UID='',
        /** @var string|null */
        public ?string $ProductName=null,
        /** @var int */
        public int $AgentId=0,
        /** @var string|null */
        public ?string $Street=null,
        /** @var string|null */
        public ?string $City=null,
        /** @var string|null */
        public ?string $State=null,
        /** @var string|null */
        public ?string $Zip=null,
        /** @var string|null */
        public ?string $PhoneNumber=null,
        /** @var int */
        public int $AddressId=0,
        /** @var string|null */
        public ?string $ShippingAddress=null,
        /** @var string|null */
        public ?string $FullName=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['ID'])) $this->ID = $o['ID'];
        if (isset($o['OrderHeaderID'])) $this->OrderHeaderID = $o['OrderHeaderID'];
        if (isset($o['OrderLineNumber'])) $this->OrderLineNumber = $o['OrderLineNumber'];
        if (isset($o['ProductID'])) $this->ProductID = $o['ProductID'];
        if (isset($o['StripeProductId'])) $this->StripeProductId = $o['StripeProductId'];
        if (isset($o['ProductCategory'])) $this->ProductCategory = $o['ProductCategory'];
        if (isset($o['ProductSubCategory'])) $this->ProductSubCategory = $o['ProductSubCategory'];
        if (isset($o['Quantity'])) $this->Quantity = $o['Quantity'];
        if (isset($o['TotalOrderLineCost'])) $this->TotalOrderLineCost = $o['TotalOrderLineCost'];
        if (isset($o['ProductCost'])) $this->ProductCost = $o['ProductCost'];
        if (isset($o['PerUnitProductCost'])) $this->PerUnitProductCost = $o['PerUnitProductCost'];
        if (isset($o['OrderLineTax'])) $this->OrderLineTax = $o['OrderLineTax'];
        if (isset($o['OrderLineShippingCost'])) $this->OrderLineShippingCost = $o['OrderLineShippingCost'];
        if (isset($o['PerUnitShippingCost'])) $this->PerUnitShippingCost = $o['PerUnitShippingCost'];
        if (isset($o['OrderLineStatusID'])) $this->OrderLineStatusID = $o['OrderLineStatusID'];
        if (isset($o['ShipMethodID'])) $this->ShipMethodID = $o['ShipMethodID'];
        if (isset($o['EstimatedShipDate'])) $this->EstimatedShipDate = JsonConverters::from('DateTime', $o['EstimatedShipDate']);
        if (isset($o['EstimatedDeliveryDate'])) $this->EstimatedDeliveryDate = JsonConverters::from('DateTime', $o['EstimatedDeliveryDate']);
        if (isset($o['ActualShipDate'])) $this->ActualShipDate = JsonConverters::from('DateTime', $o['ActualShipDate']);
        if (isset($o['ActualDeliveryDate'])) $this->ActualDeliveryDate = JsonConverters::from('DateTime', $o['ActualDeliveryDate']);
        if (isset($o['OrderLineCreatedDate'])) $this->OrderLineCreatedDate = JsonConverters::from('DateTime', $o['OrderLineCreatedDate']);
        if (isset($o['OrderLineModifiedDate'])) $this->OrderLineModifiedDate = JsonConverters::from('DateTime', $o['OrderLineModifiedDate']);
        if (isset($o['UID'])) $this->UID = $o['UID'];
        if (isset($o['ProductName'])) $this->ProductName = $o['ProductName'];
        if (isset($o['AgentId'])) $this->AgentId = $o['AgentId'];
        if (isset($o['Street'])) $this->Street = $o['Street'];
        if (isset($o['City'])) $this->City = $o['City'];
        if (isset($o['State'])) $this->State = $o['State'];
        if (isset($o['Zip'])) $this->Zip = $o['Zip'];
        if (isset($o['PhoneNumber'])) $this->PhoneNumber = $o['PhoneNumber'];
        if (isset($o['AddressId'])) $this->AddressId = $o['AddressId'];
        if (isset($o['ShippingAddress'])) $this->ShippingAddress = $o['ShippingAddress'];
        if (isset($o['FullName'])) $this->FullName = $o['FullName'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->ID)) $o['ID'] = $this->ID;
        if (isset($this->OrderHeaderID)) $o['OrderHeaderID'] = $this->OrderHeaderID;
        if (isset($this->OrderLineNumber)) $o['OrderLineNumber'] = $this->OrderLineNumber;
        if (isset($this->ProductID)) $o['ProductID'] = $this->ProductID;
        if (isset($this->StripeProductId)) $o['StripeProductId'] = $this->StripeProductId;
        if (isset($this->ProductCategory)) $o['ProductCategory'] = $this->ProductCategory;
        if (isset($this->ProductSubCategory)) $o['ProductSubCategory'] = $this->ProductSubCategory;
        if (isset($this->Quantity)) $o['Quantity'] = $this->Quantity;
        if (isset($this->TotalOrderLineCost)) $o['TotalOrderLineCost'] = $this->TotalOrderLineCost;
        if (isset($this->ProductCost)) $o['ProductCost'] = $this->ProductCost;
        if (isset($this->PerUnitProductCost)) $o['PerUnitProductCost'] = $this->PerUnitProductCost;
        if (isset($this->OrderLineTax)) $o['OrderLineTax'] = $this->OrderLineTax;
        if (isset($this->OrderLineShippingCost)) $o['OrderLineShippingCost'] = $this->OrderLineShippingCost;
        if (isset($this->PerUnitShippingCost)) $o['PerUnitShippingCost'] = $this->PerUnitShippingCost;
        if (isset($this->OrderLineStatusID)) $o['OrderLineStatusID'] = $this->OrderLineStatusID;
        if (isset($this->ShipMethodID)) $o['ShipMethodID'] = $this->ShipMethodID;
        if (isset($this->EstimatedShipDate)) $o['EstimatedShipDate'] = JsonConverters::to('DateTime', $this->EstimatedShipDate);
        if (isset($this->EstimatedDeliveryDate)) $o['EstimatedDeliveryDate'] = JsonConverters::to('DateTime', $this->EstimatedDeliveryDate);
        if (isset($this->ActualShipDate)) $o['ActualShipDate'] = JsonConverters::to('DateTime', $this->ActualShipDate);
        if (isset($this->ActualDeliveryDate)) $o['ActualDeliveryDate'] = JsonConverters::to('DateTime', $this->ActualDeliveryDate);
        if (isset($this->OrderLineCreatedDate)) $o['OrderLineCreatedDate'] = JsonConverters::to('DateTime', $this->OrderLineCreatedDate);
        if (isset($this->OrderLineModifiedDate)) $o['OrderLineModifiedDate'] = JsonConverters::to('DateTime', $this->OrderLineModifiedDate);
        if (isset($this->UID)) $o['UID'] = $this->UID;
        if (isset($this->ProductName)) $o['ProductName'] = $this->ProductName;
        if (isset($this->AgentId)) $o['AgentId'] = $this->AgentId;
        if (isset($this->Street)) $o['Street'] = $this->Street;
        if (isset($this->City)) $o['City'] = $this->City;
        if (isset($this->State)) $o['State'] = $this->State;
        if (isset($this->Zip)) $o['Zip'] = $this->Zip;
        if (isset($this->PhoneNumber)) $o['PhoneNumber'] = $this->PhoneNumber;
        if (isset($this->AddressId)) $o['AddressId'] = $this->AddressId;
        if (isset($this->ShippingAddress)) $o['ShippingAddress'] = $this->ShippingAddress;
        if (isset($this->FullName)) $o['FullName'] = $this->FullName;
        return empty($o) ? new class(){} : $o;
    }
}

class OrderLinesResponse implements JsonSerializable
{
    public function __construct(
        /** @var ResponseStatus|null */
        public ?ResponseStatus $ResponseStatus=null,
        /** @var array<OrderLine>|null */
        public ?array $OrderLines=null
    ) {
    }

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

class OrderLinesToMultiRequest implements JsonSerializable
{
    public function __construct(
        /** @var string */
        public string $OrderHeaderUID='',
        /** @var array<OrderLine>|null */
        public ?array $OrderLines=null
    ) {
    }

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

PHP OrderLinesToMultiRequest 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/OrderLinesToMulti HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<OrderLinesToMultiRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <OrderHeaderUID>00000000-0000-0000-0000-000000000000</OrderHeaderUID>
  <OrderLines>
    <OrderLine>
      <ActualDeliveryDate>0001-01-01T00:00:00</ActualDeliveryDate>
      <ActualShipDate>0001-01-01T00:00:00</ActualShipDate>
      <AddressId>0</AddressId>
      <AgentId>0</AgentId>
      <City>String</City>
      <EstimatedDeliveryDate>0001-01-01T00:00:00</EstimatedDeliveryDate>
      <EstimatedShipDate>0001-01-01T00:00:00</EstimatedShipDate>
      <FullName>String</FullName>
      <ID>0</ID>
      <OrderHeaderID>00000000-0000-0000-0000-000000000000</OrderHeaderID>
      <OrderLineCreatedDate>0001-01-01T00:00:00</OrderLineCreatedDate>
      <OrderLineModifiedDate>0001-01-01T00:00:00</OrderLineModifiedDate>
      <OrderLineNumber>0</OrderLineNumber>
      <OrderLineShippingCost>0</OrderLineShippingCost>
      <OrderLineStatusID>0</OrderLineStatusID>
      <OrderLineTax>0</OrderLineTax>
      <PerUnitProductCost>0</PerUnitProductCost>
      <PerUnitShippingCost>0</PerUnitShippingCost>
      <PhoneNumber>String</PhoneNumber>
      <ProductCategory>0</ProductCategory>
      <ProductCost>0</ProductCost>
      <ProductID>0</ProductID>
      <ProductName>String</ProductName>
      <ProductSubCategory>0</ProductSubCategory>
      <Quantity>0</Quantity>
      <ShipMethodID>0</ShipMethodID>
      <ShippingAddress>String</ShippingAddress>
      <State>String</State>
      <Street>String</Street>
      <StripeProductId>String</StripeProductId>
      <TotalOrderLineCost>0</TotalOrderLineCost>
      <UID>00000000-0000-0000-0000-000000000000</UID>
      <Zip>String</Zip>
    </OrderLine>
  </OrderLines>
</OrderLinesToMultiRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<OrderLinesResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
  <OrderLines>
    <OrderLine>
      <ActualDeliveryDate>0001-01-01T00:00:00</ActualDeliveryDate>
      <ActualShipDate>0001-01-01T00:00:00</ActualShipDate>
      <AddressId>0</AddressId>
      <AgentId>0</AgentId>
      <City>String</City>
      <EstimatedDeliveryDate>0001-01-01T00:00:00</EstimatedDeliveryDate>
      <EstimatedShipDate>0001-01-01T00:00:00</EstimatedShipDate>
      <FullName>String</FullName>
      <ID>0</ID>
      <OrderHeaderID>00000000-0000-0000-0000-000000000000</OrderHeaderID>
      <OrderLineCreatedDate>0001-01-01T00:00:00</OrderLineCreatedDate>
      <OrderLineModifiedDate>0001-01-01T00:00:00</OrderLineModifiedDate>
      <OrderLineNumber>0</OrderLineNumber>
      <OrderLineShippingCost>0</OrderLineShippingCost>
      <OrderLineStatusID>0</OrderLineStatusID>
      <OrderLineTax>0</OrderLineTax>
      <PerUnitProductCost>0</PerUnitProductCost>
      <PerUnitShippingCost>0</PerUnitShippingCost>
      <PhoneNumber>String</PhoneNumber>
      <ProductCategory>0</ProductCategory>
      <ProductCost>0</ProductCost>
      <ProductID>0</ProductID>
      <ProductName>String</ProductName>
      <ProductSubCategory>0</ProductSubCategory>
      <Quantity>0</Quantity>
      <ShipMethodID>0</ShipMethodID>
      <ShippingAddress>String</ShippingAddress>
      <State>String</State>
      <Street>String</Street>
      <StripeProductId>String</StripeProductId>
      <TotalOrderLineCost>0</TotalOrderLineCost>
      <UID>00000000-0000-0000-0000-000000000000</UID>
      <Zip>String</Zip>
    </OrderLine>
  </OrderLines>
  <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>
</OrderLinesResponse>