POST | /api/CustomerOrders |
---|
<?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};
// @DataContract
class BaseRequest implements JsonSerializable
{
public function __construct(
/** @description This is your AIM API Key provided by Tri-Tech */
// @DataMember
// @ApiMember(DataType="string", Description="This is your AIM API Key provided by Tri-Tech", IsRequired=true, Name="ApiKey", ParameterType="header")
/** @var string */
public string $ApiKey='',
// @DataMember
// @ApiMember(DataType="string", Name="OAuthToken", ParameterType="header")
/** @var string|null */
public ?string $OAuthToken=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ApiKey'])) $this->ApiKey = $o['ApiKey'];
if (isset($o['OAuthToken'])) $this->OAuthToken = $o['OAuthToken'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ApiKey)) $o['ApiKey'] = $this->ApiKey;
if (isset($this->OAuthToken)) $o['OAuthToken'] = $this->OAuthToken;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class BaseSecureRequest extends BaseRequest implements JsonSerializable
{
/**
* @param string $ApiKey
* @param string|null $OAuthToken
*/
public function __construct(
string $ApiKey='',
?string $OAuthToken=null,
/** @description */
// @DataMember
// @ApiMember(DataType="string", Description="", Name="Token", ParameterType="Header")
/** @var string|null */
public ?string $Token=null,
/** @description */
// @DataMember
// @ApiMember(DataType="string", Description="", Name="DeviceId", ParameterType="Header")
/** @var string|null */
public ?string $DeviceId=null,
/** @description */
// @DataMember
// @ApiMember(DataType="string", Description="", IsRequired=true, Name="AppId", ParameterType="Header")
/** @var string */
public string $AppId=''
) {
parent::__construct($ApiKey,$OAuthToken);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['Token'])) $this->Token = $o['Token'];
if (isset($o['DeviceId'])) $this->DeviceId = $o['DeviceId'];
if (isset($o['AppId'])) $this->AppId = $o['AppId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->Token)) $o['Token'] = $this->Token;
if (isset($this->DeviceId)) $o['DeviceId'] = $this->DeviceId;
if (isset($this->AppId)) $o['AppId'] = $this->AppId;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class BaseResponseResult implements JsonSerializable
{
public function __construct(
/** @description */
// @DataMember
// @ApiMember(DataType="string", Description="", Name="StatusCode", ParameterType="body")
/** @var string|null */
public ?string $StatusCode=null,
/** @description */
// @DataMember
// @ApiMember(DataType="string", Description="", Name="Login", ParameterType="body")
/** @var string|null */
public ?string $Login=null,
/** @description */
// @DataMember
// @ApiMember(DataType="string", Description="", Name="ErrorCode", ParameterType="body")
/** @var string|null */
public ?string $ErrorCode=null,
/** @description */
// @DataMember
// @ApiMember(DataType="string", Description="", Name="ErrorDisplayText", ParameterType="body")
/** @var string|null */
public ?string $ErrorDisplayText=null,
/** @description */
// @DataMember
// @ApiMember(DataType="string", Description="", Name="ErrorMessage", ParameterType="body")
/** @var string|null */
public ?string $ErrorMessage=null,
/** @description */
// @DataMember
// @ApiMember(DataType="string", Description="", ExcludeInSchema=true, Name="DomainName", ParameterType="body")
/** @var string|null */
public ?string $DomainName=null,
/** @description */
// @DataMember
// @ApiMember(DataType="string", Description="", ExcludeInSchema=true, Name="IPAddress", ParameterType="body")
/** @var string|null */
public ?string $IpAddress=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['StatusCode'])) $this->StatusCode = $o['StatusCode'];
if (isset($o['Login'])) $this->Login = $o['Login'];
if (isset($o['ErrorCode'])) $this->ErrorCode = $o['ErrorCode'];
if (isset($o['ErrorDisplayText'])) $this->ErrorDisplayText = $o['ErrorDisplayText'];
if (isset($o['ErrorMessage'])) $this->ErrorMessage = $o['ErrorMessage'];
if (isset($o['DomainName'])) $this->DomainName = $o['DomainName'];
if (isset($o['IpAddress'])) $this->IpAddress = $o['IpAddress'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->StatusCode)) $o['StatusCode'] = $this->StatusCode;
if (isset($this->Login)) $o['Login'] = $this->Login;
if (isset($this->ErrorCode)) $o['ErrorCode'] = $this->ErrorCode;
if (isset($this->ErrorDisplayText)) $o['ErrorDisplayText'] = $this->ErrorDisplayText;
if (isset($this->ErrorMessage)) $o['ErrorMessage'] = $this->ErrorMessage;
if (isset($this->DomainName)) $o['DomainName'] = $this->DomainName;
if (isset($this->IpAddress)) $o['IpAddress'] = $this->IpAddress;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class BaseResponse implements JsonSerializable
{
public function __construct(
/** @description */
// @DataMember
// @ApiMember(DataType="BaseResponseResult", Description="", Name="Status", ParameterType="body")
/** @var BaseResponseResult|null */
public ?BaseResponseResult $Status=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['Status'])) $this->Status = JsonConverters::from('BaseResponseResult', $o['Status']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->Status)) $o['Status'] = JsonConverters::to('BaseResponseResult', $this->Status);
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class CustomerOrdersResponse extends BaseResponse implements JsonSerializable
{
/**
* @param BaseResponseResult|null $Status
*/
public function __construct(
?BaseResponseResult $Status=null
) {
parent::__construct($Status);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class ThirdPartyOrderItem implements JsonSerializable
{
public function __construct(
// @DataMember
/** @var string|null */
public ?string $ProductName=null,
// @DataMember
/** @var string|null */
public ?string $Sku=null,
// @DataMember
/** @var string|null */
public ?string $SerialNumber=null,
// @DataMember
/** @var string|null */
public ?string $WebNumber=null,
// @DataMember
/** @var string|null */
public ?string $Location=null,
// @DataMember
/** @var float */
public float $Qty=0.0,
// @DataMember
/** @var float */
public float $QtyPicked=0.0,
// @DataMember
/** @var bool|null */
public ?bool $UseQtyPicked=null,
// @DataMember
/** @var float */
public float $Price=0.0,
// @DataMember
/** @var bool|null */
public ?bool $OnApproval=null,
// @DataMember
/** @var bool|null */
public ?bool $IsECard=null,
// @DataMember
/** @var int|null */
public ?int $NiCat=null,
// @DataMember
/** @var int|null */
public ?int $NiSub=null,
// @DataMember
/** @var int|null */
public ?int $ExtPk=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ProductName'])) $this->ProductName = $o['ProductName'];
if (isset($o['Sku'])) $this->Sku = $o['Sku'];
if (isset($o['SerialNumber'])) $this->SerialNumber = $o['SerialNumber'];
if (isset($o['WebNumber'])) $this->WebNumber = $o['WebNumber'];
if (isset($o['Location'])) $this->Location = $o['Location'];
if (isset($o['Qty'])) $this->Qty = $o['Qty'];
if (isset($o['QtyPicked'])) $this->QtyPicked = $o['QtyPicked'];
if (isset($o['UseQtyPicked'])) $this->UseQtyPicked = $o['UseQtyPicked'];
if (isset($o['Price'])) $this->Price = $o['Price'];
if (isset($o['OnApproval'])) $this->OnApproval = $o['OnApproval'];
if (isset($o['IsECard'])) $this->IsECard = $o['IsECard'];
if (isset($o['NiCat'])) $this->NiCat = $o['NiCat'];
if (isset($o['NiSub'])) $this->NiSub = $o['NiSub'];
if (isset($o['ExtPk'])) $this->ExtPk = $o['ExtPk'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ProductName)) $o['ProductName'] = $this->ProductName;
if (isset($this->Sku)) $o['Sku'] = $this->Sku;
if (isset($this->SerialNumber)) $o['SerialNumber'] = $this->SerialNumber;
if (isset($this->WebNumber)) $o['WebNumber'] = $this->WebNumber;
if (isset($this->Location)) $o['Location'] = $this->Location;
if (isset($this->Qty)) $o['Qty'] = $this->Qty;
if (isset($this->QtyPicked)) $o['QtyPicked'] = $this->QtyPicked;
if (isset($this->UseQtyPicked)) $o['UseQtyPicked'] = $this->UseQtyPicked;
if (isset($this->Price)) $o['Price'] = $this->Price;
if (isset($this->OnApproval)) $o['OnApproval'] = $this->OnApproval;
if (isset($this->IsECard)) $o['IsECard'] = $this->IsECard;
if (isset($this->NiCat)) $o['NiCat'] = $this->NiCat;
if (isset($this->NiSub)) $o['NiSub'] = $this->NiSub;
if (isset($this->ExtPk)) $o['ExtPk'] = $this->ExtPk;
return empty($o) ? new class(){} : $o;
}
}
// @DataContract
class ThirdPartyOrder implements JsonSerializable
{
public function __construct(
// @DataMember
/** @var string|null */
public ?string $OrderNumber=null,
// @DataMember
/** @var DateTime */
public DateTime $OrderDate=new DateTime(),
// @DataMember
/** @var string|null */
public ?string $TransactionState=null,
// @DataMember
/** @var string|null */
public ?string $PaymentMethod=null,
// @DataMember
/** @var string|null */
public ?string $OrderNotes=null,
// @DataMember
/** @var string|null */
public ?string $AuthorizationCode=null,
// @DataMember
/** @var string|null */
public ?string $ShippingMethod=null,
// @DataMember
/** @var float */
public float $Total=0.0,
// @DataMember
/** @var float */
public float $SubTotal=0.0,
// @DataMember
/** @var float */
public float $TaxTotal=0.0,
// @DataMember
/** @var float */
public float $ShippingTotal=0.0,
// @DataMember
/** @var string|null */
public ?string $CardType=null,
// @DataMember
/** @var string|null */
public ?string $CardToken=null,
// @DataMember
/** @var string|null */
public ?string $CardSpan=null,
// @DataMember
/** @var string|null */
public ?string $CardExpirationMonth=null,
// @DataMember
/** @var string|null */
public ?string $CardExpirationYear=null,
// @DataMember
/** @var int */
public int $CustomerAcct=0,
// @DataMember
/** @var string|null */
public ?string $Email=null,
// @DataMember
/** @var string|null */
public ?string $PO=null,
// @DataMember
/** @var string|null */
public ?string $EmployeeUsername=null,
// @DataMember
/** @var float */
public float $AeOnApprovalOrderSubtotal=0.0,
// @DataMember
/** @var float */
public float $AeOnApprovalOrderShipping=0.0,
// @DataMember
/** @var string|null */
public ?string $ShippingAttn=null,
// @DataMember
/** @var string|null */
public ?string $ShippingName=null,
// @DataMember
/** @var string|null */
public ?string $ShippingFirstName=null,
// @DataMember
/** @var string|null */
public ?string $ShippingLastName=null,
// @DataMember
/** @var string|null */
public ?string $ShippingCompany=null,
// @DataMember
/** @var string|null */
public ?string $ShippingAddr1=null,
// @DataMember
/** @var string|null */
public ?string $ShippingAddr2=null,
// @DataMember
/** @var string|null */
public ?string $ShippingCity=null,
// @DataMember
/** @var string|null */
public ?string $ShippingSt=null,
// @DataMember
/** @var string|null */
public ?string $ShippingZip=null,
// @DataMember
/** @var string|null */
public ?string $ShippingCountry=null,
// @DataMember
/** @var string|null */
public ?string $ShippingPhone=null,
// @DataMember
/** @var string|null */
public ?string $BillingAttn=null,
// @DataMember
/** @var string|null */
public ?string $BillingName=null,
// @DataMember
/** @var string|null */
public ?string $BillingFirstName=null,
// @DataMember
/** @var string|null */
public ?string $BillingLastName=null,
// @DataMember
/** @var string|null */
public ?string $BillingCompany=null,
// @DataMember
/** @var string|null */
public ?string $BillingAddr1=null,
// @DataMember
/** @var string|null */
public ?string $BillingAddr2=null,
// @DataMember
/** @var string|null */
public ?string $BillingCity=null,
// @DataMember
/** @var string|null */
public ?string $BillingSt=null,
// @DataMember
/** @var string|null */
public ?string $BillingZip=null,
// @DataMember
/** @var string|null */
public ?string $BillingCountry=null,
// @DataMember
/** @var string|null */
public ?string $BillingPhone=null,
// @DataMember
/** @var string|null */
public ?string $OrderSource=null,
// @DataMember
/** @var string|null */
public ?string $CardName=null,
// @DataMember
/** @var string|null */
public ?string $PnRef=null,
// @DataMember
/** @var array<ThirdPartyOrderItem>|null */
public ?array $LineItems=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['OrderNumber'])) $this->OrderNumber = $o['OrderNumber'];
if (isset($o['OrderDate'])) $this->OrderDate = JsonConverters::from('DateTime', $o['OrderDate']);
if (isset($o['TransactionState'])) $this->TransactionState = $o['TransactionState'];
if (isset($o['PaymentMethod'])) $this->PaymentMethod = $o['PaymentMethod'];
if (isset($o['OrderNotes'])) $this->OrderNotes = $o['OrderNotes'];
if (isset($o['AuthorizationCode'])) $this->AuthorizationCode = $o['AuthorizationCode'];
if (isset($o['ShippingMethod'])) $this->ShippingMethod = $o['ShippingMethod'];
if (isset($o['Total'])) $this->Total = $o['Total'];
if (isset($o['SubTotal'])) $this->SubTotal = $o['SubTotal'];
if (isset($o['TaxTotal'])) $this->TaxTotal = $o['TaxTotal'];
if (isset($o['ShippingTotal'])) $this->ShippingTotal = $o['ShippingTotal'];
if (isset($o['CardType'])) $this->CardType = $o['CardType'];
if (isset($o['CardToken'])) $this->CardToken = $o['CardToken'];
if (isset($o['CardSpan'])) $this->CardSpan = $o['CardSpan'];
if (isset($o['CardExpirationMonth'])) $this->CardExpirationMonth = $o['CardExpirationMonth'];
if (isset($o['CardExpirationYear'])) $this->CardExpirationYear = $o['CardExpirationYear'];
if (isset($o['CustomerAcct'])) $this->CustomerAcct = $o['CustomerAcct'];
if (isset($o['Email'])) $this->Email = $o['Email'];
if (isset($o['PO'])) $this->PO = $o['PO'];
if (isset($o['EmployeeUsername'])) $this->EmployeeUsername = $o['EmployeeUsername'];
if (isset($o['AeOnApprovalOrderSubtotal'])) $this->AeOnApprovalOrderSubtotal = $o['AeOnApprovalOrderSubtotal'];
if (isset($o['AeOnApprovalOrderShipping'])) $this->AeOnApprovalOrderShipping = $o['AeOnApprovalOrderShipping'];
if (isset($o['ShippingAttn'])) $this->ShippingAttn = $o['ShippingAttn'];
if (isset($o['ShippingName'])) $this->ShippingName = $o['ShippingName'];
if (isset($o['ShippingFirstName'])) $this->ShippingFirstName = $o['ShippingFirstName'];
if (isset($o['ShippingLastName'])) $this->ShippingLastName = $o['ShippingLastName'];
if (isset($o['ShippingCompany'])) $this->ShippingCompany = $o['ShippingCompany'];
if (isset($o['ShippingAddr1'])) $this->ShippingAddr1 = $o['ShippingAddr1'];
if (isset($o['ShippingAddr2'])) $this->ShippingAddr2 = $o['ShippingAddr2'];
if (isset($o['ShippingCity'])) $this->ShippingCity = $o['ShippingCity'];
if (isset($o['ShippingSt'])) $this->ShippingSt = $o['ShippingSt'];
if (isset($o['ShippingZip'])) $this->ShippingZip = $o['ShippingZip'];
if (isset($o['ShippingCountry'])) $this->ShippingCountry = $o['ShippingCountry'];
if (isset($o['ShippingPhone'])) $this->ShippingPhone = $o['ShippingPhone'];
if (isset($o['BillingAttn'])) $this->BillingAttn = $o['BillingAttn'];
if (isset($o['BillingName'])) $this->BillingName = $o['BillingName'];
if (isset($o['BillingFirstName'])) $this->BillingFirstName = $o['BillingFirstName'];
if (isset($o['BillingLastName'])) $this->BillingLastName = $o['BillingLastName'];
if (isset($o['BillingCompany'])) $this->BillingCompany = $o['BillingCompany'];
if (isset($o['BillingAddr1'])) $this->BillingAddr1 = $o['BillingAddr1'];
if (isset($o['BillingAddr2'])) $this->BillingAddr2 = $o['BillingAddr2'];
if (isset($o['BillingCity'])) $this->BillingCity = $o['BillingCity'];
if (isset($o['BillingSt'])) $this->BillingSt = $o['BillingSt'];
if (isset($o['BillingZip'])) $this->BillingZip = $o['BillingZip'];
if (isset($o['BillingCountry'])) $this->BillingCountry = $o['BillingCountry'];
if (isset($o['BillingPhone'])) $this->BillingPhone = $o['BillingPhone'];
if (isset($o['OrderSource'])) $this->OrderSource = $o['OrderSource'];
if (isset($o['CardName'])) $this->CardName = $o['CardName'];
if (isset($o['PnRef'])) $this->PnRef = $o['PnRef'];
if (isset($o['LineItems'])) $this->LineItems = JsonConverters::fromArray('ThirdPartyOrderItem', $o['LineItems']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->OrderNumber)) $o['OrderNumber'] = $this->OrderNumber;
if (isset($this->OrderDate)) $o['OrderDate'] = JsonConverters::to('DateTime', $this->OrderDate);
if (isset($this->TransactionState)) $o['TransactionState'] = $this->TransactionState;
if (isset($this->PaymentMethod)) $o['PaymentMethod'] = $this->PaymentMethod;
if (isset($this->OrderNotes)) $o['OrderNotes'] = $this->OrderNotes;
if (isset($this->AuthorizationCode)) $o['AuthorizationCode'] = $this->AuthorizationCode;
if (isset($this->ShippingMethod)) $o['ShippingMethod'] = $this->ShippingMethod;
if (isset($this->Total)) $o['Total'] = $this->Total;
if (isset($this->SubTotal)) $o['SubTotal'] = $this->SubTotal;
if (isset($this->TaxTotal)) $o['TaxTotal'] = $this->TaxTotal;
if (isset($this->ShippingTotal)) $o['ShippingTotal'] = $this->ShippingTotal;
if (isset($this->CardType)) $o['CardType'] = $this->CardType;
if (isset($this->CardToken)) $o['CardToken'] = $this->CardToken;
if (isset($this->CardSpan)) $o['CardSpan'] = $this->CardSpan;
if (isset($this->CardExpirationMonth)) $o['CardExpirationMonth'] = $this->CardExpirationMonth;
if (isset($this->CardExpirationYear)) $o['CardExpirationYear'] = $this->CardExpirationYear;
if (isset($this->CustomerAcct)) $o['CustomerAcct'] = $this->CustomerAcct;
if (isset($this->Email)) $o['Email'] = $this->Email;
if (isset($this->PO)) $o['PO'] = $this->PO;
if (isset($this->EmployeeUsername)) $o['EmployeeUsername'] = $this->EmployeeUsername;
if (isset($this->AeOnApprovalOrderSubtotal)) $o['AeOnApprovalOrderSubtotal'] = $this->AeOnApprovalOrderSubtotal;
if (isset($this->AeOnApprovalOrderShipping)) $o['AeOnApprovalOrderShipping'] = $this->AeOnApprovalOrderShipping;
if (isset($this->ShippingAttn)) $o['ShippingAttn'] = $this->ShippingAttn;
if (isset($this->ShippingName)) $o['ShippingName'] = $this->ShippingName;
if (isset($this->ShippingFirstName)) $o['ShippingFirstName'] = $this->ShippingFirstName;
if (isset($this->ShippingLastName)) $o['ShippingLastName'] = $this->ShippingLastName;
if (isset($this->ShippingCompany)) $o['ShippingCompany'] = $this->ShippingCompany;
if (isset($this->ShippingAddr1)) $o['ShippingAddr1'] = $this->ShippingAddr1;
if (isset($this->ShippingAddr2)) $o['ShippingAddr2'] = $this->ShippingAddr2;
if (isset($this->ShippingCity)) $o['ShippingCity'] = $this->ShippingCity;
if (isset($this->ShippingSt)) $o['ShippingSt'] = $this->ShippingSt;
if (isset($this->ShippingZip)) $o['ShippingZip'] = $this->ShippingZip;
if (isset($this->ShippingCountry)) $o['ShippingCountry'] = $this->ShippingCountry;
if (isset($this->ShippingPhone)) $o['ShippingPhone'] = $this->ShippingPhone;
if (isset($this->BillingAttn)) $o['BillingAttn'] = $this->BillingAttn;
if (isset($this->BillingName)) $o['BillingName'] = $this->BillingName;
if (isset($this->BillingFirstName)) $o['BillingFirstName'] = $this->BillingFirstName;
if (isset($this->BillingLastName)) $o['BillingLastName'] = $this->BillingLastName;
if (isset($this->BillingCompany)) $o['BillingCompany'] = $this->BillingCompany;
if (isset($this->BillingAddr1)) $o['BillingAddr1'] = $this->BillingAddr1;
if (isset($this->BillingAddr2)) $o['BillingAddr2'] = $this->BillingAddr2;
if (isset($this->BillingCity)) $o['BillingCity'] = $this->BillingCity;
if (isset($this->BillingSt)) $o['BillingSt'] = $this->BillingSt;
if (isset($this->BillingZip)) $o['BillingZip'] = $this->BillingZip;
if (isset($this->BillingCountry)) $o['BillingCountry'] = $this->BillingCountry;
if (isset($this->BillingPhone)) $o['BillingPhone'] = $this->BillingPhone;
if (isset($this->OrderSource)) $o['OrderSource'] = $this->OrderSource;
if (isset($this->CardName)) $o['CardName'] = $this->CardName;
if (isset($this->PnRef)) $o['PnRef'] = $this->PnRef;
if (isset($this->LineItems)) $o['LineItems'] = JsonConverters::toArray('ThirdPartyOrderItem', $this->LineItems);
return empty($o) ? new class(){} : $o;
}
}
/** @description CustomerOrdersRequires active-e 3rd Party E-Commerce or active-e Vortx E-Commerce. */
// @DataContract
class CustomerOrdersRequest extends BaseSecureRequest implements JsonSerializable
{
/**
* @param string $ApiKey
* @param string|null $OAuthToken
* @param string|null $Token
* @param string|null $DeviceId
* @param string $AppId
*/
public function __construct(
string $ApiKey='',
?string $OAuthToken=null,
?string $Token=null,
?string $DeviceId=null,
string $AppId='',
// @DataMember
/** @var array<ThirdPartyOrder>|null */
public ?array $Orders=null
) {
parent::__construct($ApiKey,$OAuthToken,$Token,$DeviceId,$AppId);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['Orders'])) $this->Orders = JsonConverters::fromArray('ThirdPartyOrder', $o['Orders']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->Orders)) $o['Orders'] = JsonConverters::toArray('ThirdPartyOrder', $this->Orders);
return empty($o) ? new class(){} : $o;
}
}
PHP CustomerOrdersRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /api/CustomerOrders HTTP/1.1
Host: active-ewebservice.biz
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<CustomerOrdersRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AIM.WebService">
<ApiKey>String</ApiKey>
<OAuthToken>String</OAuthToken>
<AppId>String</AppId>
<DeviceId>String</DeviceId>
<Token>String</Token>
<Orders xmlns:d2p1="http://schemas.datacontract.org/2004/07/AIM.BL.Core.Misc">
<d2p1:ThirdPartyOrder>
<d2p1:AeOnApprovalOrderShipping>0</d2p1:AeOnApprovalOrderShipping>
<d2p1:AeOnApprovalOrderSubtotal>0</d2p1:AeOnApprovalOrderSubtotal>
<d2p1:AuthorizationCode>String</d2p1:AuthorizationCode>
<d2p1:BillingAddr1>String</d2p1:BillingAddr1>
<d2p1:BillingAddr2>String</d2p1:BillingAddr2>
<d2p1:BillingAttn>String</d2p1:BillingAttn>
<d2p1:BillingCity>String</d2p1:BillingCity>
<d2p1:BillingCompany>String</d2p1:BillingCompany>
<d2p1:BillingCountry>String</d2p1:BillingCountry>
<d2p1:BillingFirstName>String</d2p1:BillingFirstName>
<d2p1:BillingLastName>String</d2p1:BillingLastName>
<d2p1:BillingName>String</d2p1:BillingName>
<d2p1:BillingPhone>String</d2p1:BillingPhone>
<d2p1:BillingSt>String</d2p1:BillingSt>
<d2p1:BillingZip>String</d2p1:BillingZip>
<d2p1:CardExpirationMonth>String</d2p1:CardExpirationMonth>
<d2p1:CardExpirationYear>String</d2p1:CardExpirationYear>
<d2p1:CardName>String</d2p1:CardName>
<d2p1:CardSpan>String</d2p1:CardSpan>
<d2p1:CardToken>String</d2p1:CardToken>
<d2p1:CardType>String</d2p1:CardType>
<d2p1:CustomerAcct>0</d2p1:CustomerAcct>
<d2p1:Email>String</d2p1:Email>
<d2p1:EmployeeUsername>String</d2p1:EmployeeUsername>
<d2p1:LineItems>
<d2p1:ThirdPartyOrder.ThirdPartyOrderItem>
<d2p1:ExtPk>0</d2p1:ExtPk>
<d2p1:IsECard>false</d2p1:IsECard>
<d2p1:Location>String</d2p1:Location>
<d2p1:NiCat>0</d2p1:NiCat>
<d2p1:NiSub>0</d2p1:NiSub>
<d2p1:OnApproval>false</d2p1:OnApproval>
<d2p1:Price>0</d2p1:Price>
<d2p1:ProductName>String</d2p1:ProductName>
<d2p1:Qty>0</d2p1:Qty>
<d2p1:QtyPicked>0</d2p1:QtyPicked>
<d2p1:SerialNumber>String</d2p1:SerialNumber>
<d2p1:Sku>String</d2p1:Sku>
<d2p1:UseQtyPicked>false</d2p1:UseQtyPicked>
<d2p1:WebNumber>String</d2p1:WebNumber>
</d2p1:ThirdPartyOrder.ThirdPartyOrderItem>
</d2p1:LineItems>
<d2p1:OrderDate>0001-01-01T00:00:00</d2p1:OrderDate>
<d2p1:OrderNotes>String</d2p1:OrderNotes>
<d2p1:OrderNumber>String</d2p1:OrderNumber>
<d2p1:OrderSource>String</d2p1:OrderSource>
<d2p1:PO>String</d2p1:PO>
<d2p1:PaymentMethod>String</d2p1:PaymentMethod>
<d2p1:PnRef>String</d2p1:PnRef>
<d2p1:ShippingAddr1>String</d2p1:ShippingAddr1>
<d2p1:ShippingAddr2>String</d2p1:ShippingAddr2>
<d2p1:ShippingAttn>String</d2p1:ShippingAttn>
<d2p1:ShippingCity>String</d2p1:ShippingCity>
<d2p1:ShippingCompany>String</d2p1:ShippingCompany>
<d2p1:ShippingCountry>String</d2p1:ShippingCountry>
<d2p1:ShippingFirstName>String</d2p1:ShippingFirstName>
<d2p1:ShippingLastName>String</d2p1:ShippingLastName>
<d2p1:ShippingMethod>String</d2p1:ShippingMethod>
<d2p1:ShippingName>String</d2p1:ShippingName>
<d2p1:ShippingPhone>String</d2p1:ShippingPhone>
<d2p1:ShippingSt>String</d2p1:ShippingSt>
<d2p1:ShippingTotal>0</d2p1:ShippingTotal>
<d2p1:ShippingZip>String</d2p1:ShippingZip>
<d2p1:SubTotal>0</d2p1:SubTotal>
<d2p1:TaxTotal>0</d2p1:TaxTotal>
<d2p1:Total>0</d2p1:Total>
<d2p1:TransactionState>String</d2p1:TransactionState>
</d2p1:ThirdPartyOrder>
</Orders>
</CustomerOrdersRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <CustomerOrdersResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AIM.WebService"> <Status> <DomainName>String</DomainName> <ErrorCode>String</ErrorCode> <ErrorDisplayText>String</ErrorDisplayText> <ErrorMessage>String</ErrorMessage> <IpAddress>String</IpAddress> <Login>String</Login> <StatusCode>String</StatusCode> </Status> </CustomerOrdersResponse>