Trendsic Platform Service

<back to all web services

DispatchSettlementGenerateRequest

Requires Authentication
The following routes are available for this service:
POST,OPTIONS/v1/dispatch/settlements/generate
import 'package:servicestack/servicestack.dart';

class DispatchSettlementDeductionView implements IConvertible
{
    int? DeductionId;
    String? Kind;
    String? Label;
    double? Amount;
    String? Note;

    DispatchSettlementDeductionView({this.DeductionId,this.Kind,this.Label,this.Amount,this.Note});
    DispatchSettlementDeductionView.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        DeductionId = json['DeductionId'];
        Kind = json['Kind'];
        Label = json['Label'];
        Amount = JsonConverters.toDouble(json['Amount']);
        Note = json['Note'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'DeductionId': DeductionId,
        'Kind': Kind,
        'Label': Label,
        'Amount': Amount,
        'Note': Note
    };

    getTypeName() => "DispatchSettlementDeductionView";
    TypeContext? context = _ctx;
}

class DispatchLoadStageView implements IConvertible
{
    String? Stage;
    DateTime? AtUtc;
    String? Note;

    DispatchLoadStageView({this.Stage,this.AtUtc,this.Note});
    DispatchLoadStageView.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Stage = json['Stage'];
        AtUtc = JsonConverters.fromJson(json['AtUtc'],'DateTime',context!);
        Note = json['Note'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Stage': Stage,
        'AtUtc': JsonConverters.toJson(AtUtc,'DateTime',context!),
        'Note': Note
    };

    getTypeName() => "DispatchLoadStageView";
    TypeContext? context = _ctx;
}

class DispatchLoadView implements IConvertible
{
    int? LoadId;
    String? Code;
    String? Module;
    String? TruckLabel;
    String? DriverLabel;
    String? CarrierLabel;
    String? SourceLabel;
    String? DestinationLabel;
    double? Qty;
    String? Unit;
    String? QtyText;
    String? TicketCode;
    double? RateApplied;
    String? RateBasis;
    double? Revenue;
    String? PayPlanLabel;
    double? Pay;
    String? Status;
    DateTime? OpenedUtc;
    DateTime? ClosedUtc;
    int? Photos;
    List<DispatchLoadStageView>? Stages = [];

    DispatchLoadView({this.LoadId,this.Code,this.Module,this.TruckLabel,this.DriverLabel,this.CarrierLabel,this.SourceLabel,this.DestinationLabel,this.Qty,this.Unit,this.QtyText,this.TicketCode,this.RateApplied,this.RateBasis,this.Revenue,this.PayPlanLabel,this.Pay,this.Status,this.OpenedUtc,this.ClosedUtc,this.Photos,this.Stages});
    DispatchLoadView.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        LoadId = json['LoadId'];
        Code = json['Code'];
        Module = json['Module'];
        TruckLabel = json['TruckLabel'];
        DriverLabel = json['DriverLabel'];
        CarrierLabel = json['CarrierLabel'];
        SourceLabel = json['SourceLabel'];
        DestinationLabel = json['DestinationLabel'];
        Qty = JsonConverters.toDouble(json['Qty']);
        Unit = json['Unit'];
        QtyText = json['QtyText'];
        TicketCode = json['TicketCode'];
        RateApplied = JsonConverters.toDouble(json['RateApplied']);
        RateBasis = json['RateBasis'];
        Revenue = JsonConverters.toDouble(json['Revenue']);
        PayPlanLabel = json['PayPlanLabel'];
        Pay = JsonConverters.toDouble(json['Pay']);
        Status = json['Status'];
        OpenedUtc = JsonConverters.fromJson(json['OpenedUtc'],'DateTime',context!);
        ClosedUtc = JsonConverters.fromJson(json['ClosedUtc'],'DateTime',context!);
        Photos = json['Photos'];
        Stages = JsonConverters.fromJson(json['Stages'],'List<DispatchLoadStageView>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'LoadId': LoadId,
        'Code': Code,
        'Module': Module,
        'TruckLabel': TruckLabel,
        'DriverLabel': DriverLabel,
        'CarrierLabel': CarrierLabel,
        'SourceLabel': SourceLabel,
        'DestinationLabel': DestinationLabel,
        'Qty': Qty,
        'Unit': Unit,
        'QtyText': QtyText,
        'TicketCode': TicketCode,
        'RateApplied': RateApplied,
        'RateBasis': RateBasis,
        'Revenue': Revenue,
        'PayPlanLabel': PayPlanLabel,
        'Pay': Pay,
        'Status': Status,
        'OpenedUtc': JsonConverters.toJson(OpenedUtc,'DateTime',context!),
        'ClosedUtc': JsonConverters.toJson(ClosedUtc,'DateTime',context!),
        'Photos': Photos,
        'Stages': JsonConverters.toJson(Stages,'List<DispatchLoadStageView>',context!)
    };

