Trendsic Platform Service

<back to all web services

CommissionBatchRequest

Requires Authentication
Requires any of the roles:Agent, Administrator, Agent, Administrator
The following routes are available for this service:
GET,OPTIONS/v1/CommissionBatch/{CommissionBatchId}
GET,POST,OPTIONS/v1/CommissionBatch
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Ledger:
    ledger_id: int = 0
    agent_id: int = 0
    commission_batch_id: int = 0
    rank: Optional[str] = None
    commissions: Decimal = decimal.Decimal(0)
    clawbacks: Decimal = decimal.Decimal(0)
    adjustments: Decimal = decimal.Decimal(0)
    previous_balance: Decimal = decimal.Decimal(0)
    asap_charges: Decimal = decimal.Decimal(0)
    payout: Decimal = decimal.Decimal(0)
    balance_forward: Decimal = decimal.Decimal(0)


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class LedgerExtended(Ledger):
    agent_first_name: Optional[str] = None
    agent_last_name: Optional[str] = None
    agent_name: Optional[str] = None
    agent_level: Decimal = decimal.Decimal(0)
    pay_chex_id: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CommissionBatchResponse:
    response_status: Optional[ResponseStatus] = None
    report_data: List[LedgerExtended] = field(default_factory=list)


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CommissionBatchRequest:
    commission_batch_id: int = 0
    ledger: List[LedgerExtended] = field(default_factory=list)

Python CommissionBatchRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /v1/CommissionBatch 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
		}
	]
}