| Requires any of the roles: | Agent, Administrator |
| GET,OPTIONS | /v1/CommissionBatchSecurities/{CommissionBatchId} | ||
|---|---|---|---|
| GET,POST,OPTIONS | /v1/CommissionBatchSecurities |
<?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 Ledger implements JsonSerializable
{
public function __construct(
/** @var int */
public int $LedgerId=0,
/** @var int */
public int $AgentId=0,
/** @var int */
public int $CommissionBatchId=0,
/** @var string|null */
public ?string $Rank=null,
/** @var float */
public float $Commissions=0.0,
/** @var float */
public float $Clawbacks=0.0,
/** @var float */
public float $Adjustments=0.0,
/** @var float */
public float $PreviousBalance=0.0,
/** @var float */
public float $ASAPCharges=0.0,
/** @var float */
public float $Payout=0.0,
/** @var float */
public float $BalanceForward=0.0
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['LedgerId'])) $this->LedgerId = $o['LedgerId'];
if (isset($o['AgentId'])) $this->AgentId = $o['AgentId'];
if (isset($o['CommissionBatchId'])) $this->CommissionBatchId = $o['CommissionBatchId'];
if (isset($o['Rank'])) $this->Rank = $o['Rank'];
if (isset($o['Commissions'])) $this->Commissions = $o['Commissions'];
if (isset($o['Clawbacks'])) $this->Clawbacks = $o['Clawbacks'];
if (isset($o['Adjustments'])) $this->Adjustments = $o['Adjustments'];
if (isset($o['PreviousBalance'])) $this->PreviousBalance = $o['PreviousBalance'];
if (isset($o['ASAPCharges'])) $this->ASAPCharges = $o['ASAPCharges'];
if (isset($o['Payout'])) $this->Payout = $o['Payout'];
if (isset($o['BalanceForward'])) $this->BalanceForward = $o['BalanceForward'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->LedgerId)) $o['LedgerId'] = $this->LedgerId;
if (isset($this->AgentId)) $o['AgentId'] = $this->AgentId;
if (isset($this->CommissionBatchId)) $o['CommissionBatchId'] = $this->CommissionBatchId;
if (isset($this->Rank)) $o['Rank'] = $this->Rank;
if (isset($this->Commissions)) $o['Commissions'] = $this->Commissions;
if (isset($this->Clawbacks)) $o['Clawbacks'] = $this->Clawbacks;
if (isset($this->Adjustments)) $o['Adjustments'] = $this->Adjustments;
if (isset($this->PreviousBalance)) $o['PreviousBalance'] = $this->PreviousBalance;
if (isset($this->ASAPCharges)) $o['ASAPCharges'] = $this->ASAPCharges;
if (isset($this->Payout)) $o['Payout'] = $this->Payout;
if (isset($this->BalanceForward)) $o['BalanceForward'] = $this->BalanceForward;
return empty($o) ? new class(){} : $o;
}
}
class LedgerExtended extends Ledger implements JsonSerializable
{
/**
* @param int $LedgerId
* @param int $AgentId
* @param int $CommissionBatchId
* @param string|null $Rank
* @param float $Commissions
* @param float $Clawbacks
* @param float $Adjustments
* @param float $PreviousBalance
* @param float $ASAPCharges
* @param float $Payout
* @param float $BalanceForward
*/
public function __construct(
int $LedgerId=0,
int $AgentId=0,
int $CommissionBatchId=0,
?string $Rank=null,
float $Commissions=0.0,
float $Clawbacks=0.0,
float $Adjustments=0.0,
float $PreviousBalance=0.0,
float $ASAPCharges=0.0,
float $Payout=0.0,
float $BalanceForward=0.0,
/** @var string|null */
public ?string $AgentFirstName=null,
/** @var string|null */
public ?string $AgentLastName=null,
/** @var string|null */
public ?string $AgentName=null,
/** @var float */
public float $AgentLevel=0.0,
/** @var string|null */
public ?string $PayChexId=null
) {
parent::__construct($LedgerId,$AgentId,$CommissionBatchId,$Rank,$Commissions,$Clawbacks,$Adjustments,$PreviousBalance,$ASAPCharges,$Payout,$BalanceForward);
}
/** @throws Exception */
public function fromMap($o): void {
parent::fromMap($o);
if (isset($o['AgentFirstName'])) $this->AgentFirstName = $o['AgentFirstName'];
if (isset($o['AgentLastName'])) $this->AgentLastName = $o['AgentLastName'];
if (isset($o['AgentName'])) $this->AgentName = $o['AgentName'];
if (isset($o['AgentLevel'])) $this->AgentLevel = $o['AgentLevel'];
if (isset($o['PayChexId'])) $this->PayChexId = $o['PayChexId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = parent::jsonSerialize();
if (isset($this->AgentFirstName)) $o['AgentFirstName'] = $this->AgentFirstName;
if (isset($this->AgentLastName)) $o['AgentLastName'] = $this->AgentLastName;
if (isset($this->AgentName)) $o['AgentName'] = $this->AgentName;
if (isset($this->AgentLevel)) $o['AgentLevel'] = $this->AgentLevel;
if (isset($this->PayChexId)) $o['PayChexId'] = $this->PayChexId;
return empty($o) ? new class(){} : $o;
}
}
class CommissionBatchSecuritiesResponse implements JsonSerializable
{
public function __construct(
/** @var ResponseStatus|null */
public ?ResponseStatus $ResponseStatus=null,
/** @var array<LedgerExtended>|null */
public ?array $ReportData=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['ResponseStatus'])) $this->ResponseStatus = JsonConverters::from('ResponseStatus', $o['ResponseStatus']);
if (isset($o['ReportData'])) $this->ReportData = JsonConverters::fromArray('LedgerExtended', $o['ReportData']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->ResponseStatus)) $o['ResponseStatus'] = JsonConverters::to('ResponseStatus', $this->ResponseStatus);
if (isset($this->ReportData)) $o['ReportData'] = JsonConverters::toArray('LedgerExtended', $this->ReportData);
return empty($o) ? new class(){} : $o;
}
}
class CommissionBatchSecuritiesRequest implements JsonSerializable
{
public function __construct(
/** @var int */
public int $CommissionBatchId=0,
/** @var array<LedgerExtended>|null */
public ?array $Ledger=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['CommissionBatchId'])) $this->CommissionBatchId = $o['CommissionBatchId'];
if (isset($o['Ledger'])) $this->Ledger = JsonConverters::fromArray('LedgerExtended', $o['Ledger']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->CommissionBatchId)) $o['CommissionBatchId'] = $this->CommissionBatchId;
if (isset($this->Ledger)) $o['Ledger'] = JsonConverters::toArray('LedgerExtended', $this->Ledger);
return empty($o) ? new class(){} : $o;
}
}
PHP CommissionBatchSecuritiesRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/CommissionBatchSecurities HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
CommissionBatchId: 0,
Ledger:
[
{
AgentFirstName: String,
AgentLastName: String,
AgentName: String,
AgentLevel: 0,
PayChexId: String,
LedgerId: 0,
AgentId: 0,
CommissionBatchId: 0,
Rank: String,
Commissions: 0,
Clawbacks: 0,
Adjustments: 0,
PreviousBalance: 0,
ASAPCharges: 0,
Payout: 0,
BalanceForward: 0
}
]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
},
ReportData:
[
{
AgentFirstName: String,
AgentLastName: String,
AgentName: String,
AgentLevel: 0,
PayChexId: String,
LedgerId: 0,
AgentId: 0,
CommissionBatchId: 0,
Rank: String,
Commissions: 0,
Clawbacks: 0,
Adjustments: 0,
PreviousBalance: 0,
ASAPCharges: 0,
Payout: 0,
BalanceForward: 0
}
]
}