    getTypeName() => "DispatchLoadView";
    TypeContext? context = _ctx;
}

class DispatchSettlementView implements IConvertible
{
    int? SettlementId;
    String? Code;
    int? VendorID;
    String? VendorName;
    DateTime? PeriodStart;
    DateTime? PeriodEnd;
    int? LoadCount;
    double? GrossRevenue;
    double? SplitPct;
    double? CarrierShare;
    double? DeductionsTotal;
    double? Net;
    String? Status;
    String? Notes;
    DateTime? GeneratedUtc;
    DateTime? SentUtc;
    DateTime? ApprovedUtc;
    String? ApprovedBy;
    DateTime? PaidUtc;
    String? PaidRef;
    int? ContactCount;
    List<DispatchSettlementDeductionView>? Deductions = [];
    List<DispatchLoadView>? Loads = [];

    DispatchSettlementView({this.SettlementId,this.Code,this.VendorID,this.VendorName,this.PeriodStart,this.PeriodEnd,this.LoadCount,this.GrossRevenue,this.SplitPct,this.CarrierShare,this.DeductionsTotal,this.Net,this.Status,this.Notes,this.GeneratedUtc,this.SentUtc,this.ApprovedUtc,this.ApprovedBy,this.PaidUtc,this.PaidRef,this.ContactCount,this.Deductions,this.Loads});
    DispatchSettlementView.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        SettlementId = json['SettlementId'];
        Code = json['Code'];
        VendorID = json['VendorID'];
        VendorName = json['VendorName'];
        PeriodStart = JsonConverters.fromJson(json['PeriodStart'],'DateTime',context!);
        PeriodEnd = JsonConverters.fromJson(json['PeriodEnd'],'DateTime',context!);
        LoadCount = json['LoadCount'];
        GrossRevenue = JsonConverters.toDouble(json['GrossRevenue']);
        SplitPct = JsonConverters.toDouble(json['SplitPct']);
        CarrierShare = JsonConverters.toDouble(json['CarrierShare']);
        DeductionsTotal = JsonConverters.toDouble(json['DeductionsTotal']);
        Net = JsonConverters.toDouble(json['Net']);
        Status = json['Status'];
        Notes = json['Notes'];
        GeneratedUtc = JsonConverters.fromJson(json['GeneratedUtc'],'DateTime',context!);
        SentUtc = JsonConverters.fromJson(json['SentUtc'],'DateTime',context!);
        ApprovedUtc = JsonConverters.fromJson(json['ApprovedUtc'],'DateTime',context!);
        ApprovedBy = json['ApprovedBy'];
        PaidUtc = JsonConverters.fromJson(json['PaidUtc'],'DateTime',context!);
        PaidRef = json['PaidRef'];
        ContactCount = json['ContactCount'];
        Deductions = JsonConverters.fromJson(json['Deductions'],'List<DispatchSettlementDeductionView>',context!);
        Loads = JsonConverters.fromJson(json['Loads'],'List<DispatchLoadView>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'SettlementId': SettlementId,
        'Code': Code,
        'VendorID': VendorID,
        'VendorName': VendorName,
        'PeriodStart': JsonConverters.toJson(PeriodStart,'DateTime',context!),
        'PeriodEnd': JsonConverters.toJson(PeriodEnd,'DateTime',context!),
        'LoadCount': LoadCount,
        'GrossRevenue': GrossRevenue,
        'SplitPct': SplitPct,
        'CarrierShare': CarrierShare,
        'DeductionsTotal': DeductionsTotal,
        'Net': Net,
        'Status': Status,
        'Notes': Notes,
        'GeneratedUtc': JsonConverters.toJson(GeneratedUtc,'DateTime',context!),
        'SentUtc': JsonConverters.toJson(SentUtc,'DateTime',context!),
        'ApprovedUtc': JsonConverters.toJson(ApprovedUtc,'DateTime',context!),
        'ApprovedBy': ApprovedBy,
        'PaidUtc': JsonConverters.toJson(PaidUtc,'DateTime',context!),
        'PaidRef': PaidRef,
        'ContactCount': ContactCount,
        'Deductions': JsonConverters.toJson(Deductions,'List<DispatchSettlementDeductionView>',context!),
        'Loads': JsonConverters.toJson(Loads,'List<DispatchLoadView>',context!)
    };

    getTypeName() => "DispatchSettlementView";
    TypeContext? context = _ctx;
}

class DispatchSettlementSuggestView implements IConvertible
{
    int? VendorID;
    String? VendorName;
    double? SplitPct;
    String? Terms;
    bool? W9OnFile;
    DateTime? CoiExpires;
    DateTime? PeriodStart;
    DateTime? PeriodEnd;
    int? UnsettledLoads;
    int? UnpricedLoads;
    double? UnsettledPay;

    DispatchSettlementSuggestView({this.VendorID,this.VendorName,this.SplitPct,this.Terms,this.W9OnFile,this.CoiExpires,this.PeriodStart,this.PeriodEnd,this.UnsettledLoads,this.UnpricedLoads,this.UnsettledPay});
    DispatchSettlementSuggestView.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        VendorID = json['VendorID'];
        VendorName = json['VendorName'];
        SplitPct = JsonConverters.toDouble(json['SplitPct']);
        Terms = json['Terms'];
        W9OnFile = json['W9OnFile'];
        CoiExpires = JsonConverters.fromJson(json['CoiExpires'],'DateTime',context!);
        PeriodStart = JsonConverters.fromJson(json['PeriodStart'],'DateTime',context!);
        PeriodEnd = JsonConverters.fromJson(json['PeriodEnd'],'DateTime',context!);
        UnsettledLoads = json['UnsettledLoads'];
        UnpricedLoads = json['UnpricedLoads'];
        UnsettledPay = JsonConverters.toDouble(json['UnsettledPay']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'VendorID': VendorID,
        'VendorName': VendorName,
        'SplitPct': SplitPct,
        'Terms': Terms,
        'W9OnFile': W9OnFile,
        'CoiExpires': JsonConverters.toJson(CoiExpires,'DateTime',context!),
        'PeriodStart': JsonConverters.toJson(PeriodStart,'DateTime',context!),
        'PeriodEnd': JsonConverters.toJson(PeriodEnd,'DateTime',context!),
        'UnsettledLoads': UnsettledLoads,
        'UnpricedLoads': UnpricedLoads,
        'UnsettledPay': UnsettledPay
    };

    getTypeName() => "DispatchSettlementSuggestView";
    TypeContext? context = _ctx;
}

class DispatchSettlementsResponse implements IConvertible
{
    List<DispatchSettlementView>? Settlements = [];
    DispatchSettlementView? Settlement;
    List<DispatchSettlementSuggestView>? Suggestions = [];
    ResponseStatus? ResponseStatus;

    DispatchSettlementsResponse({this.Settlements,this.Settlement,this.Suggestions,this.ResponseStatus});
    DispatchSettlementsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Settlements = JsonConverters.fromJson(json['Settlements'],'List<DispatchSettlementView>',context!);
        Settlement = JsonConverters.fromJson(json['Settlement'],'DispatchSettlementView',context!);
        Suggestions = JsonConverters.fromJson(json['Suggestions'],'List<DispatchSettlementSuggestView>',context!);
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Settlements': JsonConverters.toJson(Settlements,'List<DispatchSettlementView>',context!),
        'Settlement': JsonConverters.toJson(Settlement,'DispatchSettlementView',context!),
        'Suggestions': JsonConverters.toJson(Suggestions,'List<DispatchSettlementSuggestView>',context!),
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!)
    };

    getTypeName() => "DispatchSettlementsResponse";
    TypeContext? context = _ctx;
}

class DispatchSettlementGenerateRequest implements IConvertible
{
    int? VendorID;
    DateTime? PeriodStart;
    DateTime? PeriodEnd;

    DispatchSettlementGenerateRequest({this.VendorID,this.PeriodStart,this.PeriodEnd});
    DispatchSettlementGenerateRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        VendorID = json['VendorID'];
        PeriodStart = JsonConverters.fromJson(json['PeriodStart'],'DateTime',context!);
        PeriodEnd = JsonConverters.fromJson(json['PeriodEnd'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'VendorID': VendorID,
        'PeriodStart': JsonConverters.toJson(PeriodStart,'DateTime',context!),
        'PeriodEnd': JsonConverters.toJson(PeriodEnd,'DateTime',context!)
    };

    getTypeName() => "DispatchSettlementGenerateRequest";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'DispatchSettlementDeductionView': TypeInfo(TypeOf.Class, create:() => DispatchSettlementDeductionView()),
    'DispatchLoadStageView': TypeInfo(TypeOf.Class, create:() => DispatchLoadStageView()),
    'DispatchLoadView': TypeInfo(TypeOf.Class, create:() => DispatchLoadView()),
    'List<DispatchLoadStageView>': TypeInfo(TypeOf.Class, create:() => <DispatchLoadStageView>[]),
    'DispatchSettlementView': TypeInfo(TypeOf.Class, create:() => DispatchSettlementView()),
    'List<DispatchSettlementDeductionView>': TypeInfo(TypeOf.Class, create:() => <DispatchSettlementDeductionView>[]),
    'List<DispatchLoadView>': TypeInfo(TypeOf.Class, create:() => <DispatchLoadView>[]),
    'DispatchSettlementSuggestView': TypeInfo(TypeOf.Class, create:() => DispatchSettlementSuggestView()),
    'DispatchSettlementsResponse': TypeInfo(TypeOf.Class, create:() => DispatchSettlementsResponse()),
    'List<DispatchSettlementView>': TypeInfo(TypeOf.Class, create:() => <DispatchSettlementView>[]),
    'List<DispatchSettlementSuggestView>': TypeInfo(TypeOf.Class, create:() => <DispatchSettlementSuggestView>[]),
    'DispatchSettlementGenerateRequest': TypeInfo(TypeOf.Class, create:() => DispatchSettlementGenerateRequest()),
});

Dart DispatchSettlementGenerateRequest 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/dispatch/settlements/generate HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	VendorID: 0,
	PeriodStart: 0001-01-01,
	PeriodEnd: 0001-01-01
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Settlements: 
	[
		{
			SettlementId: 0,
			Code: String,
			VendorID: 0,
			VendorName: String,
			PeriodStart: 0001-01-01,
			PeriodEnd: 0001-01-01,
			LoadCount: 0,
			GrossRevenue: 0,
			SplitPct: 0,
			CarrierShare: 0,
			DeductionsTotal: 0,
			Net: 0,
			Status: String,
			Notes: String,
			GeneratedUtc: 0001-01-01,
			SentUtc: 0001-01-01,
			ApprovedUtc: 0001-01-01,
			ApprovedBy: String,
			PaidUtc: 0001-01-01,
			PaidRef: String,
			ContactCount: 0,
			Deductions: 
			[
				{
					DeductionId: 0,
					Kind: String,
					Label: String,
					Amount: 0,
					Note: String
				}
			],
			Loads: 
			[
				{
					LoadId: 0,
					Code: String,
					Module: String,
					TruckLabel: String,
					DriverLabel: String,
					CarrierLabel: String,
					SourceLabel: String,
					DestinationLabel: String,
					Qty: 0,
					Unit: String,
					QtyText: String,
					TicketCode: String,
					RateApplied: 0,
					RateBasis: String,
					Revenue: 0,
					PayPlanLabel: String,
					Pay: 0,
					Status: String,
					OpenedUtc: 0001-01-01,
					ClosedUtc: 0001-01-01,
					Photos: 0,
					Stages: 
					[
						{
							Stage: String,
							AtUtc: 0001-01-01,
							Note: String
						}
					]
				}
			]
		}
	],
	Settlement: 
	{
		SettlementId: 0,
		Code: String,
		VendorID: 0,
		VendorName: String,
		PeriodStart: 0001-01-01,
		PeriodEnd: 0001-01-01,
		LoadCount: 0,
		GrossRevenue: 0,
		SplitPct: 0,
		CarrierShare: 0,
		DeductionsTotal: 0,
		Net: 0,
		Status: String,
		Notes: String,
		GeneratedUtc: 0001-01-01,
		SentUtc: 0001-01-01,
		ApprovedUtc: 0001-01-01,
		ApprovedBy: String,
		PaidUtc: 0001-01-01,
		PaidRef: String,
		ContactCount: 0,
		Deductions: 
		[
			{
				DeductionId: 0,
				Kind: String,
				Label: String,
				Amount: 0,
				Note: String
			}
		],
		Loads: 
		[
			{
				LoadId: 0,
				Code: String,
				Module: String,
				TruckLabel: String,
				DriverLabel: String,
				CarrierLabel: String,
				SourceLabel: String,
				DestinationLabel: String,
				Qty: 0,
				Unit: String,
				QtyText: String,
				TicketCode: String,
				RateApplied: 0,
				RateBasis: String,
				Revenue: 0,
				PayPlanLabel: String,
				Pay: 0,
				Status: String,
				OpenedUtc: 0001-01-01,
				ClosedUtc: 0001-01-01,
				Photos: 0,
				Stages: 
				[
					{
						Stage: String,
						AtUtc: 0001-01-01,
						Note: String
					}
				]
			}
		]
	},
	Suggestions: 
	[
		{
			VendorID: 0,
			VendorName: String,
			SplitPct: 0,
			Terms: String,
			W9OnFile: False,
			CoiExpires: 0001-01-01,
			PeriodStart: 0001-01-01,
			PeriodEnd: 0001-01-01,
			UnsettledLoads: 0,
			UnpricedLoads: 0,
			UnsettledPay: 0
		}
	],
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}